Merge branch 'f-131-fix' into r131-fix

This commit is contained in:
Niko1221 committed 2026-09-30 22:03:31 +02:00
commit c67c90fa03
15 files changed
+385 -34

No files matched your search

+23 -5
View File
@@ -722,11 +722,19 @@ MemSample mem_sample() {
return m;
}
// the stage the watchdog names: "<where> <detail>", and the prompt chunk a batched read is in (#251)
std::string stage_text() {
const strata::core::Progress& p = strata::core::progress();
std::string s = std::string(p.where.load()) + " " + std::to_string((long long) p.detail.load());
if (const int64_t c = p.chunk.load(); c >= 0) s += " of the prompt chunk from token " + std::to_string((long long) c);
return s;
}
void stall_report(std::FILE* f, uint64_t layers_during) {
strata::core::Progress& p = strata::core::progress();
std::fprintf(f, "strata serve: stall report (engine %s): stage \"%s %lld\" for %lld s; %llu layers served since the "
"last finished step (0 = stopped, more = slow)\n", STRATA_VERSION, p.where.load(),
(long long) p.detail.load(), (long long) ((strata::core::progress_now_ms() - p.since_ms.load()) / 1000),
std::fprintf(f, "strata serve: stall report (engine %s): stage \"%s\" for %lld s; %llu layers served since the "
"last finished step (0 = stopped, more = slow)\n", STRATA_VERSION, stage_text().c_str(),
(long long) ((strata::core::progress_now_ms() - p.since_ms.load()) / 1000),
(unsigned long long) layers_during);
for (int pass = 0; pass < 2; ++pass) {
if (pass == 1) {
@@ -1493,6 +1501,15 @@ int main(int argc, char** argv) {
// compiled `/arch:AVX512`, so on a CPU without those features it does not fail - it executes an illegal
// instruction at some unpredictable token. Refusing at second zero is the whole point of P2.S3's check.
strata::kernels::cpu::expert_set_oracle_q8_0(o.cpu_oracle_q8_0);
// ... and nothing runs on a CPU without AVX2: every CPU expert kernel is AVX2 at least (the AVX-512 ones are
// chosen above it), and so is ggml-cpu in the release build, which the native pack's layout load initializes
// next. Refused here, by name, rather than an illegal instruction in the first expert.
if (!strata::kernels::cpu::cpu_avx2_ok()) {
std::fprintf(stderr, "strata generate: this CPU (%s) does not support AVX2 with FMA and F16C, which every CPU "
"expert kernel needs; Strata runs on Intel Haswell (2013), AMD Zen (2017) or newer\n",
strata::kernels::cpu::cpu_name().c_str());
return 2;
}
std::string err;
if (!o.native_head_gguf.empty() && !o.stream_token) {
@@ -4102,10 +4119,11 @@ int main(int argc, char** argv) {
const uint64_t b = p.beats.load();
if (!p.busy.load() || b != last) { last = b; ticks_at = p.ticks.load(); since = now; continue; }
if (now - since < std::chrono::seconds(limit)) continue;
std::fprintf(stderr, "strata serve: no progress for %d s during a request (%s %lld) - stopping "
std::fprintf(stderr, "strata serve: no progress for %d s during a request (%s) - stopping "
"the engine so the server starts it again (issue #29)\n",
limit, p.where.load(), (long long) p.detail.load());
limit, stage_text().c_str());
stall_report(stderr, p.ticks.load() - ticks_at);
strata::core::release_gpu_waits(stderr); // #267: no spin kernel outlives the process
std::fflush(stderr);
std::abort();
}