[SM90] Optimize FP8 MegaMoE small-batch decode path with swapAB#48
Open
qiushixiaoyu wants to merge 4 commits into
Open
[SM90] Optimize FP8 MegaMoE small-batch decode path with swapAB#48qiushixiaoyu wants to merge 4 commits into
qiushixiaoyu wants to merge 4 commits into
Conversation
5 tasks
added 4 commits
June 30, 2026 16:43
15a6f42 to
6d2e9d5
Compare
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 optimizes the SM90 FP8 MegaMoE decode split-N path for small-batch workloads by adding a heuristic-controlled
swapABkernel path.Main changes:
swapABheuristic for SM90 FP8 MegaMoE:num_tokens <= 128expected_tokens_per_expert > 0use_swap_abtemplate flag for the optimized path.Performance
Single-operator performance was measured against the low-latency baseline with
--run-low-latency-baseline.Notes:
fused_mean_usandll_mean_usare averages across ranks.swapABis enabled by heuristic for batch1-128; batch256falls back to the normal no-swap path.Flash shape
hidden=4096, intermediate=2048, experts=256, topk=6Pro shape
hidden=7168, intermediate=3072, experts=384, topk=6Accuracy
Validation was run with the updated DeepGEMM code.
Single-operator accuracy:
SGLang model-level accuracy: