mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #473] Add optimized fused FP8 x MXFP4 MegaMoE for SM90 #474
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#474
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/473
Author: @AIExplorer7
Created: 10/14/2026
Status: 🔄 Open
Base:
nv_dev← Head:feat/sm90-fused-mxfp4📝 Commits (1)
724a799Add optimized fused FP8 x MXFP4 MegaMoE for SM90📊 Changes
23 files changed (+11200 additions, -14 deletions)
View changed files
📝
README.md(+2 -0)➕
csrc/apis/sm90_fused_mega.hpp(+424 -0)➕
csrc/jit_kernels/heuristics/sm90_fused_mega_moe.hpp(+852 -0)➕
csrc/jit_kernels/impls/sm90_fp8_fused_mega_moe.hpp(+471 -0)📝
csrc/python_api.cpp(+2 -0)📝
deep_gemm/__init__.py(+3 -0)📝
deep_gemm/include/deep_gemm/comm/barrier.cuh(+15 -6)➕
deep_gemm/include/deep_gemm/common/sm90_mxfp4_decode.cuh(+150 -0)➕
deep_gemm/include/deep_gemm/impls/sm90_fp8_fused_mega_moe.cuh(+5780 -0)➕
deep_gemm/include/deep_gemm/layout/sm90_fused_mega_moe.cuh(+304 -0)📝
deep_gemm/include/deep_gemm/mma/sm90.cuh(+48 -0)📝
deep_gemm/include/deep_gemm/ptx/ld_st.cuh(+64 -0)➕
deep_gemm/include/deep_gemm/scheduler/sm90_fused_mega_moe.cuh(+893 -0)📝
deep_gemm/mega/__init__.py(+44 -8)➕
deep_gemm/mega/mxfp4.py(+486 -0)➕
deep_gemm/mega/sm90_fused.py(+139 -0)➕
docs/benchmarks/sm90-fused-mxfp4-h20.csv(+673 -0)➕
docs/sm90-fused-mxfp4-benchmarks.md(+168 -0)➕
docs/sm90-fused-mxfp4.md(+168 -0)➕
tests/bench_sm90_fused_mega_moe.py(+163 -0)...and 3 more files
📄 Description
1. Overview
This PR adds optimized SM90 MXFP4 MegaMoE to
nv_dev. Derived from #440, with MXFP4 format and decoder foundations from #411 (referencing Humming). Our additions include tiled register decoding, specialized small-M buckets, direct swap epilogues, MXFP4 split-M and tail optimization, and optional single-token split-K.EP8 speedups across M=1--8192:
2. Two key optimizations
Small M: tiled register decoding + RS WGMMA. Pack each 256-row x K128 weight stage into a contiguous 16 KiB tile and decode directly into register A fragments, avoiding expanded-weight shared-memory traffic and associated synchronization. Extend #411's swapAB with N8/16/24/32/40/48 buckets, selected double buffering, and direct SwiGLU/quantization epilogues.
Large M and tails: MXFP4 split-M. Use 128x256 tiles with two math warpgroups sharing decoded weights; specialize partial tiles with RS buckets, a dual N96 swap path, and empty-half WGMMA skipping. Order dynamic tails by valid rows and preserve the scaling chain for bitwise repeatability.
3. Performance against #411, #383, and #440: M=1--8192
EP8, Flash
(hidden=4096, intermediate=2048, experts/GPU=32, top-k=6) (us)
EP8, Pro
(hidden=7168, intermediate=3072, experts/GPU=48, top-k=6) (us)
Single-GPU results: M=1--8192
Single GPU, Flash
(hidden=4096, intermediate=2048, experts/GPU=32, top-k=6) (us)
Single GPU, Pro
(hidden=7168, intermediate=3072, experts/GPU=48, top-k=6) (us)
Validation and reproduction
docs/sm90-fused-mxfp4-benchmarks.mdanddocs/benchmarks/sm90-fused-mxfp4-h20.csv.4. Follow-up work
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.