Repository navigation
gpu: group native FP4 launcher arguments - #815
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: Argument grouping preserves all four call sites and both launcher bodies; no must-fix defect was found.
Non-blocking
⚠ Attach the move-class proof: crates/gpu/src/gemm/nvfp4mma.rs:1326. The PR provides source comparisons, but its reported NVFP4 gate bypasses these launchers. Attach identical base/head ptx-scan output with native FP4 enabled and unchanged host structural checks (graph node count, eager/replay equality and e2e set), as required by AGENTS.md's move/split/rename class. --no-jit suffices for the scan.
Checked
- Duplicates: 2 argument types added, each used by its corresponding launcher; dryer reported 0 candidate pairs.
- Complexity: crapper reported no changed function crossing its thresholds. Both executable launcher bodies match the base exactly after destructuring.
- Silent failure: all 4 call sites preserve error propagation and fault forwarding; no fallback site added.
- Tests and gates: no tests, pins, tolerances, cases or lint levels changed. Static comparison confirmed identical device source.
- Performance: launch, copy, synchronization and allocation counts are unchanged. No numeric order changes.
- Escape catalog: none of C1–C4 matches. No ledger lessons are in force.
Notes
The PR reports that its RTX 5090 gate predates the final formatting-only edit. No build or GPU gate was run during this static review.
Card check: gpu-evidence. This pull request changes crates/gpu/src/gemm/act32.rs, crates/gpu/src/gemm/gemm32.rs, crates/gpu/src/gemm/nvfp4mma.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. |
네이티브 FP4 호스트 launcher 두 개의 인수를 구조체로 묶어 clippy의 인수 개수 경고를 없앱니다. device 코드와 동작은 바꾸지 않습니다.
What and why
Kernels::swigluandKernels::productincrates/gpu/src/gemm/nvfp4mma.rstook nine and ten arguments (countingself). This groups each argument list into a struct,SwigluArgsandProductArgs, placed next to the existingGateUpArgs. The functions now take four and three arguments, so thetoo_many_argumentslint no longer fires on either. The structs arepub(super)and carry the same borrowed buffers and scalar values the functions took before.streamandfaultkeep their place outside the struct, as ingate_up.All four call sites are updated: three in
crates/gpu/src/gemm/act32.rs(default SwiGLU, the activation rule, and the selected-slot call) and one incrates/gpu/src/gemm/gemm32.rs(the native product call). Each function destructures the struct on entry and the body below it is unchanged. Device code, kernel arguments, operation order, branches, grid sizes and error handling are untouched, and no launch, copy, sync or allocation is added.Release notes: internal: native FP4 host launchers take an argument struct, which clears two
too_many_argumentslint warnings.Code shape
SwigluArgsandProductArgsfollow the existingGateUpArgsin the same file; no shared logic is copied. No other type for the same purpose exists incrates/gpu/src.Resultand?is kept as before.cargo fmt --all -- --checkandcargo clippypass on the touched crate for both targets below. Warning counts stay within the main ratchet: 3 against 3 for the default target, 3 against 7 forsm_121a. The remaining warnings are the existing type-complexity warnings ingate_kquant; neither launcher warns.Duplication found or removed (
path:line): none. The duplicate scan reported no candidates.What I ran
The PR head is
753082611998edfebf1e4a7fea4c275b7c67a863, one commit on main6de9e77d5139146c0a66c4cf02cc1850bec43b7c.Same-head checks:
git diff --check upstream/main...HEADpasses.nvfp4mma.rs, which hold the device code, are identical to main. After the argument struct is destructured, each function body matches main's.cargo fmt --all -- --checkpasses, followed by the repository's all-target clippy for the default target and forsm_121a. Both finish without errors, and the lint check against the main ratchet passes (numbers above).On an RTX 5090 machine I ran the two commands below on the commit before a formatting-only change to the
productdeclaration (a line break and an optional trailing comma). The source otherwise has the same Rust tokens at the final head.The gate uses synthetic tensors, so no model is downloaded. It covers the NVFP4 selected-expert kernels. The native
Gemm32Kernelslaunchers this PR edits sit outside it, so it says nothing about their runtime bit equality. Thesm_121aclippy type check and the device-code and body comparison above cover them. I did not run a timed A/B, since the change adds no launch, copy, sync or allocation and does not claim a speed change. No new test was added.Hardware
just checkandjust gate-gpu-nvfp4.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.