Enable mypy checking on V1 code (#11105)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin
2024-12-14 17:54:04 +00:00
committed by GitHub
parent 93abf23a64
commit 6d917d0eeb
21 changed files with 160 additions and 121 deletions

View File

@@ -81,7 +81,7 @@ class AsyncLLM(EngineClient):
asyncio_mode=True,
)
self.output_handler = None
self.output_handler: Optional[asyncio.Task] = None
def __del__(self):
self.shutdown()
@@ -126,7 +126,8 @@ class AsyncLLM(EngineClient):
handler.cancel()
@classmethod
def _get_executor_cls(cls, vllm_config: VllmConfig):
def _get_executor_cls(cls, vllm_config: VllmConfig) -> Type[Executor]:
executor_class: Type[Executor]
distributed_executor_backend = (
vllm_config.parallel_config.distributed_executor_backend)
if distributed_executor_backend == "mp":
@@ -361,10 +362,10 @@ class AsyncLLM(EngineClient):
logger.debug("Called check_health.")
async def start_profile(self) -> None:
await self.engine_core.profile(True)
await self.engine_core.profile_async(True)
async def stop_profile(self) -> None:
await self.engine_core.profile(False)
await self.engine_core.profile_async(False)
@property
def is_running(self) -> bool:
@@ -380,7 +381,7 @@ class AsyncLLM(EngineClient):
@property
def dead_error(self) -> BaseException:
return Exception
return Exception() # TODO: implement
# Retain V0 name for backwards compatibility.