[hardware] unify usage of is_tpu to current_platform.is_tpu() (#7102)
This commit is contained in:
@@ -41,7 +41,7 @@ from vllm.model_executor.models.interfaces import (has_inner_state,
|
||||
supports_vision)
|
||||
from vllm.model_executor.utils import set_weight_attrs
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils import is_pin_memory_available, is_tpu
|
||||
from vllm.utils import is_pin_memory_available
|
||||
|
||||
|
||||
@contextmanager
|
||||
@@ -94,7 +94,7 @@ def _get_quantization_config(
|
||||
"""Get the quantization config."""
|
||||
if model_config.quantization is not None:
|
||||
quant_config = get_quant_config(model_config, load_config)
|
||||
if not is_tpu():
|
||||
if not current_platform.is_tpu():
|
||||
capability = current_platform.get_device_capability()
|
||||
capability = capability[0] * 10 + capability[1]
|
||||
if capability < quant_config.get_min_capability():
|
||||
@@ -320,7 +320,7 @@ class DefaultModelLoader(BaseModelLoader):
|
||||
else:
|
||||
weights_iterator = pt_weights_iterator(hf_weights_files)
|
||||
|
||||
if is_tpu():
|
||||
if current_platform.is_tpu():
|
||||
# In PyTorch XLA, we should call `xm.mark_step` frequently so that
|
||||
# not too many ops are accumulated in the XLA program.
|
||||
import torch_xla.core.xla_model as xm
|
||||
|
||||
Reference in New Issue
Block a user