Repository navigation
Conversation
Two sources made a prefix-cache warm turn compute a different trajectory than a caching-off run of the same prompt: 1. Single-stream marconi replay suppressed KV writes below cached_prefix_tokens, so the replayed tokens' K/V stayed at values computed under the original pass layout while the SSM state came from the replay layout — an inconsistent pair that flips near-tied argmax at temp 0. The batched path already rewrites from 0; match it. 2. The tail-checkpoint split was gated on prefix_cache.is_active(), so caching-off prefills took a single-pass layout while caching-on split — the same prompt produced different hidden states between the two modes. Make the split a function of absolute token position only (fire whenever the model has SSM layers; the checkpoint save inside already gates on an enabled snapshot pool).
|
Thanks for the contribution. Before we can merge, please sign our Contributor License Agreement by replying to this comment with:
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
strix 27B leg for #158 (AzeezStrix, gfx1151, 64 GB, Linux ROCm 7.13): on this box cache-on ≠ cache-off persists with #171. Its effect is on the cache-OFF output only. Harness: the strix #158 battery (job 175's
¹ #163 in default mode. It was byte-identical to main in both arms under DFlash2 (OFF 24/24, ON 24/24). I did not boot main itself without speculation. Controls. Identical code paths reproduce byte-for-byte across separate boots and builds:
So the ON/OFF differences are path effects, not run-to-run noise. Every r1 is identical in every arm, and no tool call differs. What #171 changes here.
That fits fix (2): the tail split now also fires on caching-off prefills and moves the cold layout. Fix (1) didn't change the warm output on this battery. The net ON==OFF count doesn't improve on this box: 21 → 21 with DFlash2, 22 → 20 without speculation. Since the mismatch survives with speculation off, it sits in the cache path, not the DFlash2 verify path. Most diffs are wording-level ("October 1" vs "Oct 1", bullet list vs inline ETA). One is not. With speculation off, the cache-ON Cairo r2 is ON arms log Marconi hits=12 and These are observations from one box with one run per arm. Artifacts on strix are under |
|
Closing in favour of #163 for #158. On the strix 27B battery this change left cache-on != cache-off (21/24 under DFlash2, 20/24 without speculation) and its effect landed on the cache-OFF output; #163's |
Summary
Fixes the temp-0 divergence between prefix-caching-on and caching-off runs
reported in #158 — the Flash-Next tool round-trip that re-called the tool
instead of answering.
Two independent sources made a warm turn compute a different trajectory:
cached_prefix_tokens(forward_layers.rs). The replay recomputes hiddenstates under its own pass layout, so attention K/V for
[snap_tok, matched)kept values computed under the original layout — aninconsistent pair at a near-tied argmax. The batched path already rewrites
the replayed range (
kv_write_start_eff = 0); the single-stream path nowmatches it.
prefix_cache.is_active()(
prefill_b.rs), so caching-off prefills took a single-pass layout whilecaching-on split at
floor((N-1)/bs)*bs - bs. Same prompt, two passlayouts, temp-0 flips. The split is now a function of absolute token
position only (SSM models; the checkpoint save still gates on an enabled
snapshot pool). Cost: +1 small pass on caching-off single-shot prefills —
the price of cold/warm/on/off sharing one layout.
What this does not cover: a replay anchored deeper than the tail
checkpoint still starts passes at the snapshot position rather than on the
cold chunk grid — the full fixed-grid hardening from the issue's suggestion 1
is follow-up scope if the residual is measurable.
Test plan
nvidia/Qwen3.8-Flash-Next-NVFP4+ issue repro (Ottawaanchor → Tokyo round-trip) — must answer, not re-call
cargo fmt --check+cargo clippy --workspacecleanVerification runs queued on reiner (jobs r158fix2/r158base3). Credit for the
root-cause dissection and the fix direction: the issue authors (Marconi team,
andrew-vogulkin/atlas) — their A1–A4 arm matrix isolated both mechanisms.
Generated with Devin