Conversation
Euynaheh
requested review from
Alisehen,
AniZpZ,
BBuf,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
OrangeRedeng,
Ying1123,
b8zhong,
ch-wan,
ispobock,
merrymercy and
mmangkad
as code owners
September 7, 2026 11:28
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.
Summary
This PR adds an opt-in
flashinfer_megamoerunner backend for DeepSeek-V4-Flash with MXFP4 expert weights and MXFP8 activations on SM120 GPUs.The backend calls FlashInfer's public
flashinfer.moe_epinterface and replaces the routed MoE sequencedispatch -> FC1 -> FC2 -> combinewith a FlashInfer
MoEEpLayer.The initial supported configuration is:
With DP attention enabled, each rank owns a different DP token stream when entering the MoE layers. The adapter communicates the maximum active token count across ranks to FlashInfer and supports ranks with zero local tokens.
Existing MoE backends are unchanged unless
flashinfer_megamoeis selected explicitly.Implementation
This PR:
flashinfer_megamoeto the MoE runner backend choices.--flashinfer-megamoe-max-num-tokensfor the symmetric workspace capacity.PrequantizedMoEWeights,BootstrapConfig,FleetParams, andMoEEpLayerobjects from SGLang-loaded checkpoint weights.[gate; up]W13 layout expected by the MegaMoE preprocessor.Validation and unsupported combinations
The argument resolver rejects configurations that are not currently supported:
--enable-two-batch-overlapThe token capacity must be large enough for the maximum number of active tokens on any EP rank. The backend reports an explicit error when the configured capacity is exceeded.
All benchmark requests completed without crashes, OOMs, watchdog failures, CUDA/NCCL errors, or HTTP 5xx responses.
Tests
Result:
The unit tests cover:
FlashInfer dependency
This PR requires a FlashInfer version that provides the SM120 MXFP4-weight × MXFP8-activation
flashinfer.moe_epbackend.The prerequisite FlashInfer infrastructure PR has been merged:
We're working on the CI of MXFP4 x MXFP8 MegaMoE in FlashInfer. Will be merged soon:
Current limitations
CI States
Latest PR Test (Base): ❌ Missing
run-cilabel -- add it to run CI tests.Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.Latest PR Test (AMD ROCm 7.2): ➖ No AMD PR run found for this commit.