feat(cuda): NVFP4 cutlass MoE GEMM + CUDA backend (carve-out of #13) - #29
Merged
Conversation
TheTom
force-pushed
the
pr13/p1-nvfp4-cutlass-moe-cuda-backend
branch
from
June 16, 2026 23:38
028e5d8 to
0a73ea1
Compare
TheTom
force-pushed
the
ek/kernel-reorg-steel
branch
from
June 22, 2026 21:36
ffad7fc to
6a2035a
Compare
TheTom
force-pushed
the
pr13/p1-nvfp4-cutlass-moe-cuda-backend
branch
from
June 22, 2026 22:06
0a73ea1 to
c55c7a4
Compare
TheTom
force-pushed
the
pr13/p1-nvfp4-cutlass-moe-cuda-backend
branch
from
June 22, 2026 22:18
c55c7a4 to
657853a
Compare
Adds the NVFP4 / FP8 cutlass grouped-MoE GEMM surface for the GB10
(sm_121a) on top of dev's current CUDA backend, without touching the
backend's newer work (pool-cap allocator, NVRTC arch handling).
The NVFP4 entry points (moe_grouped_cutlass_fp4 + FUSEDACT/AMAX
prepare/run variants, w4a8/w8a8 grouped GEMM + act-quant/pack-weight,
gemm_cublaslt_fp4/fp8, memset_zero_raw) live in a dedicated
device/cuda/nvfp4_moe.rs as additive `impl CudaDevice` methods, so the
core device lifecycle in mod.rs is unchanged apart from one field
(lt_beta_zero) and the module declaration.
- cuda/cutlass_moe_fp4.cu: the AOT cutlass grouped kernel.
- build.rs: compile both cutlass_moe.cu + cutlass_moe_fp4.cu into the
static lib (gated behind CUTLASS_DIR / cfg(have_cutlass), no-op
without it, so Mac/Metal and CUTLASS-less CUDA boxes are unaffected).
- ffi.rs: the fp4/fp8 cuBLASLt scale-pointer/mode + e2m1/e4m3 data-type
constants.
- tests/cuda_cutlass_fp4.rs: GB10 correctness for the grouped GEMM.
Rust side builds clean under --all-features (cutlass calls are compiled
out without CUTLASS_DIR); the kernel itself builds + runs on the GB10.
TheTom
force-pushed
the
pr13/p1-nvfp4-cutlass-moe-cuda-backend
branch
from
June 22, 2026 22:49
657853a to
7ef1e6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First carve-out of the kitchen-sink #13, rebased onto the kernels/ reorg (#28).
Scope: the NVFP4 cutlass MoE GEMM kernel (
cutlass_moe_fp4.cu), itsbuild.rswiring, the CUDA device backend dispatch (device/cuda/{mod,ffi}.rs), and thecuda_cutlass_fp4test.The runtime crate is untouched by the reorg, so this applies cleanly on top of #28. CUDA build/test is validated on GB10 separately (no nvcc on the Mac CI path).
Follow-up to the kernel reorg; first of several #13 carve-outs.