Skip to content

[DSv4][P5-4] MXFP8×MXFP4 Routed Expert grouped GEMM: strict CUDA kernel - #399

Open
Bignonia7 wants to merge 1 commit into
RL-Align:dsv4-p5-devfrom
Bignonia7:p5-4-mxfp8-mxfp4-grouped-gemm
Open

[DSv4][P5-4] MXFP8×MXFP4 Routed Expert grouped GEMM: strict CUDA kernel#399
Bignonia7 wants to merge 1 commit into
RL-Align:dsv4-p5-devfrom
Bignonia7:p5-4-mxfp8-mxfp4-grouped-gemm

Conversation

@Bignonia7

Copy link
Copy Markdown

Summary

P5-4 (#61): fc1/fc2 frozen base GEMM for routed experts — MXFP8 activation × MXFP4 frozen weight.

What's included

  • csrc/cuda/moe/mxfp8_mxfp4_grouped_gemm.cu — hand-written strict FFMA kernel (fwd + dX-only bwd). MXFP4 weights stay packed; dequant happens in register/smem only. Byte-exact vs oracle-fp32-serial-v1.
  • rl_engine/moe/provider.pyCudaP5GemmProvider fail-closed adapter + "cuda" alias; provenance() reports kernel fingerprint mxfp8-mxfp4-grouped-gemm-strict-v1.

Notes

  • Backward writes dX only (base weights frozen, no dW).
  • expert_tensor_parallel_size = 1.
  • WGMMA performance path deferred to a later PR (SM90 fp8 WGMMA has no FP4 operand and reduced-precision accumulation, so it cannot be byte-exact here).

Signed-off-by: Bignonia7 <Bignonia7@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 258cfe0e-4002-4b11-8a90-4d9595e7ce7d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@KJLdefeated KJLdefeated added platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) DSv4 deepseek-P5 labels Sep 10, 2026
@KJLdefeated

Copy link
Copy Markdown
Collaborator

Hi @Bignonia7, can you implement a Triton version of this kernel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek-P5 DSv4 platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants