Skip to content

[BugFix]Fix the issue of DCP and DP services getting stuck - #12036

Merged
zzzzwwjj merged 3 commits into
vllm-project:mainfrom
weiguihua2:main
Jul 15, 2026
Merged

zzzzwwjj merged 3 commits into
vllm-project:mainfrom
weiguihua2:main

Conversation

@weiguihua2

@weiguihua2 weiguihua2 commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

When fixing the issue of dcp overlaying dp, a curl request causes the service to get stuck.

When mtp=3 and there is only one request, for prefill, during the execution of mtp by dp0, only step0 is executed. The other two steps are copies of step0. dp1 performs a dummy run, and is_prefill is considered false, so it does not handle this special logic. As a result, all three steps are executed, leading to dp0 and dp1 executing a different number of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute the mtp step multiple times.

Does this PR introduce any user-facing change?

No

How was this patch tested?

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a service-stalling bug occurring during DCP (Data Parallel) prefill operations when using MTP. The issue stemmed from inconsistent execution counts between DP workers during the prefill phase. By enabling DCP prefill to execute the MTP step multiple times, the PR ensures synchronization across workers and resolves the communication deadlock.

Highlights

  • DCP Prefill Logic Update: Updated the MTP (Multi-Token Prediction) step execution logic to ensure DCP prefill batches correctly handle multiple steps, preventing service stalls caused by mismatched execution counts between DP workers.
  • Metadata Preparation: Refactored prepare_spec_decode_mtp_drafting_inputs and _get_spec_decode_mtp_slot_inputs to support DCP prefill batches in addition to standard decode-only batches.
  • Test Infrastructure: Updated test utilities to include DPVllmRunner and added data parallel configuration to relevant accuracy tests.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.


Tip

💡 Consider Linking a Related Issue or RFC

Your PR title contains the [BugFix] tag, indicating a bug fix or new feature.

Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:

  • Fixes #<issue_number>
  • Closes #<issue_number>
  • Resolves #<issue_number>
  • Refs #<rfc_or_issue_number> (for RFCs)

🙏 Thanks for helping us keep the project well-organized!

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

Suggested PR Title:

[Ops][BugFix] Fix MTP speculative decoding for DCP prefill and update accuracy tests

Suggested PR Summary:

### What this PR does / why we need it?
This pull request introduces support for DCP (Decode Context Parallel) prefill batches in MTP (Multi-Token Prediction) speculative decoding. Specifically, it:
- Updates `pcp_utils.py` to prepare CP MTP metadata for both decode and DCP-prefill batches, and pre-allocates MTP slot mappings when DCP prefill slots are needed.
- Adjusts the early-exit condition in `llm_base_proposer.py` during prefill.
- Updates the end-to-end accuracy tests to use `DPVllmRunner` when data parallel is enabled.

Feedback and issues identified:
1. In `test_accuracy.py`, the condition `data_parallel_size > 2` will fail to use `DPVllmRunner` when `data_parallel_size` is exactly 2, causing the test to crash. This should be changed to `> 1`.
2. In `llm_base_proposer.py`, changing the early-exit condition to `self.pcp_size > 1 and is_prefill` introduces a hang risk in hybrid PCP/DCP configurations due to desynchronization between active prefill ranks and decode ranks.
3. In `pcp_utils.py`, restricting `needs_dcp_prefill_slots` to `self.pcp_world_size == 1` will cause failures in hybrid configurations.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Tested with end-to-end accuracy tests in `test_accuracy.py`.

Comment thread tests/e2e/pull_request/four_card/context_parallel/test_accuracy.py Outdated
Comment thread vllm_ascend/spec_decode/llm_base_proposer.py
Comment thread vllm_ascend/worker/pcp_utils.py
@weiguihua2

weiguihua2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

/nightly multi-node-deepseek-r1-w8a8-longseq
nightly command triggered.

@weiguihua2

weiguihua2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

