Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

serve: STRATA_DUMP_FIRST_LOGITS also writes each request's first-window logits (<path>.<n>), to compare prompt paths by KL

Niko1221421e163a3098
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 914d37f5d..f6252cc54 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -10518,6 +10518,20 @@ int main(int argc, char** argv) {
std::printf("ERR %s\n", drive.d.failed && drive.d.fail ? drive.d.fail : err.c_str());
return 1;
}
+ // Diagnostics (as in generate): STRATA_DUMP_FIRST_LOGITS=<path> writes the logits of each request's first
+ // window to <path>.<n>, so the prompt paths (a peer card's share, a split) can be compared by KL
+ if (first_window) {
+ static const char* fl = std::getenv("STRATA_DUMP_FIRST_LOGITS");
+ static int fl_n = 0;
+ if (fl != nullptr) {
+ std::vector<float> row((size_t) ver.vocab());
+ const std::string path = std::string(fl) + "." + std::to_string(fl_n++);
+ std::FILE* f = ver.copy_logits(0, row.data()) ? std::fopen(path.c_str(), "wb") : nullptr;
+ if (f == nullptr || std::fwrite(row.data(), sizeof(float), row.size(), f) != row.size())
+ std::fprintf(stderr, "strata serve: STRATA_DUMP_FIRST_LOGITS: cannot write %s\n", path.c_str());
+ if (f) std::fclose(f);
+ }
+ }
int a = 0;
while (a < T - 1 && window[(size_t) a + 1] == outv[(size_t) a]) ++a;
if (from_sfx) { ++sfx_windows; sfx_drafts += T - 1; sfx_ok += a; }