Skip to content

Commit

Permalink
[platforms] improve error message for unspecified platforms (vllm-pro…
Browse files Browse the repository at this point in the history
…ject#10520)

Signed-off-by: youkaichao <[email protected]>
  • Loading branch information
youkaichao authored Nov 21, 2024
1 parent 3430857 commit aaddce5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,13 @@ def is_multi_step(self) -> bool:

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
Expand Down
1 change: 1 addition & 0 deletions vllm/platforms/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,4 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:

class UnspecifiedPlatform(Platform):
_enum = PlatformEnum.UNSPECIFIED
device_type = ""

0 comments on commit aaddce5

Please sign in to comment.