diagnostics: STRATA_DUMP_FIRST_LOGITS writes the first generated token's logits
STRATA_DUMP_FIRST_LOGITS=<file>: the logits of the first window's first position (the token the prompt predicts), n_vocab float32, written once per run. Two engine variants run on the same prompt then give a first-token KL divergence: how far a prompt-path change moves the model's distribution, not only whether its top token changed. On a layer split the last stage's verifier writes it.
This commit is contained in:
1 parent
6ac1a2cc5e
commit
aea6e45c64
3 files changed
+20
No files matched your search
@@ -5833,6 +5833,16 @@ int main(int argc, char** argv) {
|
||||
if (first_window) {
|
||||
first_window = false;
|
||||
ttft_ms = std::chrono::duration<double, std::milli>(Clock::now() - t_start).count();
|
||||
// Diagnostics: the first window runs the prompt's last token over the state the prompt path left
|
||||
// (keys, values, recurrent state), so its logits carry whatever that path did. A native pack never
|
||||
// runs the per-token loop --dump-logits reads; this is where prompt paths can be compared by output.
|
||||
if (const char* fl = std::getenv("STRATA_DUMP_FIRST_LOGITS")) {
|
||||
std::vector<float> row((size_t) ver.vocab());
|
||||
std::FILE* f = ver.copy_logits(0, row.data()) ? std::fopen(fl, "wb") : nullptr;
|
||||
if (f == nullptr || std::fwrite(row.data(), sizeof(float), row.size(), f) != row.size())
|
||||
std::fprintf(stderr, "strata generate: STRATA_DUMP_FIRST_LOGITS: cannot write %s\n", fl);
|
||||
if (f) std::fclose(f);
|
||||
}
|
||||
}
|
||||
// plan v0.3 P6: the adaptive tier's host work (ranking, copy submission) runs on its own thread while the
|
||||
// GPU commits and drafts; it touches only the residency tables, which nothing reads until the next window
|
||||
|
||||
Reference in new issue
Block a user