Skip to content

Commit 257ab95

Browse files
authored
[Platform] Allow platform use V1 Engine by default (#19792)
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent cca91a7 commit 257ab95

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

vllm/engine/arg_utils.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
13031303
# Skip this check if we are running on a non-GPU platform,
13041304
# or if the device capability is not available
13051305
# (e.g. in a Ray actor without GPUs).
1306-
from vllm.platforms import CpuArchEnum, current_platform
1306+
from vllm.platforms import current_platform
13071307
if (current_platform.is_cuda()
13081308
and current_platform.get_device_capability()
13091309
and current_platform.get_device_capability().major < 8):
@@ -1445,14 +1445,10 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
14451445
_raise_or_fallback(feature_name=name, recommend_to_remove=False)
14461446
return False
14471447

1448-
# Non-[CUDA, TPU, x86 CPU] may be supported on V1,
1449-
# but off by default for now.
1450-
v0_hardware = not any(
1451-
(current_platform.is_cuda_alike(), current_platform.is_tpu(),
1452-
(current_platform.is_cpu()
1453-
and current_platform.get_cpu_architecture() == CpuArchEnum.X86)))
1454-
if v0_hardware and _warn_or_fallback( # noqa: SIM103
1455-
current_platform.device_name):
1448+
# The platform may be supported on V1, but off by default for now.
1449+
if not current_platform.default_v1( # noqa: SIM103
1450+
model_config=model_config) and _warn_or_fallback(
1451+
current_platform.device_name):
14561452
return False
14571453
#############################################################
14581454

vllm/platforms/cpu.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,11 @@ def supports_v1(cls, model_config) -> bool:
269269
model configuration.
270270
"""
271271
return True
272+
273+
@classmethod
274+
def default_v1(cls, model_config) -> bool:
275+
"""Returns whether the current platform can use v1 by default for the
276+
supplied model configuration.
277+
"""
278+
return cls.supports_v1(
279+
model_config) and cls.get_cpu_architecture() == CpuArchEnum.X86

vllm/platforms/interface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,13 @@ def supports_v1(cls, model_config: ModelConfig) -> bool:
479479
"""
480480
return False
481481

482+
@classmethod
483+
def default_v1(cls, model_config: ModelConfig) -> bool:
484+
"""
485+
Returns whether the current platform supports v1 by default.
486+
"""
487+
return cls.supports_v1(model_config)
488+
482489
@classmethod
483490
def use_custom_allreduce(cls) -> bool:
484491
"""

0 commit comments

Comments
 (0)