Skip to content

Commit 614516f

Browse files
committed
[Frontend] deprecated --device arg
Signed-off-by: Kebe <[email protected]>
1 parent 23baa21 commit 614516f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

docs/source/getting_started/installation/gpu/xpu.inc.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ XPU platform supports **tensor parallel** inference/serving and also supports **
6666
python -m vllm.entrypoints.openai.api_server \
6767
--model=facebook/opt-13b \
6868
--dtype=bfloat16 \
69-
--device=xpu \
7069
--max_model_len=1024 \
7170
--distributed-executor-backend=ray \
7271
--pipeline-parallel-size=2 \

vllm/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,11 @@ class DeviceConfig:
22012201
"""Configuration for the device to use for vLLM execution."""
22022202

22032203
device: Union[Device, torch.device] = "auto"
2204-
"""Device type for vLLM execution."""
2204+
"""Device type for vLLM execution.
2205+
This parameter is deprecated and will be
2206+
removed in a future release.
2207+
It will now be set automatically based
2208+
on the current platform."""
22052209
device_type: str = field(init=False)
22062210
"""Device type from the current platform. This is set in
22072211
`__post_init__`."""

vllm/engine/arg_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,9 @@ def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
737737
title="DeviceConfig",
738738
description=DeviceConfig.__doc__,
739739
)
740-
device_group.add_argument("--device", **device_kwargs["device"])
740+
device_group.add_argument("--device",
741+
**device_kwargs["device"],
742+
deprecated=True)
741743

742744
# Speculative arguments
743745
speculative_group = parser.add_argument_group(
@@ -977,7 +979,7 @@ def create_engine_config(
977979
from vllm.platforms import current_platform
978980
current_platform.pre_register_and_update()
979981

980-
device_config = DeviceConfig(device=self.device)
982+
device_config = DeviceConfig(device=current_platform.device_type)
981983
model_config = self.create_model_config()
982984

983985
# * If VLLM_USE_V1 is unset, we enable V1 for "supported features"

0 commit comments

Comments
 (0)