/e2e tests/e2e/pull_request/four_card/context_parallel/test_accuracy.py::test_models_pcp_dcp_full_feature_accuracy
[Bot]: e2e command triggered. See workflow run for details.
[Bot]: e2e command failed.

@weiguihua2

weiguihua2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

/nightly multi-node-deepseek-r1-w8a8-longseq
nightly command triggered.

@weiguihua2

weiguihua2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

/rerun
[Bot]: rerun completed.

Rerun:

  • E2E

@weiguihua2

weiguihua2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

/nightly multi-node-deepseek-r1-w8a8-longseq
nightly command triggered.

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
@zzzzwwjj
zzzzwwjj merged commit 15592ed into vllm-project:main Jul 15, 2026
37 checks passed
ningjingbengxiaohai pushed a commit to ningjingbengxiaohai/vllm-ascend that referenced this pull request Jul 18, 2026
…ect#12036)

### What this PR does / why we need it?
When fixing the issue of dcp overlaying dp, a curl request causes the
service to get stuck.

When mtp=3 and there is only one request, for prefill, during the
execution of mtp by dp0, only step0 is executed. The other two steps are
copies of step0. dp1 performs a dummy run, and is_prefill is considered
false, so it does not handle this special logic. As a result, all three
steps are executed, leading to dp0 and dp1 executing a different number
of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute
the mtp step multiple times.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

---------

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
Alex-stack-hub pushed a commit to 0moyi0-2024/vllm-ascend_tp that referenced this pull request Jul 27, 2026
…ect#12036)

### What this PR does / why we need it?
When fixing the issue of dcp overlaying dp, a curl request causes the
service to get stuck.

When mtp=3 and there is only one request, for prefill, during the
execution of mtp by dp0, only step0 is executed. The other two steps are
copies of step0. dp1 performs a dummy run, and is_prefill is considered
false, so it does not handle this special logic. As a result, all three
steps are executed, leading to dp0 and dp1 executing a different number
of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute
the mtp step multiple times.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

---------

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
MmMmaru pushed a commit to jiaqi-lee/vllm-ascend that referenced this pull request Aug 19, 2026
…ect#12036)

### What this PR does / why we need it?
When fixing the issue of dcp overlaying dp, a curl request causes the
service to get stuck.

When mtp=3 and there is only one request, for prefill, during the
execution of mtp by dp0, only step0 is executed. The other two steps are
copies of step0. dp1 performs a dummy run, and is_prefill is considered
false, so it does not handle this special logic. As a result, all three
steps are executed, leading to dp0 and dp1 executing a different number
of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute
the mtp step multiple times.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

---------

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
shiqiangA pushed a commit to shiqiangA/vllm-ascend that referenced this pull request Aug 20, 2026
…ect#12036)

### What this PR does / why we need it?
When fixing the issue of dcp overlaying dp, a curl request causes the
service to get stuck.

When mtp=3 and there is only one request, for prefill, during the
execution of mtp by dp0, only step0 is executed. The other two steps are
copies of step0. dp1 performs a dummy run, and is_prefill is considered
false, so it does not handle this special logic. As a result, all three
steps are executed, leading to dp0 and dp1 executing a different number
of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute
the mtp step multiple times.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

---------

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
Leetrytry pushed a commit to Leetrytry/vllm-ascend that referenced this pull request Sep 11, 2026
…ect#12036)

### What this PR does / why we need it?
When fixing the issue of dcp overlaying dp, a curl request causes the
service to get stuck.

When mtp=3 and there is only one request, for prefill, during the
execution of mtp by dp0, only step0 is executed. The other two steps are
copies of step0. dp1 performs a dummy run, and is_prefill is considered
false, so it does not handle this special logic. As a result, all three
steps are executed, leading to dp0 and dp1 executing a different number
of times, ultimately causing the communication to get stuck.

The current modification method is that dcp prefill will also execute
the mtp step multiple times.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

---------

Signed-off-by: weiguihua2 <weiguihua2@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants