[hardware] unify usage of is_tpu to current_platform.is_tpu() (#7102)
This commit is contained in:
@@ -10,11 +10,12 @@ import vllm.envs as envs
|
||||
from vllm.logger import init_logger
|
||||
from vllm.model_executor.layers.quantization import QUANTIZATION_METHODS
|
||||
from vllm.model_executor.models import ModelRegistry
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.tracing import is_otel_installed
|
||||
from vllm.transformers_utils.config import get_config, get_hf_text_config
|
||||
from vllm.utils import (STR_NOT_IMPL_ENC_DEC_CUDAGRAPH, GiB_bytes,
|
||||
cuda_device_count_stateless, get_cpu_memory, is_cpu,
|
||||
is_hip, is_neuron, is_openvino, is_tpu, is_xpu,
|
||||
is_hip, is_neuron, is_openvino, is_xpu,
|
||||
print_warning_once)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -282,7 +283,7 @@ class ModelConfig:
|
||||
raise ValueError(
|
||||
f"{self.quantization} quantization is currently not "
|
||||
f"supported in ROCm.")
|
||||
if is_tpu(
|
||||
if current_platform.is_tpu(
|
||||
) and self.quantization not in tpu_supported_quantization:
|
||||
raise ValueError(
|
||||
f"{self.quantization} quantization is currently not "
|
||||
@@ -910,7 +911,7 @@ class DeviceConfig:
|
||||
self.device_type = "neuron"
|
||||
elif is_openvino():
|
||||
self.device_type = "openvino"
|
||||
elif is_tpu():
|
||||
elif current_platform.is_tpu():
|
||||
self.device_type = "tpu"
|
||||
elif is_cpu():
|
||||
self.device_type = "cpu"
|
||||
|
||||
Reference in New Issue
Block a user