Repository navigation
cuda: NVFP4 experts' prompt rows take the warp's row tile count as a constant - #805
Conversation
|
Updated the description: on 1.0.9, |
|
Thank you, @Bizuayeu. Nemotron's NVFP4 expert prompt rows take the warp's row tile count as a compile-time constant, so one mma body runs each count. The store mask is still On a GB10, teacher-forced rows are bit-equal to the base, 16,109 of 16,109. Served replies are equal, 17 of 17. Drafted replies equal Your commit is in 1.0.10 under your name ( |
The contributor's commit landed above with the same code, and our commit after it wraps prompt_body's parameter lines; this keeps the PR's head in the history with no change to the tree.
What this changes
The staged NVFP4 expert prompt kernel reads its row-tile count at run time inside the mma chain; this makes it a
template constant with one instantiation per count, so the branch leaves the chain. The sums keep their order and
every output row keeps its bytes. #764 (skip on the same prompt entries) touches the same three call sites; whichever
lands second takes the other's lines with a small rebase.
Receipt
c36b536d) with this commit for the tests, on one NVIDIA GB10 (sm_121, CUDA 13.3). Theexactness and timings are the same commit on 1.0.8 (
0efbd447): the kernels on that GB10, the prefill throughthe GLM-5.3-Flash CUDA family (glm: GLM-5.3-Flash (NVIDIA's NVFP4 checkpoint) as a CUDA family at TP over hosts #804,
nvidia/GLM-5.3-Flash-NVFP4at423acf37) at TP=2 on two (driver580.173.02, CUDA 13.0, Linux 6.17.0-1032-nvidia).
random inputs at GLM-5.3-Flash's per-rank widths (1,024 x 4,096, 17 experts, 9 slots);
tf-cuda-test quant-ref4 passed. Through the family at TP=2 the 8k and 32k prompt checks gave the same ids with and without it. On
1.0.9,
tf-cuda-test nvfp4-expertsagainst the Python engine's recorded bytes (packing, plan, up and down, at itsdefault shape and a GLM-like one) passes with and without it.
tools/prefill_cold.py(1.0.0 removed it; the family is not upstream yet). Kernels at2,048 rows (ncu, median of 10): swiglu 5,565 → 3,912 us (29.7% shorter), down 2,500 → 2,116 (15.4%), relu²
4,673 → 3,810 (18.5%). The family's prefill at TP=2 (median of 2): about 2k tokens 1.540 → 1.480 s, 8,192
tokens 5.610 → 5.290 s (5.7% shorter), 32,768 tokens 21.855 → 20.705 s (5.3% shorter).
zig build test-cuda-host429/429,zig build test644/649(5 skipped),
tf-cuda-test quant-ref4 passed, zig fmt.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.output keeps its bytes, which
quant-ref,nvfp4-expertsand the comparison above check.)