Repository navigation
qwen38: a ubatch walk carries its HC streams and normed rows as BF16 values, each rounded to nearest even once - #920
Conversation
…s; the down, its inject rows and the mix read them
…s; the PLE site and the last combine read them into F32 streams
… hidden 4352, in both arms The norm's second walk over the streams (hidden above 4096) ran in no gate. A Q8_0 site at hidden 4352 now holds the capped arm's xn to the rule's bits, plain and after a combine, and the wide arm's plain xn. The norm's register-reuse PIN carries its commit's date.
There was a problem hiding this comment.
Verdict: MUST_FIX: two comments are wrong now (a stale PIN block and a misplaced doc line); no behavior defect survived.
Must fix
1. unsafe-ratchet.txt holds two PIN blocks for one change, and the first names code that does not exist
tools/unsafe-ratchet.txt:664 The first block gives the same move (gpu 2781 -> 2803, 361 -> 375) as the second block at line 670. It names NormedOut, which no file in the tree defines (Grep: only these two comment lines). The second block says Slots "replaces NormedOut, norm_wide", but norm_wide is new in this diff. A reader cannot tell which new code the count pays for.
Cost: the PIN is the evidence for a raised ratchet; a wrong one costs a re-audit each time the file is touched.
Fix: delete lines 664 to 669 and move their items (Bf16WordCols, MmaCols::landed_fits, hc_gated_norm_4w_bf16, mix_glue, hc_gated_mix_4_bf16) into the second block. In that block, drop which replaces NormedOut, so Slots is listed as new code.
2. check_hidden carries check_combine's doc line
crates/gpu-gates/src/bin/gate_hc_gated.rs:741 The line /// Clause 4 (module doc). was check_combine's. The new function was inserted between it and check_combine (line 804). Now check_hidden claims clause 4 (its clause is 10, module doc line 67) and check_combine has no clause line.
Fix: move the line above fn check_combine, and start check_hidden's doc with /// Clause 10 (module doc).
Non-blocking
⚠ Precision change without its e2e proof: the ubatch walk now rounds every stream value to BF16 at each combine, init and PLE site. AGENTS.md (line 115) asks for the gate-gpu-e2e count pin for "float sum order or precision". Gate (g) of gate_qwen4exp_e2e.rs:175 holds the walk's logits and stores to gemm_band, which models the q8 step only. The PR body shows neither run. Please add both outputs. If (g) goes red, the band needs a dated PIN with the 2^-8 term, as xn_band has.
⚠ Decode moved -1.0% in one round (31.41 to 31.09 tok/s), and the decode entries should be unchanged. Please show ptx-scan equal for the narrow entries (hc_gated_norm_4, hc_gated_combine_4), or a second round.
⚠ PIN date edited: hc_gated.rs:741 changes PIN(2026-10-27) to PIN(2026-10-26) on an unrelated lint allow. Restore the date, or say why it moved.
⚠ Spill grows with no timing: bf16_mma_norm_gate 572 to 644 B on sm_121/sm_121a. The pin says FP4-Local does not run it, so the timed A/B does not cover it. State the checkpoint and one prefill timing where it runs, or that no shipped path reaches it.
⚠ Clause 10 (hidden 4352) runs only F32 streams (gate_hc_gated.rs:748). The production case, BF16 streams at 4352 (hc_gated_norm_4w16, _bf16), has no line there; check_wide_bf16 uses WIDE only. Consider a wide_mix16 line at HID in hidden_lines.
Checked
- Duplicates: 24 new items checked. Hit: gate_hc_gated
bf16_bitsvsvision_taps::to_bf16(two lines, not worth a shared owner). The hc_gated.rs and ple.rs dryer pairs are#[kernel]entries that differ only in slice types; the device ABI forbids a generic entry. - Complexity:
enqueue_mixgained a branch decided in onematch; the others are test or match-arm growth. - Silent failure: 9 sites followed; BF16 overflow in the PLE conv raises
Ple,window_ofandcheck_mixrefuse by name. - Tests: planting
xunrounded in the norm'sres.storeturnswide[bf16_streams]red; the wrong half inSlots<u16>::storeturnscombine_alonered. - Gates:
xn_bandand the spill pins carry dated PINs. Escape catalog: no match.
Notes
- The timed base
89a728dis not the PR's basee7eae36. Confirm no commit between them touches these paths. - The
cargo fmtandcargo clippybox is unchecked and "What I ran" lists no result for either.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_dspark_hc.rs, crates/gpu-gates/src/bin/gate_hc_gated.rs, crates/gpu-gates/src/bin/gate_ple.rs … and carries a gate run on the author's card, which counts as verified.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
…or the BF16 streams; the range-loop pin keeps its date
|
Thanks for the review. The two must-fix items are fixed in 790a0bf, and the body now carries the fmt, clippy and ptx-scan results. 1. Two PIN blocks in 2. BF16 streams and the e2e count pin. I could not run gate (g) here. The real tier needs the reference set Decode -1.0%. PIN date on Spill of Clause 10 and BF16 streams at 4352. Clause 10 runs F32 streams at hidden 4352. The BF16 streams at 4352 are not in Base fmt and clippy. On the DGX Spark at (AI 코딩 에이전트가 작성한 코멘트이며, 내용은 제가 확인했습니다.) |
There was a problem hiding this comment.
Verdict: CLEAN: both earlier must-fix items are fixed, and the new commit adds no defect.
Since the last review:
- Must fix 1 (two PIN blocks in
unsafe-ratchet.txt): fixed. One block lists the new names; each exists inPR_TREE. Counts (gpu 2803 375) are unchanged. - Must fix 2 (misplaced doc line): fixed.
check_hiddensays clause 10,check_combinesays clause 4. - ⚠ PIN date: fixed. hc_gated.rs:741 is
PIN(2026-10-27)again. - ⚠ Decode -1.0%, ⚠ fmt and clippy: answered in the body (
ptx-scanequal for the decode entries;fmtandjust lintexit 0). - ⚠ e2e proof, spill timing, BF16 line at hidden 4352: still open, below.
Non-blocking
⚠ Precision change without its e2e proof: the walk rounds every stream value to BF16. AGENTS.md asks for the gate-gpu-e2e count pin for a precision change. The body shows neither that run nor gate (g) of gate_qwen4exp_e2e. Add both outputs. If (g) goes red, the band needs a dated PIN with the 2^-8 term.
⚠ Spill grows with no timing: bf16_mma_norm_gate 572 to 644 B. The pin says FP4-Local does not run it, so the timed A/B does not cover it. Name one checkpoint and a prefill timing where it runs, or say no shipped path reaches it.
⚠ Clause 10 runs only F32 streams at hidden 4352. The production case, BF16 streams at 4352 (hc_gated_norm_4w16, _bf16), has no line there. Consider a wide_mix16 line at HID in hidden_lines.
Checked
- Duplicates: the new commit adds no function, type or constant. The earlier items and the dryer pairs stand.
- Complexity: the new commit changes no function body.
- Silent failure: no new site; comments and a PIN only.
- Tests: none changed. Gates: no pin moved. Escape catalog: no match.
Notes
- The timed base
89a728dis not the PR's basee7eae36. Confirm no commit between them touches these paths.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_dspark_hc.rs, crates/gpu-gates/src/bin/gate_hc_gated.rs, crates/gpu-gates/src/bin/gate_ple.rs … and carries a gate run on the author's card, which counts as verified.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
DGX Spark에서 Qwen3.8 FP4-Local의 prompt 처리를 빠르게 하는 PR입니다. prompt 처리 중 HC 구간이 읽고 쓰는 residual stream과 정규화 결과를 BF16 값으로 두어 메모리 이동량을 줄입니다.
Part of #565.
What and why
Prompt processing of Qwen3.8 FP4-Local spends much of its time in the hyper-connection (HC) steps of each layer, which are limited by memory traffic over F32 values. This PR halves that traffic.
xn) as BF16 values, rounded to nearest even when the norm writes them; the down MMA, the fused up/mix and the glue mix read them directly.gate_hc_gatedgains a clause for the HC norm at hidden 4352, past one chunk a thread.Release notes: Changed: Qwen3.8 FP4-Local prompt processing is 8.1% faster on a DGX Spark at a 4096-token prompt, with TTFT p95 7.4% lower.
Code shape
rounding::bf16_round; the final-buffer rule written twice in the Qwen3.8 body isfinal_res.hc_gated_combine_4w, the old normed-output type,WideParts::curandUnitRows38::curare removed.xnband adds BF16's unit roundoff withPIN(2026-10-28); the moved spill pins and the unsafe ratchet carry PIN lines.cargo fmtandcargo clippy: their results are under "What I ran".Duplication found or removed (
path:line), or "none":crates/gpu-gates/src/rounding.rs:19replaces the copies ingate_dspark_hc.rs,gate_hc_gated.rsandgate_ple.rs;crates/gpu/src/arch/qwen3moe/scratch38.rs:268replaces body38's two copies.What I ran
Timed runs use one DGX Spark and
nvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6887e18c089fdea8509a33e63429a3300, against upstream89a728d26d90a8f2a693ce011f84c395b0cea69c, with the MTP draft off. One request runs at a time: a 4096-token prompt and 128 generated tokens at temperature 0, on eight windows of a code corpus. Each side has one round after one discarded round, base then head. Prefill and decode are the server's timings and TTFT is the client's.Each cell is one round over the eight windows.
Prefill is 8.1% higher and TTFT p95 is 7.4% lower; decode moves -1.0%.
cargo check --target x86_64-unknown-linux-gnu --workspace --all-targetswith every gate feature:Finishedwith no warning line.just gate-gpu-hc-gatedrun as its two steps (cargo oxide build --arch sm_121a ... --bin gate_hc_gatedandbash tools/gpu-gate.sh gate_hc_gated):PASSED: gate_hc_gated.just gate-gpu-plerun the same way:gate_ple: 24 clauses, 0 failed.just gate-gpu-hc-gatedbuilt with--arch sm_120a:PASSED: gate_hc_gated.let one = true;in the norm) turns its threehidden[...]lines tobit_equal=false FAILon the DGX Spark, withFAIL-FIRST mutant rc=1; the clean tree passes all three.fault conv BF16 outputline toFAILon the DGX Spark, withgate_ple: 24 clauses, 1 failedandFAIL-FIRST mutant rc=1; the clean tree passes it.just gate-ptx-spillatsm_121a:PTX-SPILL arch=sm_121a rc=0.790a0bfcbb6c11b852c69eb27a3432151b001489,cargo fmt --all --check: exit 0, no diff.790a0bfcbb6c11b852c69eb27a3432151b001489,just lint(sm_121a):Finishedwith no warning line, exit 0.790a0bfcbb6c11b852c69eb27a3432151b001489,just gate-gpu-hc-gated:PASSED: gate_hc_gated.just ptx-scan gate_hc_gated --features gpu --no-jit hc_gated_at base and head: the decode entrieshc_gated_norm_4(md5e2e0d61cce91577e832c0d84b9edbde6) andhc_gated_combine_4(md5df6155a75f474f43f76a2c6d3f2ca143) are identical, with the same registers, shared memory, spill and loads.Hardware
Timed runs and the DGX Spark gates ran on:
nvidia-smireportsDriver Version: 595.84andCUDA Version: 13.3)nvidia-smireportsNVIDIA GB10, 595.84), CUDA 13.3.1 in the build containerGate runs also used an RTX 5090:
nvidia-smireportsNVIDIA GeForce RTX 5090, 595.99.02); the CUDA version was not recorded for these runsAI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.