-
-
Notifications
You must be signed in to change notification settings - Fork 15.6k
[Build] Make pypi install work on CPU platform #12874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,11 @@ def load_module_from_path(module_name, path): | |
| "Building on %s, " | ||
| "so vLLM may not be able to run correctly", sys.platform) | ||
| VLLM_TARGET_DEVICE = "empty" | ||
| elif (sys.platform.startswith("linux") and torch.version.cuda is None | ||
| and os.getenv("VLLM_TARGET_DEVICE") is None): | ||
| # if cuda is not available and VLLM_TARGET_DEVICE is not set, | ||
| # fallback to cpu | ||
| VLLM_TARGET_DEVICE = "cpu" | ||
|
|
||
| MAIN_CUDA_VERSION = "12.1" | ||
|
|
||
|
|
@@ -482,7 +487,6 @@ def get_vllm_version() -> str: | |
| version = get_version( | ||
| write_to="vllm/_version.py", # TODO: move this to pyproject.toml | ||
| ) | ||
|
|
||
| sep = "+" if "+" not in version else "." # dev versions might contain + | ||
|
|
||
| if _no_device(): | ||
|
|
@@ -520,7 +524,8 @@ def get_vllm_version() -> str: | |
| elif _is_tpu(): | ||
| version += f"{sep}tpu" | ||
| elif _is_cpu(): | ||
| version += f"{sep}cpu" | ||
| if envs.VLLM_TARGET_DEVICE == "cpu": | ||
| version += f"{sep}cpu" | ||
|
||
| elif _is_xpu(): | ||
| version += f"{sep}xpu" | ||
| else: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check for torch.version.hip alongside torch.version.cuda, otherwise on ROCm it'll fall back to CPU