[TPU][V1] Disable per-request seed/Generator (#16172)

Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
Nicolò Lucchesi
2025-04-10 17:05:44 -04:00
committed by GitHub
parent 7cd0bd7212
commit 3cc9af88ff
4 changed files with 24 additions and 18 deletions
+8 -5
View File
@@ -7,7 +7,7 @@ import torch
import vllm.envs as envs
from vllm.inputs import PromptType
from vllm.logger import init_logger
from vllm.sampling_params import SamplingParams
from vllm.sampling_params import SamplingParams, SamplingType
from .interface import Platform, PlatformEnum, _Backend
@@ -145,7 +145,10 @@ class TpuPlatform(Platform):
params: Union[SamplingParams, PoolingParams],
) -> None:
"""Raises if this request is unsupported on this platform"""
if isinstance(params,
SamplingParams) and params.guided_decoding is not None:
raise ValueError("Structured output is not supported on "
f"{cls.device_name}.")
if isinstance(params, SamplingParams):
if params.guided_decoding is not None:
raise ValueError("Structured output is not supported on "
f"{cls.device_name}.")
if params.sampling_type == SamplingType.RANDOM_SEED:
raise ValueError(
"Torch XLA does not support per-request seed.")