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
e54ebc2f
"vllm/vscode:/vscode.git/clone" did not exist on "7601cb044ddfe920055f82ae9503729d4dde7259"
Unverified
Commit
e54ebc2f
authored
Aug 19, 2024
by
youkaichao
Committed by
GitHub
Aug 19, 2024
Browse files
[doc] fix doc build error caused by msgspec (#7659)
parent
67e02fa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
docs/requirements-docs.txt
docs/requirements-docs.txt
+1
-0
vllm/platforms/__init__.py
vllm/platforms/__init__.py
+39
-8
No files found.
docs/requirements-docs.txt
View file @
e54ebc2f
...
...
@@ -3,6 +3,7 @@ sphinx-book-theme==1.0.1
sphinx-copybutton==0.5.2
myst-parser==2.0.0
sphinx-argparse==0.4.0
msgspec
# packages to install to build the documentation
pydantic
...
...
vllm/platforms/__init__.py
View file @
e54ebc2f
import
torch
from
.interface
import
Platform
,
PlatformEnum
,
UnspecifiedPlatform
current_platform
:
Platform
# NOTE: we don't use `torch.version.cuda` / `torch.version.hip` because
# they only indicate the build configuration, not the runtime environment.
# For example, people can install a cuda build of pytorch but run on tpu.
is_tpu
=
False
try
:
import
torch_xla.core.xla_model
as
xm
xm
.
xla_device
(
devkind
=
"TPU"
)
is_tpu
=
True
except
Exception
:
pass
is_cuda
=
False
try
:
import
pynvml
pynvml
.
nvmlInit
()
try
:
if
pynvml
.
nvmlDeviceGetCount
()
>
0
:
is_cuda
=
True
finally
:
pynvml
.
nvmlShutdown
()
except
Exception
:
pass
is_rocm
=
False
try
:
import
libtpu
except
ImportError
:
libtpu
=
None
import
amdsmi
amdsmi
.
amdsmi_init
()
try
:
if
len
(
amdsmi
.
amdsmi_get_processor_handles
())
>
0
:
is_rocm
=
True
finally
:
amdsmi
.
amdsmi_shut_down
()
except
Exception
:
pass
if
libtpu
is
not
None
:
if
is_tpu
:
# people might install pytorch built with cuda but run on tpu
# so we need to check tpu first
from
.tpu
import
TpuPlatform
current_platform
=
TpuPlatform
()
elif
torch
.
version
.
cuda
is
not
None
:
elif
is_cuda
:
from
.cuda
import
CudaPlatform
current_platform
=
CudaPlatform
()
elif
torch
.
version
.
hip
is
not
None
:
elif
is_rocm
:
from
.rocm
import
RocmPlatform
current_platform
=
RocmPlatform
()
else
:
...
...
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