Skip to content

Commit 9211536

Browse files
wangxiyuangmarinho2
authored andcommitted
[Platform] Allow platform use V1 Engine by default (vllm-project#19792)
Signed-off-by: wangxiyuan <[email protected]>
1 parent b79e31e commit 9211536

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
@@ -483,6 +483,13 @@ def supports_v1(cls, model_config: ModelConfig) -> bool:
483483
"""
484484
return False
485485

486+
@classmethod
487+
def default_v1(cls, model_config: ModelConfig) -> bool:
488+
"""
489+
Returns whether the current platform supports v1 by default.
490+
"""
491+
return cls.supports_v1(model_config)
492+
486493
@classmethod
487494
def use_custom_allreduce(cls) -> bool:
488495
"""

0 commit comments

Comments
 (0)