Skip to content

Commit d0e73fd

Browse files
liuzijing2014zijingliu
authored andcommitted
fix none type error
Signed-off-by: Zijing Liu <liuzijing2014@gmail.com>
1 parent 7e3a8dc commit d0e73fd

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

vllm/v1/outputs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,14 @@ class ModelRunnerOutput:
125125
prompt_logprobs_dict={},
126126
pooler_output=[],
127127
num_nans_in_logits=None)
128+
129+
EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT = ModelRunnerOutput(
130+
req_ids=[],
131+
req_id_to_index={},
132+
sampled_token_ids=[],
133+
spec_token_ids=None,
134+
logprobs=None,
135+
prompt_logprobs_dict={},
136+
pooler_output=[],
137+
num_nans_in_logits=None,
138+
kv_connector_output=KVConnectorOutput())

vllm/v1/worker/gpu_worker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
from vllm.utils import GiB_bytes, MemorySnapshot, memory_profiling
2828
from vllm.v1.engine import ReconfigureDistributedRequest, ReconfigureRankType
2929
from vllm.v1.kv_cache_interface import KVCacheConfig, KVCacheSpec
30-
from vllm.v1.outputs import EMPTY_MODEL_RUNNER_OUTPUT, ModelRunnerOutput
30+
from vllm.v1.outputs import (EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT,
31+
ModelRunnerOutput)
3132
from vllm.v1.utils import report_usage_stats
3233
from vllm.v1.worker.gpu_model_runner import GPUModelRunner
3334
from vllm.v1.worker.worker_base import WorkerBase
@@ -377,9 +378,9 @@ def execute_model(
377378
# kv_connector_output
378379
if (not kv_connector_output.finished_sending
379380
and not kv_connector_output.finished_recving):
380-
return EMPTY_MODEL_RUNNER_OUTPUT
381+
return EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT
381382

382-
output = copy.copy(EMPTY_MODEL_RUNNER_OUTPUT)
383+
output = copy.copy(EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT)
383384
output.kv_connector_output = kv_connector_output
384385
return output
385386

vllm/v1/worker/kv_connector_model_runner_mixin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from vllm.distributed.kv_transfer.kv_connector.base import KVConnectorBase
1515
from vllm.forward_context import get_forward_context, set_forward_context
1616
from vllm.logger import init_logger
17-
from vllm.v1.outputs import (EMPTY_MODEL_RUNNER_OUTPUT, KVConnectorOutput,
18-
ModelRunnerOutput)
17+
from vllm.v1.outputs import (EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT,
18+
KVConnectorOutput, ModelRunnerOutput)
1919

2020
if TYPE_CHECKING:
2121
from vllm.v1.core.sched.output import SchedulerOutput
@@ -68,9 +68,9 @@ def kv_connector_no_forward(scheduler_output: "SchedulerOutput",
6868

6969
if (not kv_connector_output.finished_sending
7070
and not kv_connector_output.finished_recving):
71-
return EMPTY_MODEL_RUNNER_OUTPUT
71+
return EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT
7272

73-
output = copy.copy(EMPTY_MODEL_RUNNER_OUTPUT)
73+
output = copy.copy(EMPTY_MODEL_RUNNER_WITH_KVC_OUTPUT)
7474
output.kv_connector_output = kv_connector_output
7575
return output
7676

0 commit comments

Comments
 (0)