Skip to content

feat(cuda): NVFP4 cutlass MoE GEMM + CUDA backend (carve-out of #13) - #29

Merged
TheTom merged 1 commit into
devfrom
pr13/p1-nvfp4-cutlass-moe-cuda-backend
Jun 22, 2026
Merged

feat(cuda): NVFP4 cutlass MoE GEMM + CUDA backend (carve-out of #13)#29
TheTom merged 1 commit into
devfrom
pr13/p1-nvfp4-cutlass-moe-cuda-backend

Conversation

@TheTom

@TheTom TheTom commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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), its build.rs wiring, the CUDA device backend dispatch (device/cuda/{mod,ffi}.rs), and the cuda_cutlass_fp4 test.

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.

@github-actions github-actions Bot added the feature New feature label Jun 16, 2026
@TheTom
TheTom force-pushed the pr13/p1-nvfp4-cutlass-moe-cuda-backend branch from 028e5d8 to 0a73ea1 Compare June 16, 2026 23:38
@TheTom TheTom changed the title feat(cuda): NVFP4 cutlass MoE GEMM + CUDA backend (#13 carve-out 1/N) feat(cuda): NVFP4 cutlass MoE GEMM + CUDA backend (carve-out of #13) Jun 16, 2026
@TheTom
TheTom force-pushed the ek/kernel-reorg-steel branch from ffad7fc to 6a2035a Compare June 22, 2026 21:36
@TheTom
TheTom force-pushed the pr13/p1-nvfp4-cutlass-moe-cuda-backend branch from 0a73ea1 to c55c7a4 Compare June 22, 2026 22:06
@TheTom
TheTom changed the base branch from ek/kernel-reorg-steel to dev June 22, 2026 22:06
@TheTom
TheTom force-pushed the pr13/p1-nvfp4-cutlass-moe-cuda-backend branch from c55c7a4 to 657853a Compare June 22, 2026 22:18
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
TheTom force-pushed the pr13/p1-nvfp4-cutlass-moe-cuda-backend branch from 657853a to 7ef1e6b Compare June 22, 2026 22:49
@TheTom
TheTom merged commit 5b36752 into dev Jun 22, 2026
13 checks passed
@ekryski
ekryski deleted the pr13/p1-nvfp4-cutlass-moe-cuda-backend branch July 13, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant