From aaddce5d268d2c82d49b0240d6c112ba4941f69e Mon Sep 17 00:00:00 2001 From: youkaichao Date: Wed, 20 Nov 2024 23:07:56 -0800 Subject: [PATCH] [platforms] improve error message for unspecified platforms (#10520) Signed-off-by: youkaichao --- vllm/config.py | 3 ++- vllm/platforms/interface.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/config.py b/vllm/config.py index b2785e1c..ed09f8ae 100644 --- a/vllm/config.py +++ b/vllm/config.py @@ -1191,12 +1191,13 @@ class SchedulerConfig: class DeviceConfig: device: Optional[torch.device] + device_type: str def __init__(self, device: str = "auto") -> None: if device == "auto": # Automated device type detection self.device_type = current_platform.device_type - if self.device_type is None: + if not self.device_type: raise RuntimeError("Failed to infer device type") else: # Device type is assigned explicitly diff --git a/vllm/platforms/interface.py b/vllm/platforms/interface.py index 68abec28..07f23167 100644 --- a/vllm/platforms/interface.py +++ b/vllm/platforms/interface.py @@ -170,3 +170,4 @@ class Platform: class UnspecifiedPlatform(Platform): _enum = PlatformEnum.UNSPECIFIED + device_type = ""