Skip to content

Commit c299ff3

Browse files
author
David Ben-David
committed
Refactor KV connector output emptiness check
Signed-off-by: David Ben-David <[email protected]>
1 parent 51fbe2c commit c299ff3

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

vllm/v1/worker/gpu_worker.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ def execute_model(
464464

465465
# In case of PP with kv transfer, we need to pass through the
466466
# kv_connector_output
467-
if (not kv_connector_output.finished_sending
468-
and not kv_connector_output.finished_recving
469-
and not kv_connector_output.invalid_block_ids):
467+
if kv_connector_output.is_empty():
470468
return EMPTY_MODEL_RUNNER_OUTPUT
471469

472470
output = copy.copy(EMPTY_MODEL_RUNNER_OUTPUT)

vllm/v1/worker/kv_connector_model_runner_mixin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ def kv_connector_no_forward(scheduler_output: "SchedulerOutput",
7575
scheduler_output, wait_for_save=False) as kv_connector_output:
7676
pass
7777

78-
if (not kv_connector_output.finished_sending
79-
and not kv_connector_output.finished_recving
80-
and not kv_connector_output.invalid_block_ids):
78+
if kv_connector_output.is_empty():
8179
return EMPTY_MODEL_RUNNER_OUTPUT
8280

8381
output = copy.copy(EMPTY_MODEL_RUNNER_OUTPUT)

0 commit comments

Comments
 (0)