Repository navigation
gpu: the HC up-mix's passes split the warp's columns, so a mix step reads a whole sector of each stream and its gate stores fall in 32 banks - #988
Conversation
… no block barrier runs in its main loop
… NVMe reader copied
…ver written after it
…s once the walk finishes that layer, under the walk's later layers
…eads a whole sector of each stream and its gate stores fall in 32 banks
There was a problem hiding this comment.
Verdict: CLEAN: No behavior bug or proven quality defect survived validation.
Non-blocking
⚠ Checkpoint ordering coverage: crates/gpu/src/arch/qwen3moe/body38.rs:3161. Removing this wait leaves the new owner-mapping test green. The existing restore clause uses Prompt38::Pass (gate_qwen4exp_e2e.rs:4456). Extend it to restore a GEMM checkpoint and compare stores with an uninterrupted run. Show FAIL-first with the wait removed.
⚠ Shared tile proof: crates/gpu/src/gemm/f32tile.rs:1262. The extraction also reaches bf16_mma_cols_gemm through bf16_mma_body (kernels32.rs:1344). Attach an identical PTX comparison for the BF16 consumers and resource counts for the TMA geometry, as the change-class table requires. The reported W8A8 timing does not supply those proofs.
Optimization headroom
- B, Overlap waiting: crates/gpu/src/arch/qwen3moe/body38.rs:3153. Enqueue copies by writer layer while preserving store indices. The current order puts PLE and key rings after every delta store. In the pinned 48-layer layout, this could advance the PLE ring and 11 key-ring copies per 4,096-position mark [derived].
Checked
Duplicates: the extracted MMA scale and store logic has callers in both stage paths.
Complexity: the new TMA pipeline and checkpoint lifecycle add synchronization work; complexity alone is not a finding.
Silent failure: checkpoint owner/event lookup errors propagate; failed-unit cleanup preserves the original error.
Tests, paper mutation: mapping keys to the PLE site at body38.rs:373 fails the owner assertion; removing the wait at line 3161 leaves that assertion green.
Gates: scratch, placement and unsafe pins carry dated reasons. FAIL-first runs are not reported.
Escapes: no catalog pattern matched the cited changes.
Notes
Static validation; no GPU tests run. Reported GPU runs name 686e8cc→c65f4b7; the reviewed pair is 7f04223→4e22b7c. Supply the correspondence or a witness for the reviewed head.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_gemm.rs, crates/gpu-gates/src/bin/gate_ple.rs, crates/gpu/src/arch/qwen3moe/body38.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. |
Qwen3.8 FP4-Local의 긴 프롬프트 prefill을 DGX Spark에서 빠르게 하는 속도 PR입니다.
What and why
Prompt prefill on Qwen3.8 FP4-Local spends time in the dense MXFP8 gemm, the HC up-mix, the PLE row decode on the host and the end-of-prompt checkpoint copies. This PR shortens each of them.
gemm/f32tile.rs,gemm/nvfp4mma.rs: the MXFP8 W8A8 tile's stages arrive by TMA on stage barriers, so no block barrier runs in its main loop. A producer proxy fence orders each stage refill after the consumers' reads.norm_gatestays oncp.async.ple.rs,body38.rs,quant.rs: a ubatch's NVFP4 PLE rows decode on the card from the planes the NVMe reader copied, instead of on the host.hc_gated.rs: the HC norm's block sum has no terminal barrier, since its slots are never written after it. The up-mix loops split the warp's columns, so a mix step reads whole sectors of each stream and its gate stores use separate banks.body38.rs,scratch38.rs: a prompt ubatch's end checkpoint copies each delta layer's stores as soon as the walk finishes that layer, under the walk's later layers.tools/unsafe-ratchet.txt: two dated PINs for the new unsafe blocks and functions (gpu2812 to 2834 blocks, 381 to 386 fns), each with its reason.Release notes: Changed: Qwen3.8 FP4-Local prefill and time to first token are faster on a DGX Spark, with the same greedy output.
Code shape
gemm/f32tile.rs; the PLE decode kernel lives inple.rsbeside the host decode it replaces for ubatch rows.PIN(2026-10-29):and its reason.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Speed
Model
nvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6887e18c089fdea8509a33e63429a3300, with the Q8_0 MTP draft for the draft-on arms. Each request is a 4096-id prompt and 128 greedy tokens (temperature 0) from eight corpus windows 50,000 ids apart, after one lead-in. Base is upstream main686e8cc5ffb0cb20027fe315bd0dfb2863b17c0band head isc65f4b702604adab8d7ad4ac7b238ba38a16f487, each built from its own tree and run alternately in the order base, head, head, base, base, head. Each cell is the median of three rounds. Greedy output is identical on every request.Build the head the same way, serve
$MODEL_FP4Lfrom each build, and send the requests above, alternating the two trees. For the draft-on arms setBLOOMERY_DRAFT=mtpandBLOOMERY_MTP_DRAFTto the MTP draft file.Ranges are "separate" when the three head rounds and the three base rounds do not overlap.
Prefill and TTFT p95 are resolved in every arm (resolution 0.500% to 1.119%). Decode is not changed by this PR; its rows are inside the 1.002%, 0.617% and 1.842% the run can resolve.
Gates and tests
cargo oxide build --arch "$(just --evaluate arch)" -- --locked -p bloomery-gpu-gates --features gpu --release --bin gate_gemm --bin gate_hc_gated --bin gate_mxfp8 --bin gate_ple BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_hc_gated BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_gemm --case mxfp8_w8a8 BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_gemm --case dense_mma BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_gemm --case zgate BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_mxfp8 BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local BLOOMERY_GATE_CARD=any bash tools/gpu-gate.sh gate_pleThe new unit test for the up-mix's scratch slots ran on an RTX 5090 machine:
BLOOMERY_BOX_LOCAL=1 BLOOMERY_BOX_CARD=local ./tools/box.sh 'bash tools/gate.sh --gpu --oxide -p bloomery-gpu --release --lib -- hc_mix_slots --nocapture'The head also builds for the GB10 target with
cargo oxide build --arch sm_121a -- --locked -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpoint --release --bin bloomery-serveand the same command with--features gpu --bin gate_hc_gated --bin gate_ple --bin gate_gemm --bin gate_mxfp8: both finish with COMPILE OK.Hardware (if the change is for a machine)
The change targets the GB10 (sm_121a). The timed runs and the gates ran on a DGX Spark.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.