File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2285,7 +2285,7 @@ def is_multi_step(self) -> bool:
2285
2285
class DeviceConfig :
2286
2286
"""Configuration for the device to use for vLLM execution."""
2287
2287
2288
- device : SkipValidation [Union [Device , torch .device ]] = "auto"
2288
+ device : SkipValidation [Optional [ Union [Device , torch .device ] ]] = "auto"
2289
2289
"""Device type for vLLM execution.
2290
2290
This parameter is deprecated and will be
2291
2291
removed in a future release.
@@ -2327,7 +2327,10 @@ def __post_init__(self):
2327
2327
"to turn on verbose logging to help debug the issue." )
2328
2328
else :
2329
2329
# Device type is assigned explicitly
2330
- self .device_type = self .device
2330
+ if isinstance (self .device , str ):
2331
+ self .device_type = self .device
2332
+ elif isinstance (self .device , torch .device ):
2333
+ self .device_type = self .device .type
2331
2334
2332
2335
# Some device types require processing inputs on CPU
2333
2336
if self .device_type in ["neuron" ]:
Original file line number Diff line number Diff line change @@ -1018,7 +1018,8 @@ def create_engine_config(
1018
1018
from vllm .platforms import current_platform
1019
1019
current_platform .pre_register_and_update ()
1020
1020
1021
- device_config = DeviceConfig (device = current_platform .device_type )
1021
+ device_config = DeviceConfig (
1022
+ device = cast (Device , current_platform .device_type ))
1022
1023
model_config = self .create_model_config ()
1023
1024
1024
1025
# * If VLLM_USE_V1 is unset, we enable V1 for "supported features"
You can’t perform that action at this time.
0 commit comments