[Frontend] deprecate --device arg (#18399)

Signed-off-by: Kebe <mail@kebe7jun.com>
This commit is contained in:
Kebe 2025-05-21 16:21:17 +08:00 committed by GitHub
parent cd8dfc6dfc
commit 5d7f545204
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View File

@ -66,7 +66,6 @@ XPU platform supports **tensor parallel** inference/serving and also supports **
python -m vllm.entrypoints.openai.api_server \
--model=facebook/opt-13b \
--dtype=bfloat16 \
--device=xpu \
--max_model_len=1024 \
--distributed-executor-backend=ray \
--pipeline-parallel-size=2 \

View File

@ -2201,7 +2201,11 @@ class DeviceConfig:
"""Configuration for the device to use for vLLM execution."""
device: Union[Device, torch.device] = "auto"
"""Device type for vLLM execution."""
"""Device type for vLLM execution.
This parameter is deprecated and will be
removed in a future release.
It will now be set automatically based
on the current platform."""
device_type: str = field(init=False)
"""Device type from the current platform. This is set in
`__post_init__`."""

View File

@ -737,7 +737,9 @@ class EngineArgs:
title="DeviceConfig",
description=DeviceConfig.__doc__,
)
device_group.add_argument("--device", **device_kwargs["device"])
device_group.add_argument("--device",
**device_kwargs["device"],
deprecated=True)
# Speculative arguments
speculative_group = parser.add_argument_group(
@ -977,7 +979,7 @@ class EngineArgs:
from vllm.platforms import current_platform
current_platform.pre_register_and_update()
device_config = DeviceConfig(device=self.device)
device_config = DeviceConfig(device=current_platform.device_type)
model_config = self.create_model_config()
# * If VLLM_USE_V1 is unset, we enable V1 for "supported features"