vllm - 💡(How to fix) Fix macOS source checkout resolves to UnspecifiedPlatform (empty device_type) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

vllm_version_matches_substr("cpu") re-raises PackageNotFoundError in source checkouts. The macOS fallback (sys.platform.startswith("darwin")) is inside the same try block, so the exception skips it entirely.

Root Cause

Description: When running vLLM from a source checkout on macOS (no pip install), cpu_platform_plugin() returns None because the sys.platform.startswith("darwin") fallback is unreachable. This causes resolve_current_platform_cls_qualname() to select UnspecifiedPlatform, which has device_type = "", crashing any torch.device("") call.

Fix Action

Fixed

Code Example

# On macOS, from a source checkout (no pip install):
from vllm.platforms import current_platform
print(current_platform.device_type)  # "" → torch.device("") crashes
RAW_BUFFERClick to expand / collapse

Description: When running vLLM from a source checkout on macOS (no pip install), cpu_platform_plugin() returns None because the sys.platform.startswith("darwin") fallback is unreachable. This causes resolve_current_platform_cls_qualname() to select UnspecifiedPlatform, which has device_type = "", crashing any torch.device("") call.

Minimal Reproducible Example:

# On macOS, from a source checkout (no pip install):
from vllm.platforms import current_platform
print(current_platform.device_type)  # "" → torch.device("") crashes

Expected behavior: cpu_platform_plugin() returns "vllm.platforms.cpu.CpuPlatform" on macOS regardless of package install state.

Actual behavior: RuntimeError: Device string must not be empty

Hypothesis: vllm_version_matches_substr("cpu") re-raises PackageNotFoundError in source checkouts. The macOS fallback (sys.platform.startswith("darwin")) is inside the same try block, so the exception skips it entirely.

Environment: macOS (darwin), Python 3.13, source checkout without pip install.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix macOS source checkout resolves to UnspecifiedPlatform (empty device_type) [1 pull requests]