Skip to content

Conversation

@MatthewBonanni
Copy link
Contributor

@MatthewBonanni MatthewBonanni commented Sep 29, 2025

Purpose

Using MTP with VLLM_ALL2ALL_BACKEND=deepep_low_latency causes an AssertionError due to incorrect handling of shared experts. This PR is a fix, carrying the logic from FusedMoE.forward_impl over to FusedMoE.forward_impl_chunked

Test Plan

VLLM_ALL2ALL_BACKEND=deepep_low_latency \
VLLM_ATTENTION_BACKEND=FLASH_ATTN_MLA \
vllm serve deepseek-ai/DeepSeek-R1 \
    --tensor-parallel-size 1 \
    --enable-expert-parallel \
    --data-parallel-size 8 \
    --trust-remote-code \
    --host 0.0.0.0 \
    --port 8000 \
    --speculative-config '{"method": "deepseek_mtp", "num_speculative_tokens": 1}'

Test Result

Previously hits AssertionError during startup, now starts up successfully.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@MatthewBonanni MatthewBonanni marked this pull request as draft September 29, 2025 20:41
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an AssertionError that occurs when using speculative decoding with the deepep_low_latency backend on models featuring shared experts. The root cause was the forward_impl_chunked method in the FusedMoE layer lacking the logic to handle shared experts, which was already present in the non-chunked forward_impl method. The changes introduce this missing logic, ensuring consistent behavior and resolving the crash. The fix appears correct and aligns the chunked and non-chunked execution paths.

@MatthewBonanni MatthewBonanni marked this pull request as ready for review September 29, 2025 20:56
@MatthewBonanni
Copy link
Contributor Author

cc @LucasWilkinson

Copy link
Collaborator

@LucasWilkinson LucasWilkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does MTP mean we don't end up using the modular kernel?

@MatthewBonanni
Copy link
Contributor Author

MatthewBonanni commented Sep 30, 2025

@LucasWilkinson the modular kernel is still used for the standard transformer blocks. With MTP, though, when running the mtp_block, self.quant_method.fused_experts is None and there are self.shared_experts (as a DeepseekV2MLP), so they need to be processed.

@simon-mo simon-mo force-pushed the fix_mtp_low_latency branch from 3d317b1 to 710fb09 Compare October 1, 2025 21:40
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@simon-mo simon-mo force-pushed the fix_mtp_low_latency branch from 710fb09 to a14794b Compare October 2, 2025 14:20
Copy link
Collaborator

@LucasWilkinson LucasWilkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LucasWilkinson LucasWilkinson enabled auto-merge (squash) October 2, 2025 17:04
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 2, 2025
@LucasWilkinson LucasWilkinson merged commit 13cdc02 into vllm-project:main Oct 2, 2025
51 checks passed
@MatthewBonanni MatthewBonanni deleted the fix_mtp_low_latency branch October 2, 2025 21:33
pdasigi pushed a commit to pdasigi/vllm that referenced this pull request Oct 2, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
tomeras91 pushed a commit to tomeras91/vllm that referenced this pull request Oct 6, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
karan pushed a commit to karan/vllm that referenced this pull request Oct 6, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Karan Goel <3261985+karan@users.noreply.github.com>
southfreebird pushed a commit to southfreebird/vllm that referenced this pull request Oct 7, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants