@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 30215ca61f
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 13:30 UTC

[MISC] Use string annotation types for class definitions (#17244)

Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>

Jade Zheng committed Apr 27, 2025 at 16:39 UTC 30215ca61f81cb313d184e74c2f616f1a1a10804
2 files changed +4 -10
vllm/platforms/cuda.py
+2 -5
@@ -21,9 +21,6 @@ from .interface import DeviceCapability, Platform, PlatformEnum, _Backend
21
22 if TYPE_CHECKING:
23 from vllm.config import ModelConfig, VllmConfig
24 -else:
25 - ModelConfig = None
26 - VllmConfig = None
24
25 logger = init_logger(__name__)
26
@@ -109,7 +106,7 @@ class CudaPlatformBase(Platform):
106 pass
107
108 @classmethod
112 - def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
109 + def check_and_update_config(cls, vllm_config: "VllmConfig") -> None:
110 parallel_config = vllm_config.parallel_config
111 scheduler_config = vllm_config.scheduler_config
112 compilation_config = vllm_config.compilation_config
@@ -308,7 +305,7 @@ class CudaPlatformBase(Platform):
305 return cls.has_device_capability(89)
306
307 @classmethod
311 - def supports_v1(cls, model_config: ModelConfig) -> bool:
308 + def supports_v1(cls, model_config: "ModelConfig") -> bool:
309 return True
310
311 @classmethod
vllm/platforms/rocm.py
+2 -5
@@ -13,9 +13,6 @@ from .interface import DeviceCapability, Platform, PlatformEnum, _Backend
13
14 if TYPE_CHECKING:
15 from vllm.config import ModelConfig, VllmConfig
16 -else:
17 - ModelConfig = None
18 - VllmConfig = None
16
17 logger = init_logger(__name__)
18
@@ -243,7 +240,7 @@ class RocmPlatform(Platform):
240 return True
241
242 @classmethod
246 - def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
243 + def check_and_update_config(cls, vllm_config: "VllmConfig") -> None:
244 cache_config = vllm_config.cache_config
245 if cache_config and cache_config.block_size is None:
246 cache_config.block_size = 16
@@ -332,7 +329,7 @@ class RocmPlatform(Platform):
329 return torch.float8_e4m3fn
330
331 @classmethod
335 - def supports_v1(cls, model_config: ModelConfig) -> bool:
332 + def supports_v1(cls, model_config: "ModelConfig") -> bool:
333 # V1 support on AMD gpus is experimental
334 return True
335