Skip to content

Commit 6148584

Browse files
[BugFix] Corner case that could cause out-of-sync with external launcher mode and dp >1 (vllm-project#28774)
1 parent f77bce0 commit 6148584

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vllm/v1/worker/gpu_model_runner.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,6 +2663,18 @@ def execute_model(
26632663
return make_empty_encoder_model_runner_output(scheduler_output)
26642664

26652665
if not num_scheduled_tokens:
2666+
if (
2667+
self.parallel_config.distributed_executor_backend
2668+
== "external_launcher"
2669+
and self.parallel_config.data_parallel_size > 1
2670+
):
2671+
# this is a corner case when both external launcher
2672+
# and DP are enabled, num_scheduled_tokens could be
2673+
# 0, and has_unfinished_requests in the outer loop
2674+
# returns True. before returning early here we call
2675+
# dummy run to ensure coordinate_batch_across_dp
2676+
# is called into to avoid out of sync issues.
2677+
self._dummy_run(1)
26662678
if not has_kv_transfer_group():
26672679
# Return empty ModelRunnerOutput if no work to do.
26682680
return EMPTY_MODEL_RUNNER_OUTPUT

0 commit comments

Comments
 (0)