2025-02-02 14:58:18 -05:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2025-06-03 11:20:17 -07:00
|
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
2025-02-02 14:58:18 -05:00
|
|
|
|
2024-11-19 11:22:26 +08:00
|
|
|
from vllm.logger import init_logger
|
|
|
|
|
|
|
|
|
|
logger = init_logger(__name__)
|
|
|
|
|
|
2025-05-17 00:23:12 -07:00
|
|
|
|
|
|
|
|
try:
|
2025-11-26 23:25:21 -08:00
|
|
|
from tpu_inference.platforms import (
|
2025-11-26 14:46:36 -08:00
|
|
|
TpuPlatform as TpuInferencePlatform,
|
|
|
|
|
)
|
2025-10-05 15:06:22 +01:00
|
|
|
|
2025-10-08 12:00:52 +05:30
|
|
|
TpuPlatform = TpuInferencePlatform # type: ignore
|
|
|
|
|
USE_TPU_INFERENCE = True
|
2025-05-17 00:23:12 -07:00
|
|
|
except ImportError:
|
2026-01-07 00:07:16 -08:00
|
|
|
logger.error(
|
|
|
|
|
"tpu_inference not found, please install tpu_inference to run vllm on TPU"
|
|
|
|
|
)
|
2025-05-17 00:23:12 -07:00
|
|
|
pass
|