Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 593db14

Browse files
njhillRobert Shaw
authored and
Robert Shaw
committed
[BugFix] Fix return type of executor execute_model methods (vllm-project#4402)
1 parent 5a4c41b commit 593db14

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

vllm/executor/cpu_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def execute_model_async(
109109
blocks_to_swap_in: Dict[int, int],
110110
blocks_to_swap_out: Dict[int, int],
111111
blocks_to_copy: Dict[int, List[int]],
112-
) -> SamplerOutput:
112+
) -> List[SamplerOutput]:
113113
output = await make_async(self.driver_worker.execute_model)(
114114
seq_group_metadata_list=seq_group_metadata_list,
115115
blocks_to_swap_in=blocks_to_swap_in,

vllm/executor/distributed_gpu_executor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import abstractmethod
2-
from typing import Any, Dict, Optional, Set, Tuple
2+
from typing import Any, Dict, List, Optional, Set, Tuple
33

44
from vllm.executor.executor_base import ExecutorAsyncBase
55
from vllm.executor.gpu_executor import GPUExecutor
@@ -52,7 +52,7 @@ def initialize_cache(self, num_gpu_blocks: int,
5252
num_gpu_blocks=num_gpu_blocks,
5353
num_cpu_blocks=num_cpu_blocks)
5454

55-
def execute_model(self, *args, **kwargs) -> SamplerOutput:
55+
def execute_model(self, *args, **kwargs) -> List[SamplerOutput]:
5656
all_outputs = self._run_workers("execute_model",
5757
driver_args=args,
5858
driver_kwargs=kwargs)
@@ -105,7 +105,8 @@ async def _run_workers_async(
105105
"""Runs the given method on all workers."""
106106
raise NotImplementedError
107107

108-
async def execute_model_async(self, *args, **kwargs) -> SamplerOutput:
108+
async def execute_model_async(self, *args,
109+
**kwargs) -> List[SamplerOutput]:
109110
all_outputs = await self._run_workers_async("execute_model",
110111
driver_args=args,
111112
driver_kwargs=kwargs)

vllm/executor/executor_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def execute_model_async(
112112
blocks_to_swap_in: Dict[int, int],
113113
blocks_to_swap_out: Dict[int, int],
114114
blocks_to_copy: Dict[int, List[int]],
115-
) -> SamplerOutput:
115+
) -> List[SamplerOutput]:
116116
"""Executes one model step on the given sequences."""
117117
raise NotImplementedError
118118

vllm/executor/gpu_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ async def execute_model_async(
163163
blocks_to_swap_in: Dict[int, int],
164164
blocks_to_swap_out: Dict[int, int],
165165
blocks_to_copy: Dict[int, List[int]],
166-
) -> SamplerOutput:
166+
) -> List[SamplerOutput]:
167167
output = await make_async(self.driver_worker.execute_model)(
168168
seq_group_metadata_list=seq_group_metadata_list,
169169
blocks_to_swap_in=blocks_to_swap_in,

vllm/executor/neuron_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def execute_model_async(
8484
blocks_to_swap_in: Dict[int, int],
8585
blocks_to_swap_out: Dict[int, int],
8686
blocks_to_copy: Dict[int, List[int]],
87-
) -> SamplerOutput:
87+
) -> List[SamplerOutput]:
8888
output = await make_async(self.driver_worker.execute_model)(
8989
seq_group_metadata_list=seq_group_metadata_list, )
9090
return output

vllm/executor/ray_gpu_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def execute_model(self,
188188
blocks_to_swap_in: Dict[int, int],
189189
blocks_to_swap_out: Dict[int, int],
190190
blocks_to_copy: Dict[int, List[int]],
191-
num_lookahead_slots: int = 0) -> SamplerOutput:
191+
num_lookahead_slots: int = 0) -> List[SamplerOutput]:
192192
all_outputs = self._run_workers(
193193
"execute_model",
194194
driver_kwargs={

0 commit comments

Comments
 (0)