A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 06:00 UTC
[Platform] Allow platform use V1 Engine by default (#19792)
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
wangxiyuan committed
Jun 18, 2025 at 21:03 UTC
257ab9543973d3df3ef7254725a3372318698ed6
3 files changed
+20
-9
vllm/engine/arg_utils.py
+5
-9
@@ -1303,7 +1303,7 @@ class EngineArgs:
1303
# Skip this check if we are running on a non-GPU platform,
1304
# or if the device capability is not available
1305
# (e.g. in a Ray actor without GPUs).
1306
- from vllm.platforms import CpuArchEnum, current_platform
1306
+ from vllm.platforms import current_platform
1307
if (current_platform.is_cuda()
1308
and current_platform.get_device_capability()
1309
and current_platform.get_device_capability().major < 8):
@@ -1445,14 +1445,10 @@ class EngineArgs:
1445
_raise_or_fallback(feature_name=name, recommend_to_remove=False)
1446
return False
1447
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):
1452
return False
1453
#############################################################
1454
vllm/platforms/cpu.py
+8
@@ -269,3 +269,11 @@ class CpuPlatform(Platform):
269
model configuration.
270
"""
271
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
+7
@@ -479,6 +479,13 @@ class Platform:
479
"""
480
return False
481
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
+
489
@classmethod
490
def use_custom_allreduce(cls) -> bool:
491
"""