mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #323] feat: MegaMOE adaptation for SM90 #367
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#367
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/323
Author: @qiushixiaoyu
Created: 4/30/2026
Status: 🔄 Open
Base:
main← Head:main📝 Commits (10+)
88db27fSupport tvm-ffi interfaces495fcfdSupport Wheel Compilation3036815Export the PDL utils of DeepGEMM (#34)607503aExpose BF16 grouped GEMM wrappers00c42b8Setup tests for sgl-deep-gemma8459f1Sm90 mega moe on sgl dev (#36)eed753cAdd Hopper mega moe test to runner (#46)f3d0ca5chore: bump apache-tvm-ffi 0.1.9 -> 0.1.11 (#47)bb569e2Add FP4 acts + MXF4 kind support and fused mega_moe_pre_dispatch kernel (#27)b111331Add DG_USE_FP8_COMBINE: FP8 + per-row UE8M0 SF on the second a2a (combine path) (#28)📊 Changes
72 files changed (+18234 additions, -362 deletions)
View changed files
➕
build_sgl_deep_gemm.sh(+157 -0)📝
csrc/apis/attention.hpp(+4 -0)📝
csrc/apis/einsum.hpp(+4 -3)📝
csrc/apis/gemm.hpp(+4 -0)📝
csrc/apis/hyperconnection.hpp(+4 -0)📝
csrc/apis/layout.hpp(+4 -0)📝
csrc/apis/mega.hpp(+86 -11)📝
csrc/apis/runtime.hpp(+4 -0)➕
csrc/apis/sm90_mega.hpp(+420 -0)📝
csrc/jit_kernels/heuristics/mega_moe.hpp(+35 -11)➕
csrc/jit_kernels/heuristics/sm90_mega_moe.hpp(+454 -0)📝
csrc/jit_kernels/impls/runtime_utils.hpp(+3 -1)📝
csrc/jit_kernels/impls/sm100_bf16_gemm.hpp(+1 -1)📝
csrc/jit_kernels/impls/sm100_bmk_bnk_mn.hpp(+1 -1)📝
csrc/jit_kernels/impls/sm100_fp8_fp4_gemm_1d1d.hpp(+1 -1)📝
csrc/jit_kernels/impls/sm100_fp8_fp4_mega_moe.hpp(+120 -17)➕
csrc/jit_kernels/impls/sm100_mega_moe_pre_dispatch.hpp(+175 -0)📝
csrc/jit_kernels/impls/sm100_tf32_hc_prenorm_gemm.hpp(+1 -1)📝
csrc/jit_kernels/impls/sm90_bf16_gemm.hpp(+1 -1)📝
csrc/jit_kernels/impls/sm90_bmk_bnk_mn.hpp(+1 -1)...and 52 more files
📄 Description
Summary
Add SM90/Hopper FP8 MegaMoE decode support to DeepGEMM.
This change introduces a fused SM90 MegaMoE kernel path for FP8 weights and FP8 activations, including the C++/CUDA implementation, JIT entry point, Python API wrapper, Hopper-specific weight transform, scheduling heuristics, and a unified Hopper accuracy/performance test script.
Main Changes
Added the SM90 FP8 MegaMoE fused kernel implementation:
deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuhcsrc/jit_kernels/impls/sm90_fp8_mega_moe.hppExtended MegaMoE API bindings with
fp8_mega_moefor SM90.Added Hopper-specific Python entry points:
deep_gemm.fp8_mega_moedeep_gemm.transform_weights_for_mega_moe_sm90Added SM90 MegaMoE scheduling/config heuristics.
Updated MegaMoE symmetric buffer handling for SM90 FP32 scale-factor layouts.
Added
tests/test_mega_moe_hopper.py, covering:DeepSeekV4Flash(8 card H20)
DeepSeekV4Pro(8 card H20)
Benchmark:DeepSeekV4Flash CP8/EP8
SLO-Compliant Total Throughput
Max Throughput
@LyricZhao Could you help review this PR when you have time? If the patch is too large for one PR, I’m happy to split it into smaller parts following your preference.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.