Skip to content

Conversation

@liziyu179
Copy link
Contributor

@liziyu179 liziyu179 commented Oct 28, 2025

What this PR does / why we need it?

force with_prefill true after allreduce in kv producer

Does this PR introduce any user-facing change?

How was this patch tested?

Signed-off-by: liziyu <liziyu16@huawei.com>
Signed-off-by: liziyu <liziyu16@huawei.com>
@github-actions
Copy link

👋 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.

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 aims to fix issues related to prefill for the KV producer. The changes include moving a code block in _dummy_run to ensure with_prefill is set correctly before being used, and adding a check in save_kv_layer to only proceed if there are requests. The code movement in vllm_ascend/worker/model_runner_v1.py correctly fixes a bug. However, the change in vllm_ascend/distributed/mooncake_layerwise_connector.py introduces a critical AttributeError due to a typo. I've provided a comment with a suggested fix for this issue.

**kwargs) -> None:
"""MooncakeLayerwiseConnector does not save explicitly."""
if self.kv_role == 'kv_producer':
if self.kv_role == 'kv_producer' and connector_metadata.request.keys():
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There's a typo in the attribute name. The MooncakeLayerwiseConnectorMetadata object has an attribute requests (plural), not request. This will raise an AttributeError at runtime.

Additionally, to check if the dictionary is not empty, you can use the dictionary directly in a boolean context, which is more Pythonic.

Suggested change
if self.kv_role == 'kv_producer' and connector_metadata.request.keys():
if self.kv_role == 'kv_producer' and connector_metadata.requests:

@liziyu179 liziyu179 changed the title Fix with prefill kv producer v0 11 0 [v0.11.0] [P/D] force with_prefill true after allreduce in kv producer Oct 28, 2025
Signed-off-by: liziyu <liziyu16@huawei.com>
@liziyu179 liziyu179 force-pushed the fix_with_prefill_kv_producer_v0_11_0 branch from 61c19e2 to f7b64f8 Compare October 29, 2025 03:17
@MengqingCao
Copy link
Collaborator

This is a backport of #3768 and #3849

@MengqingCao MengqingCao merged commit e5b938c into vllm-project:v0.11.0-dev Oct 29, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants