Skip to content

[Bugfix][Spec Decode] Fix DeepSeek/GLM MTP with sequence-parallel MoE and warm spec-sized logits all-gather#48572

Open
haosdent wants to merge 1 commit into
vllm-project:mainfrom
haosdent:fix-48568
Open

[Bugfix][Spec Decode] Fix DeepSeek/GLM MTP with sequence-parallel MoE and warm spec-sized logits all-gather#48572
haosdent wants to merge 1 commit into
vllm-project:mainfrom
haosdent:fix-48568

Conversation

@haosdent

@haosdent haosdent commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Two platform-independent issues prevent DeepSeek/GLM-5.2 MTP speculative decoding from working (surfaced on MI300X, #48568):

  1. Sequence-parallel MoE token restore. Under sequence-parallel MoE (expert-parallel + TP>1), mtp_block reduce-scatters its output, but DeepSeekMultiTokenPredictorLayer.forward never restored full tokens before shared_head/compute_logits, so ranks fed mismatched token counts into the vocab-parallel collective and it deadlocked. Restore full tokens, mirroring DeepseekV2Model.forward and the Qwen MTP fix ([BugFix] Restore full tokens for Qwen MTP When MoE SP #48429).

  2. Spec-sized logits all-gather warmup. Warmup only ran compute_logits' vocab-parallel all-gather at 1 row per request, but spec decode verifies max_num_reqs*(1+num_speculative_tokens) rows. On ROCm/RCCL the larger message connects extra channels lazily on first use; when that first use is a live decode step the connect fails (no transport for peer on channel N). Warm compute_logits at the spec row count during init.

Test Plan

Serve GLM-5.2-FP8 with MTP speculative decoding on 8x MI300X (gfx942):

vllm serve zai-org/GLM-5.2-FP8 --tensor-parallel-size 8 \
  --kv-cache-dtype fp8_e4m3 --linear-backend aiter --moe-backend aiter \
  --speculative-config '{"method":"mtp","num_speculative_tokens":1}'

Test Result

Validated on 8x MI300X: the server starts and serves normally with MTP speculative decoding active, producing coherent completions. Without this change the engine hangs in the logits all-gather on the first speculative-decode step.

@mergify mergify Bot added deepseek Related to DeepSeek models v1 bug Something isn't working labels Jul 14, 2026
… and warm spec-sized logits all-gather

Fixes DeepSeek/GLM-5.2 MTP speculative decoding (vllm-project#48568):

1. Restore full tokens in DeepSeekMultiTokenPredictorLayer.forward under
   sequence-parallel MoE (mtp_block reduce-scatters its output), mirroring
   DeepseekV2Model.forward and the Qwen MTP fix (vllm-project#48429).
2. Warm compute_logits at the spec-decode row count during init so the
   larger vocab-parallel all-gather connects its RCCL channels before a
   live decode step ("no transport for peer on channel N").

Signed-off-by: haosdent <haosdent@gmail.com>
@haosdent

Copy link
Copy Markdown
Contributor Author

@AndreasKaratzas can you help to take a look, this is to fix MTP issues when I run it in AMD Mi300x

@haosdent haosdent changed the title [WIP][Bugfix][Spec Decode] Fix DeepSeek/GLM MTP with sequence-parallel MoE and warm spec-sized logits all-gather [Bugfix][Spec Decode] Fix DeepSeek/GLM MTP with sequence-parallel MoE and warm spec-sized logits all-gather Jul 14, 2026
@haosdent haosdent closed this Jul 14, 2026
@haosdent haosdent reopened this Jul 14, 2026
@haosdent haosdent marked this pull request as ready for review July 14, 2026 06:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @haosdent.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working deepseek Related to DeepSeek models needs-rebase v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant