[DSV4][Kernel] Fuse shared experts into MegaMoE - #53040
Merged
Merged
Conversation
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
gcanlin
requested review from
AndreasKaratzas,
DarkLight1337,
ywang96 and
zyongye
as code owners
August 20, 2026 03:20
Contributor
Author
|
@WoosukKwon @zyongye @yewentao256 Could you please take a look when you have time? This is an optimization for DSV4 about MegaMoE on sm100. Thanks! |
Collaborator
|
/ci run |
|
✅ @gcanlin, CI is now available for this PR.
|
|
✅ Triggered Buildkite CI #84861 for commit |
WoosukKwon
approved these changes
Aug 20, 2026
WoosukKwon
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR! It's regretful that we didn't ship this earlier 😭
wyettzeng
pushed a commit
to wyettzeng/vllm
that referenced
this pull request
Aug 21, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com> Signed-off-by: Wyett <wyettzeng@gmail.com>
zufangzhu
pushed a commit
to zufangzhu/vllm
that referenced
this pull request
Aug 24, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
khushali9
pushed a commit
to khushali9/vllm
that referenced
this pull request
Aug 29, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com> Signed-off-by: khushali9 <khushali.desai9@gmail.com>
am-cohere
pushed a commit
to am-cohere/vllm
that referenced
this pull request
Sep 1, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
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
Part of #45861.
This PR fuses DeepSeek V4's replicated FP8 shared expert into DeepGEMM's persistent SM100 MegaMoE kernel in the NVIDIA-specific model path.
Before this change, every MoE layer launched the routed FP4 MegaMoE kernel and then ran the shared FP8 gate/up and down projections serially, followed by a separate add. The new path lets the native SM100 kernel schedule shared L1, routed dispatch/MMA, shared L2, and the final FP32 accumulation together. It retains the checkpoint's FP8 shared weights and produces one BF16 output store.
Test Plan
vllm serve /mnt/models/deepseek-ai/DeepSeek-V4-Flash-0731 \ --served-model-name dsv4 \ --host 127.0.0.1 --port 8000 \ --tensor-parallel-size 8 --enable-expert-parallel \ --moe-backend deep_gemm_mega_moe \ --tokenizer-mode deepseek_v4 \ --kv-cache-dtype fp8 --block-size 256 \ --attention-config.indexer_kv_dtype=mxfp4 \ --max-model-len 16384 --max-num-batched-tokens 8192 \ --gpu-memory-utilization 0.9 --seed 2026 \ --compilation-config \ '{"cudagraph_capture_sizes":[1,2,4,8,16,32,64,128,256],"max_cudagraph_capture_size":256}'Test Results
Batch-size-1 latency and throughput
Balanced workload: 128 requests, 1024 input, 128 output, concurrency 64
Prefill-heavy workload: 32 requests, 8192 input, 32 output, concurrency 16
Accuracy
Log
One of them