Repository navigation
placement, gpu: a routed MXFP4 down off the 256-value super-block reads the 32-value form, MXFP8 planes take ceil(K/128) scale words, and V4.1's FFN holds only the forms its downs read - #1154
Conversation
…ds the 32-value form, MXFP8 planes take ceil(K/128) scale words, and V4.1's FFN holds only the forms its downs read A tensor-parallel rank's part of V4.1's 2,304-wide experts is 1,152 or 576 values, no whole number of the q8_1 super-block. - placement: `kernels::down_act(ty, k)` picks a down's activation form by its K (its entry's at whole 256-value super-blocks, else the 32-value `Q8Blocks32`); `card_k_unit` gives 32 to the downs that read that form, MXFP4 among them, and lets MXFP8 planes take their 32-value block. Every card leg's buffers and launch take the form from there (`LegStacks::down_act`). - gpu: `mxfp4_gemv_sel32`, the MXFP4 down `_sel` over a `Q8Blocks32` (`lane_partial_file` at one scale a block), as the leg's arm for that form. - gpu: MXFP8 planes hold `ceil(K/128)` scale words a row, the last padded with zero; the splitter, the upload, the joined rows, the size budget and the gemv read that one contract, and the wide tiles refuse a K off 128 by name. A K of whole 128-value records keeps its bytes. - gpu-deepseek41: `FfnRow` allocates the q8_1 columns only where a layer reads them; the `ff % 256` refusal becomes each down's own K unit. `Dense` runs an MXFP8 projection on the common E4M3 gemv, and an engram table of MXFP8 rows decodes on the card (`ds41_glue_engram_rows_mxfp8`).
There was a problem hiding this comment.
Verdict: CLEAN: no reachable behavior defect or actionable quality defect survived review.
Non-blocking
⚠ Supply the dispatch-path timing proof: crates/gpu/src/q8f32.rs:2350.
The shared MXFP8 kernel adds a row division, group guard and input offset; ordinary one-column GEMV still calls it at crates/gpu/src/q8f32.rs:3496. AGENTS.md's Measuring section requires a same-lease A/B for dispatch changes. The body reports functional gates and spill checks, but no A/B. Attach decode and prefill results on the contributor's card, with both commits, model, commands and output.
Checked
- Duplicates: 39 new functions, types and constants checked by search, including test constants; no actionable duplicate. The Engram kernels share indexing shape but decode different formats. No dryer pairs were available.
- Complexity: crapper supplied no results. FFN host branches select required scratch; kernel growth changes scale strides and group indexing. No kernel split is needed.
- Silent failure: four new defaults/error conversions followed to consumers; malformed layouts are refused. Invalid MXFP8 bytes and expert IDs raise named device faults.
- Tests: static mutation checks cover old scale strides, type-only down forms, unconditional scratch, dropped byte checks, a dropped group offset and equal division of resident bytes. Assertions detect these mutations. GPU tests were not rerun here.
- Gates: changed shape refusals and ratchets carry dated PIN reasons. No numeric tolerance was relaxed.
- Escape catalog: no C1–C4 pattern matched. Boundary scenarios checked MXFP8 scale tails, MXFP4 partial windows, invalid IDs and a rank pool one byte short.
Notes
Dryer and crapper did not run because their Python modules were missing.
The reported RTX 5090 gate evidence names head 8dddfab7, while this review covers 031d1a74; refresh the evidence for the reviewed head.
Card check: gpu-evidence. This pull request changes crates/gpu-deepseek41/src/body/prefill.rs, crates/gpu-deepseek41/src/chain/attn.rs, crates/gpu-deepseek41/src/chain/ffn.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)
…al 8 on sm_86 after #1154 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CjHkkoJGJqgEEVx9yv9K5d
|
@juliankang4 Merged, thank you. On sm_86 the one red was (Written by an AI coding agent.) |
MXFP4 down 행렬의 K가 256으로 나누어떨어지지 않아도, MXFP8 가중치의 K가 128로 나누어떨어지지 않아도 카드에서 거부되지 않고 돌아가도록 고쳤습니다.
What and why
A routed MXFP4 down projection whose K is not a multiple of 256, and an MXFP8 weight whose K is not a multiple of 128, were refused on the card. This PR lets both run. The down projection reads the 32-value activation form when K is off the 256-value super-block (
kernels::down_act), the MXFP8 planes holdceil(K/128)scale words per row, and V4.1's FFN allocates only the activation buffers its layers read, so a rank whose FFN width is 576 or 1,152 loads. The grouped MXFP8wo_aand the Engram MXFP8 table rows get arms over the existing kernels.Release notes: Fixed: routed MXFP4 downs and MXFP8 weights with a K off 256 and 128 now run on the card instead of being refused, and V4.1's FFN buffers follow the forms each layer reads.
Code shape
The review reads these first. A box left unticked needs one line of why.
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):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":crates/gpu-deepseek41/src/chain/glue.rs:611resembles:534and:572. The MXFP8 table-row kernel has its own entry like the Q8_0 and IQ4_NL ones; they share a ten-line thread-to-value map, and each body calls its own decode with its own block bytes. Folding them would put a runtime format switch into the two existing kernels. The first version of the 32-value MXFP4 down kernel was a copy ofmxfp4_gemv_sel; it is now that one kernel with a scale shift.What I ran
Base
c7f21a7d28087a95abfc7d7cb1c69dea37781090, PR head8dddfab7f2ca0218498c1b84ec60445b05345288. Card: RTX 5090 (see Hardware). Model: the V4.1 fixture GGUFv41-fixture-00001-of-00004.gguf.Lint, on a DGX Spark, the PR head:
Each fix has a test that detects its absence. For the PR head, the BF16 to MXFP8 conversion's scale row stride was set to
row * (k / 128)(the old rule), then restored (git checkout,git diff --exit-code):hw_card_k_units_are_the_layouts_ownruns the MXFP4 down at K 576 over the 32-value form and compares bit for bit with the host rule; the id past the stack faults.V4.1 and MXFP8 gates. The mutants were the MXFP8 row decode without its undefined-byte check, and
mxfp8_gemv's block diagonal reading window 0 for every group; both were restored afterwards:The prompt batch and the expert tier follow the same rule (each makes only the buffers its layers read). A mutant that made the batch's shared q8_1 scratch for every file is caught by its test; with the mutant restored the V4.1 lib runs:
Real binary,
bloomery-serveon the V4.1 fixture on the one card ($FIXTURE_MODELis the fixture GGUF above, fromtools/ref/ref-paths.sh), then one completion of 16 tokens:The fixture has random weights, so the text is noise; the run shows that the load, the prompt batch and 16 decode steps complete.
Hardware (if the change is for a machine)
RTX 5090 for the gates and the
bloomery-serverun above; a DGX Spark for the clippy run.nvidia-smion the RTX 5090, PR head run:AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.