[PR #462] [CLOSED] diagnostics: dump every verify window's logits, so greedy decode can be bisected #2651

Closed
opened 2026-11-04 02:02:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/462
Author: @constantindjonkam
Created: 10/2/2026
Status: ❌ Closed

Base: main ← Head: pr/1-per-window-diagnostics


📝 Commits (10+)

  • a348c7a Merge branch 'f-131-srv' into r131-q4
  • b93a00c Merge branch 'f-q4-on242' into r131-q4
  • 8f5148c CS-T: the partial pin at most 24 GiB (STRATA_PARTIAL_PIN_GIB), the Q4_K/Q5_1/Q8_0 multi-token kernels from two tokens on
  • 5ffda19 CS-T: the GGUF-in-place prefetch asks Windows for all of a layer's missed slices at once (PrefetchVirtualMemory)
  • ed6c124 #253: the 8 GiB arena pin cap only under WDDM; STRATA_ARENA_PIN_GIB; the split's prompt chunk steps down
  • 450149d --split-skip-if-fits (opt-in): an auto split runs on the main card alone when it holds every profiled expert + KV
  • 6926e0b Merge branch 'f-131-amd' into r131-amd
  • c7aa3e5 Revert #257 (AVX2 two-block Q2_0 unpack): bit-exact but not faster on an AVX2-only CPU (Ryzen 9 3900X: gate/up -2.6..-4.7% at 1 token, down -3..-5% at 2 tokens)
  • 2736bd0 CS-T: the partial pin locks only what it does not register and ends at an expert boundary; the Q4_K/Q5_1/Q8_0 multi-token kernels opt-in (STRATA_KQ256=1)
  • de3f045 decode: hyper-connection read in 2 kernels - norm folded into a stream-split down kernel (164 blocks), rs/lo/inject in up's prologue (STRATA_GR_V3=0 = old)

📊 Changes

5 files changed (+153 additions, -0 deletions)

View changed files

➕ bench-probes/bisect.js (+14 -0)
➕ bench-probes/serve-adapt-probe.sh (+29 -0)
➕ bench-probes/serve-first-probe.sh (+30 -0)
➕ bench-probes/serve-state-hash.sh (+34 -0)
➕ bench-probes/serve-warmup-probe.sh (+46 -0)

📄 Description

What

A diagnostic that makes greedy decode bisectable, plus the traces that localised a real bug.

Greedy output on a two-GPU split was not reproducible: repeated identical requests diverged from
about the 28th generated character. Expert routing was byte-identical across runs and the first
verify window's logits were byte-identical, so both were ruled out by measurement rather than by
argument. What remained needed a way to see which verify window stopped reproducing.

--dump-logits cannot do that. It is written from the per-token loop, which a native pack leaves at

if (native_pack) { spec_pos = pos; break; }

before the dump site. (Fixing that is a separate, small PR.)

What this adds

  • STRATA_DUMP_WINDOW_LOGITS=<path> records row 0 of every verify window - the row that chose the
    next token - with the position, the window length T and the accepted count a.
    Records are streamed and no count is declared up front, so a run killed mid-write leaves a short
    file rather than one that lies about its contents.
  • Env-gated traces, off by default: STRATA_TRACE_ADAPT (whether an adaptive round considered,
    skipped or swapped, and whether the previous round's copies had landed) and STRATA_TRACE_RES (a
    digest of the expert residency table per request).
  • The four probe scripts used to run all of this, under bench-probes/.

The file format lives in its own header so it is testable without a GPU:
window_logits_dump_test round-trips synthetic windows, and checks that a foreign or missing file is
rejected rather than misread.

Cost

Default off: one function-local static getenv, and nothing opened, copied or allocated on the
default path.

Evidence it produced

With the per-window dump, on an IQ3_XXS / RTX 3090 run with --adapt-every 4:

windows 0-15   bit-identical across 5 runs
window 16 (pos=86)   runs fork: 3 of 5 agreed, 2 differed
8 of 24 windows differing afterwards; max |delta logit| 0.266

which pointed at the adaptive tier and became the fix in
#463, merged in 0.1.38. That release also waits
for the swap by default (STRATA_ADAPT_NOWAIT=1 opts out), so the property this probe depends on is
on for everyone - not only for people who read the note.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/462 **Author:** [@constantindjonkam](https://github.com/constantindjonkam) **Created:** 10/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/1-per-window-diagnostics` --- ### 📝 Commits (10+) - [`a348c7a`](https://github.com/Niko1221/Strata/commit/a348c7a4ed64f5f7f24ce3f1cba2d1439f673fed) Merge branch 'f-131-srv' into r131-q4 - [`b93a00c`](https://github.com/Niko1221/Strata/commit/b93a00c65a21fcc5b6431b8091e348d2976259f0) Merge branch 'f-q4-on242' into r131-q4 - [`8f5148c`](https://github.com/Niko1221/Strata/commit/8f5148c14d34c404e8a2d6a45188088714f3c9bb) CS-T: the partial pin at most 24 GiB (STRATA_PARTIAL_PIN_GIB), the Q4_K/Q5_1/Q8_0 multi-token kernels from two tokens on - [`5ffda19`](https://github.com/Niko1221/Strata/commit/5ffda19098202b82943fc80281ce0eb34d8e08a3) CS-T: the GGUF-in-place prefetch asks Windows for all of a layer's missed slices at once (PrefetchVirtualMemory) - [`ed6c124`](https://github.com/Niko1221/Strata/commit/ed6c1244dcd31789007540cb9d8498fbd4134b7f) #253: the 8 GiB arena pin cap only under WDDM; STRATA_ARENA_PIN_GIB; the split's prompt chunk steps down - [`450149d`](https://github.com/Niko1221/Strata/commit/450149d3f248438d8a2526c600b5a75c3dbea6c6) --split-skip-if-fits (opt-in): an auto split runs on the main card alone when it holds every profiled expert + KV - [`6926e0b`](https://github.com/Niko1221/Strata/commit/6926e0b4f4f72cda4f95a0218a89500135af7e4e) Merge branch 'f-131-amd' into r131-amd - [`c7aa3e5`](https://github.com/Niko1221/Strata/commit/c7aa3e5c18a57433d2fe3e131bf3e44da9f82c0d) Revert #257 (AVX2 two-block Q2_0 unpack): bit-exact but not faster on an AVX2-only CPU (Ryzen 9 3900X: gate/up -2.6..-4.7% at 1 token, down -3..-5% at 2 tokens) - [`2736bd0`](https://github.com/Niko1221/Strata/commit/2736bd0a70c0295c19c4670f1a8c18c75fed2f6d) CS-T: the partial pin locks only what it does not register and ends at an expert boundary; the Q4_K/Q5_1/Q8_0 multi-token kernels opt-in (STRATA_KQ256=1) - [`de3f045`](https://github.com/Niko1221/Strata/commit/de3f0454a762147a03698eb2860427cb1ff36aaa) decode: hyper-connection read in 2 kernels - norm folded into a stream-split down kernel (164 blocks), rs/lo/inject in up's prologue (STRATA_GR_V3=0 = old) ### 📊 Changes **5 files changed** (+153 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `bench-probes/bisect.js` (+14 -0) ➕ `bench-probes/serve-adapt-probe.sh` (+29 -0) ➕ `bench-probes/serve-first-probe.sh` (+30 -0) ➕ `bench-probes/serve-state-hash.sh` (+34 -0) ➕ `bench-probes/serve-warmup-probe.sh` (+46 -0) </details> ### 📄 Description ## What A diagnostic that makes greedy decode bisectable, plus the traces that localised a real bug. Greedy output on a two-GPU split was **not reproducible**: repeated identical requests diverged from about the 28th generated character. Expert routing was byte-identical across runs and the first verify window's logits were byte-identical, so both were ruled out by measurement rather than by argument. What remained needed a way to see **which verify window** stopped reproducing. `--dump-logits` cannot do that. It is written from the per-token loop, which a native pack leaves at if (native_pack) { spec_pos = pos; break; } before the dump site. (Fixing that is a separate, small PR.) ## What this adds - **`STRATA_DUMP_WINDOW_LOGITS=<path>`** records row 0 of every verify window - the row that chose the next token - with the position, the window length `T` and the accepted count `a`. Records are streamed and **no count is declared up front**, so a run killed mid-write leaves a short file rather than one that lies about its contents. - **Env-gated traces, off by default**: `STRATA_TRACE_ADAPT` (whether an adaptive round considered, skipped or swapped, and whether the previous round's copies had landed) and `STRATA_TRACE_RES` (a digest of the expert residency table per request). - The four probe scripts used to run all of this, under `bench-probes/`. The file format lives in its own header so it is testable **without a GPU**: `window_logits_dump_test` round-trips synthetic windows, and checks that a foreign or missing file is rejected rather than misread. ## Cost Default off: one function-local `static` getenv, and nothing opened, copied or allocated on the default path. ## Evidence it produced With the per-window dump, on an IQ3_XXS / RTX 3090 run with `--adapt-every 4`: windows 0-15 bit-identical across 5 runs window 16 (pos=86) runs fork: 3 of 5 agreed, 2 differed 8 of 24 windows differing afterwards; max |delta logit| 0.266 which pointed at the adaptive tier and became the fix in [#463](https://github.com/Niko1221/Strata/pull/463), **merged in 0.1.38**. That release also waits for the swap by default (`STRATA_ADAPT_NOWAIT=1` opts out), so the property this probe depends on is on for everyone - not only for people who read the note. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2651
No description provided.