[P/D] force with_prefill true after allreduce in kv producer (#3768)

### What this PR does / why we need it?
force with_prefill true after allreduce in kv producer

- vLLM version: v0.11.0rc3
- vLLM main:
c9461e05a4

---------

Signed-off-by: liziyu <liziyu16@huawei.com>
This commit is contained in:
liziyu
2025-10-29 10:15:38 +08:00
committed by GitHub
parent f57bdb09fc
commit c76db627ab
2 changed files with 5 additions and 5 deletions

View File

@@ -1151,7 +1151,7 @@ class MooncakeLayerwiseConnectorWorker:
connector_metadata: MooncakeLayerwiseConnectorMetadata, connector_metadata: MooncakeLayerwiseConnectorMetadata,
**kwargs) -> None: **kwargs) -> None:
"""MooncakeLayerwiseConnector does not save explicitly.""" """MooncakeLayerwiseConnector does not save explicitly."""
if self.kv_role == 'kv_producer': if self.kv_role == 'kv_producer' and connector_metadata.request.keys():
if self.pd_head_ratio != 1: if self.pd_head_ratio != 1:
if self.current_layer != 0: if self.current_layer != 0:
self.completion_event.wait() self.completion_event.wait()

View File

@@ -2645,6 +2645,10 @@ class NPUModelRunner(LoRAModelRunnerMixin):
tp_size = self.vllm_config.parallel_config.tensor_parallel_size tp_size = self.vllm_config.parallel_config.tensor_parallel_size
num_tokens = math.ceil(num_tokens / tp_size) * tp_size num_tokens = math.ceil(num_tokens / tp_size) * tp_size
# Force dummy run on prefill stage when this node is deemed as kv producer.
if self.is_kv_producer and not self.is_kv_consumer:
with_prefill = True
# Padding for DP # Padding for DP
(num_tokens, num_tokens_across_dp, (num_tokens, num_tokens_across_dp,
with_prefill) = self._sync_metadata_across_dp(num_tokens, with_prefill) = self._sync_metadata_across_dp(num_tokens,
@@ -2693,10 +2697,6 @@ class NPUModelRunner(LoRAModelRunnerMixin):
num_scheduled_tokens = np.array(num_scheduled_tokens_list, num_scheduled_tokens = np.array(num_scheduled_tokens_list,
dtype=np.int32) dtype=np.int32)
# Force dummy run on prefill stage when this node is deemed as kv producer.
if self.is_kv_producer and not self.is_kv_consumer:
with_prefill = True
if not self.in_profile_run and self.dynamic_eplb: if not self.in_profile_run and self.dynamic_eplb:
self.eplb_updator.forward_before() self.eplb_updator.forward_before()