mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-15 11:55:00 +08:00
[Platform] Allow platform use V1 Engine by default (#19792)
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
parent
cca91a7a10
commit
257ab95439
@ -1303,7 +1303,7 @@ class EngineArgs:
|
|||||||
# Skip this check if we are running on a non-GPU platform,
|
# Skip this check if we are running on a non-GPU platform,
|
||||||
# or if the device capability is not available
|
# or if the device capability is not available
|
||||||
# (e.g. in a Ray actor without GPUs).
|
# (e.g. in a Ray actor without GPUs).
|
||||||
from vllm.platforms import CpuArchEnum, current_platform
|
from vllm.platforms import current_platform
|
||||||
if (current_platform.is_cuda()
|
if (current_platform.is_cuda()
|
||||||
and current_platform.get_device_capability()
|
and current_platform.get_device_capability()
|
||||||
and current_platform.get_device_capability().major < 8):
|
and current_platform.get_device_capability().major < 8):
|
||||||
@ -1445,14 +1445,10 @@ class EngineArgs:
|
|||||||
_raise_or_fallback(feature_name=name, recommend_to_remove=False)
|
_raise_or_fallback(feature_name=name, recommend_to_remove=False)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Non-[CUDA, TPU, x86 CPU] may be supported on V1,
|
# The platform may be supported on V1, but off by default for now.
|
||||||
# but off by default for now.
|
if not current_platform.default_v1( # noqa: SIM103
|
||||||
v0_hardware = not any(
|
model_config=model_config) and _warn_or_fallback(
|
||||||
(current_platform.is_cuda_alike(), current_platform.is_tpu(),
|
current_platform.device_name):
|
||||||
(current_platform.is_cpu()
|
|
||||||
and current_platform.get_cpu_architecture() == CpuArchEnum.X86)))
|
|
||||||
if v0_hardware and _warn_or_fallback( # noqa: SIM103
|
|
||||||
current_platform.device_name):
|
|
||||||
return False
|
return False
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
|
|||||||
@ -269,3 +269,11 @@ class CpuPlatform(Platform):
|
|||||||
model configuration.
|
model configuration.
|
||||||
"""
|
"""
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def default_v1(cls, model_config) -> bool:
|
||||||
|
"""Returns whether the current platform can use v1 by default for the
|
||||||
|
supplied model configuration.
|
||||||
|
"""
|
||||||
|
return cls.supports_v1(
|
||||||
|
model_config) and cls.get_cpu_architecture() == CpuArchEnum.X86
|
||||||
|
|||||||
@ -479,6 +479,13 @@ class Platform:
|
|||||||
"""
|
"""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def default_v1(cls, model_config: ModelConfig) -> bool:
|
||||||
|
"""
|
||||||
|
Returns whether the current platform supports v1 by default.
|
||||||
|
"""
|
||||||
|
return cls.supports_v1(model_config)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def use_custom_allreduce(cls) -> bool:
|
def use_custom_allreduce(cls) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user