Repository navigation
qwen3_5 cuda: a prompt chunk nothing reads stops its last layer at its keys - #3060
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.
e7c385e to
ce33fd6
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.
|
@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 |
|
@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:
|
7ab24fd to
ce362c2
Compare
|
Rebased onto current main
|
|
@javierbits @ashhart Independent check at The first detail I'd clarify is the failure mode of the second planted control. In disposable copies, moving the unread return before RoPE failed the launch trace at 4 launches versus 5 expected. Removing the return instead reached the sparse fixture's index-out-of-bounds panic before the extra-launch assertion. If the receipt needs to demonstrate which extra launches occur, the fake engine needs the downstream state to reach that assertion. The clean head passed both platforms. My test merge against Igor Lessio - AIFLOW LABS |
ce362c2 to
b3a852a
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.
- states.py reads the disk tier's state file and the K/V blocks it names, and hashes their payloads. - The receipt compares current main against the review head at both marks: equal recurrence, convolution and K/V bytes. - Added the Unreleased bullet naming ashhart#3060 that the pre-flight expects.
|
The checks on Thanks @AIFlowML for the independent macOS arm64 and Linux x86 runs. I reproduced the planted-control detail: with the unread return removed, the sparse launch-trace fixture panics in |
|
|
…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.
@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.
- states.py reads the disk tier's state file and the K/V blocks it names, and hashes their payloads. - The receipt compares current main against the review head at both marks: equal recurrence, convolution and K/V bytes. - Added the Unreleased bullet naming ashhart#3060 that the pre-flight expects.
- The in-file yielded-prefix test's fake engine now declares layers, taps, learning, mlp, pockets and int8. - test-host-a, zig-b and zig-windows failed to compile the prompt-tail read on the fixture; test-qwen35-prefill-host passes 25/25.
- The 32K fixture uses grid_rows after main split it from max_rows; max_rows now allows an 8K solo pass and overflowed the 64K capacity.
b3a852a to
c3d2418
Compare
…evice 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 #3060.
- states.py reads the disk tier's state file and the K/V blocks it names, and hashes their payloads. - The receipt compares current main against the review head at both marks: equal recurrence, convolution and K/V bytes. - Added the Unreleased bullet naming #3060 that the pre-flight expects.
|
Thank you @javierbits. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
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
b3a852ad6.python3 tools/pr_check.py --base upstream/main --pr 3060: 0 errors, 0 warnings against current main1ece6e6db.1ece6e6db: the prefill cut keeps main's soloTF_QWEN35_CHUNK_SOLOpath and this PR'sunreadkeep, and the unread fixture cuts ongrid_rowsafter main split it frommax_rows. The ledger link-table conflict is a take-both.zig build test-qwen35-prefill-host --summary all: 26 passed, 0 failed, 0 skipped (includes the new launch trace and the prefill fixture fix).zig build test-cuda-host --summary all: the only local failure iscli_config_testrefusing its 0664 temp file under this shell's umask 0002; that binary passes 1667 passed, 15 skipped, 0 failed with umask 022.zig fmt --check build.zig zigandgit diff --check: clean.cuda_prompt_tail.firstbefore the extra-launch assertion, as @AIFlowML noted.b3a852ad6passed every job (zig, zig-b, zig-windows, pytest, fmt, benchmark-clients, release-paths; run).zig build test test-golden(macOS-only checks unavailable here); no GPU kernel changed, so no kernel-contract run.Receipt
34cecd17e; the branch rebased ona1781885e, head164c6782d; 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: device exactness rows base6720d18b…/ headfe92ed6a…; kept-state rows base570ce5ff…/ headec9243bf….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. At the 8,192- and 16,384-token marks, the kept recurrence, convolution and K/V payloads are byte-equal onf794b26a8against5d1f494cfe(the code head; the final docs commit changes no Zig), with the same digests as the earlier pair (runs/{base,head}-marks.json,states.py); the same run reproduced the chat reply hashes. 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