Repository navigation
qwen3_5 cuda: a prompt chunk nothing reads stops its last layer at its keys - #3060
javierbits wants to merge 3 commits into
Conversation
5fd142a to
b2efa80
Compare
|
Thanks @javierbits. The change does what #2941 planned, and the code reads correctly to me. What I checked on
Before we run it, please:
A small optional one: prompt shapes never reach the graph cache ( Overlaps: this conflicts with #2838 in The default path keeps its tokens on everything I can read: the final chunk is unchanged and every skipped row is one nothing reads. Files stay under 600 lines. CI is green on this head.
|
|
@javierbits @ashhart I can run point 6, the cold A/B, on a quiet GB10 if that suits you, javierbits.
I'd post TTFT median with [min-max] per arm and the token hashes. Your other points (description, test, seeded rows, KV bytes, prompts) stay yours. |
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
|
@ashhart thanks for the detailed read. All code and receipt points are addressed on head
Optional bit: dropped |
654f6a9 to
4a7a7f1
Compare
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
|
Rebased onto current main The receipt was rerun on the rebased binaries: cold 2K/8K/32K, sampled, drafted, and the 8K/16K cache marks all still equal base. @jschmied please use Checks on this head: |
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
4a7a7f1 to
1b7821f
Compare
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
1b7821f to
73f35a6
Compare
|
Final head after the latest main rebase: |
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
73f35a6 to
07bfaa9
Compare
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
63f4a25 to
e7c385e
Compare
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
…s keys A non-final prompt chunk's last layer feeds only a head nobody reads. Keep gains `none`; on such a chunk the last layer runs its norm, K/V projection, head norms and RoPE, then stops. The final chunk is unchanged. `cuda_prompt_tail.unread` refuses this when a tap on the last layer, a learning/MLP/pocket reader, prompt int8 or an image chunk reads its rows. The 32K host fill passes `none` on chunks 1-7 and `last` on chunk 8. GB10, Qwen3.6-35B-A3B-NVFP4: cold 2K/8K/32K replies are byte-equal to main and a resumed chat turn equals its fresh run. The host suite and `test-qwen35-prefill-host` pass; the new test fails with `none` disabled.
…#2941 device checks The host launch trace records norm, K/V, head-norm, RoPE and attention tags instead of issuing kernels. A test drives body over a fake engine and asserts an unread last layer launches norm, K/V, both head norms and RoPE, then stops; moving the return above RoPE or disabling it fails it. Receipt: seeded and default-drafted replies equal to main, resumed chats at the 8K and 16K prompt-cache marks, and a clean base cold re-run. Prompts name Python 3.12.3 and the temporary unread log line. Drop the unused Shape key bit. pr_check --pr 3060; changelog bullet names ashhart#3060.
e7c385e to
ce33fd6
Compare
|
@javierbits @ashhart Here is the quiet-GB10 cold A/B (point 6). The head saves about 30 ms at 32K, 0 of 6 adjacent pairs slower, and the tokens are equal everywhere.
Setup:
The raw rows (per-arm JSON, gate and server logs, runner) are on our side and I can attach them. With a measured gain, the ledger rows at |
@jschmied's base-new-new-base run measures -28.4 ms median per round and -34.5 ms median adjacent at 32K (-0.5..-0.6 %), 3-4 ms at 8K, and level at 2K, with tokens equal. The ledger rows and receipt carry the numbers.
|
@ashhart @javierbits Here is the 27B arm you asked for in #2941. Dense 27B gives no clear signal. Its noise between servers is about 0.8 % at 32K, larger than the 0.5 % gain the 35B showed, and the tokens are equal everywhere.
Setup, the same as the 35B run:
|
|
Thanks @javierbits, and thanks @jschmied for the quiet-GB10 comparison. The launch trace, sampled/default-drafter rows, prompt-version note, removed key bit and measured ledger entries address those points. Two items remain:
|
What this changes
A non-final Qwen 3.5/3.6/3.8 CUDA prompt chunk whose rows nothing reads no longer runs its last layer's query projection, attention, gate, output projection, MLP and head.
Keepgainsnone,Shapegainsunread, andcuda_prefill.zigpassesnonewhen no last-layer tap, learning/MLP/pocket reader, prompt int8 path or image chunk reads the chunk. The final chunk is unchanged.Review follow-up on
b2efa807e; rebased onto current main after #2838 landed, and the device receipt was rerun on the rebased binaries:Added a host launch trace. A test now drives
cuda_forward.bodyover a fake engine and asserts an unread last layer launches norm, K/V, two head norms and RoPE, then stops. It goes red when the return moves above RoPE (missing rope) or is disabled (extra attention, o, norms and head).Filled the device plan: seeded sampled replies, the default drafter path, and resumed chats at the 8K and 16K prompt-cache marks. All are byte-equal between main and this branch.
Dropped the unused
Shape.keybit and its test; prompt shapes never reach the graph cache.Receipt now names Python 3.12.3 as the prompt source and says the
unread=truelog line came from a temporarystd.log.info, not the diff.pr_check.pynow runs with--pr 3060; the changelog bullet names qwen3_5 cuda: a prompt chunk nothing reads stops its last layer at its keys #3060.Point 6 is in: @jschmied ran the quiet-GB10 base-new-new-base A/B. At 32K the median per-round delta is -28.4 ms and the median adjacent pair is -34.5 ms (-0.5..-0.6 %), 0 of 6 adjacent pairs slower; 8K gains about 3-4 ms and 2K is level, with equal tokens. The ledger rows now carry those numbers.
Issue: Fixes Qwen 3.5 CUDA: a prompt chunk nothing reads stops its last layer at the keys #2941.
Stacked on: main.
atc overlap --json: no open-PR overlaps. Three local, unpushed worktrees (port/1806-gdn-silu-gate,decode-share,nvfp4-refusal) report conflicts inCHANGELOG.md,cuda_prefill.zigandcuda_engine.zig; all predate current main. ATC writes returnincompletebecause the repository's 321 open PRs exceed ATC 0.9.6's 300-PR page cap, so this PR withFixes #2941is the claim.Checks on this head
e34a57994.python3 tools/pr_check.py --base origin/main --pr 3060: 0 errors, 0 warnings.zig build test-qwen35-prefill-host --summary all: 19 passed, 0 failed, 0 skipped (includes the new launch trace).zig build test-cuda-host --summary all: 391/391 steps, 1082 passed, 3 skipped, 0 failed.zig fmt --check build.zig zigandgit diff --check: clean.zig build test test-golden(macOS-only checks unavailable here); no GPU kernel changed, so no kernel-contract run.Receipt
ab78aef90(device runs on0591c4e85, head4a7a7f127), heade34a57994; Zig 0.17.0; CUDA 13.0 (V13.0.88); NVIDIA GB10 sm_121; checkpointnvidia/Qwen3.6-35B-A3B-NVFP4revision491c2f1ea524c639598bf8fa787a93fed5a6fbce;--parallel 1 --context 40960. Binary md5 of the measured pair: base6720d18b…, headfe92ed6a….token_sha256/output_sha256equal at 2,048, 8,192 and 32,768 tokens; seeded T 1.0 seed 1234 and default-drafted rows equal at 8,192 and 32,768; resumed 8K and 16K chat replies equal (e1de42ac…/19079cfe…) to each other and to a cache-off run. Raw runs are indocs/receipts/qwen-unread-chunks-2941/.a3aecd8d0against heade7c385e96(samezig/diff as this head): 32K base 5.8006 s to head 5.7695 s, median per-round -28.4 ms and adjacent -34.5 ms (-0.5..-0.6 %), 0 of 6 adjacent pairs slower; 8K -3..-4 ms; 2K level; tokens equal. Reported by @jschmied.Checklist