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 13, 04:30 UTC
[TPU] Fix import error in tpu launch (#28758)
Signed-off-by: Qiliang Cui <derrhein@gmail.com>
QiliangCui committed
Nov 14, 2025 at 16:58 UTC
9fc81ec765aa0daa6f704023c0f902a0da653b72
1 file changed
+9
-2
vllm/platforms/tpu.py
+9
-2
@@ -9,20 +9,25 @@ from tpu_info import device
9
10
from vllm.inputs import ProcessorInputs, PromptType
11
from vllm.logger import init_logger
12
-from vllm.sampling_params import SamplingParams, SamplingType
12
13
from .interface import Platform, PlatformEnum
14
15
if TYPE_CHECKING:
16
+ from typing import TypeAlias
17
+
18
from vllm.attention.backends.registry import AttentionBackendEnum
19
from vllm.config import VllmConfig
20
from vllm.config.cache import BlockSize
21
from vllm.pooling_params import PoolingParams
22
+ from vllm.sampling_params import SamplingParams
23
+
24
+ ParamsType: TypeAlias = SamplingParams | PoolingParams
25
else:
26
BlockSize = None
27
VllmConfig = None
28
PoolingParams = None
29
AttentionBackendEnum = None
30
+ ParamsType = None
31
32
logger = init_logger(__name__)
33
@@ -203,10 +208,12 @@ class TpuPlatform(Platform):
208
def validate_request(
209
cls,
210
prompt: PromptType,
206
- params: SamplingParams | PoolingParams,
211
+ params: ParamsType,
212
processed_inputs: ProcessorInputs,
213
) -> None:
214
"""Raises if this request is unsupported on this platform"""
215
+ from vllm.sampling_params import SamplingParams, SamplingType
216
+
217
if (
218
isinstance(params, SamplingParams)
219
and params.sampling_type == SamplingType.RANDOM_SEED