Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
407b5537
Unverified
Commit
407b5537
authored
Feb 08, 2025
by
wangxiyuan
Committed by
GitHub
Feb 08, 2025
Browse files
[Build] Make pypi install work on CPU platform (#12874)
parent
4ea48fb3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
setup.py
setup.py
+7
-2
No files found.
setup.py
View file @
407b5537
...
...
@@ -47,6 +47,11 @@ elif not (sys.platform.startswith("linux")
"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,6 +524,7 @@ def get_vllm_version() -> str:
elif
_is_tpu
():
version
+=
f
"
{
sep
}
tpu"
elif
_is_cpu
():
if
envs
.
VLLM_TARGET_DEVICE
==
"cpu"
:
version
+=
f
"
{
sep
}
cpu"
elif
_is_xpu
():
version
+=
f
"
{
sep
}
xpu"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment