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
7341c77d
Unverified
Commit
7341c77d
authored
Mar 18, 2024
by
Nick Hill
Committed by
GitHub
Mar 18, 2024
Browse files
[BugFix] Avoid initializing CUDA too early (#3487)
parent
ef65dcfa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vllm/config.py
vllm/config.py
+4
-4
No files found.
vllm/config.py
View file @
7341c77d
...
@@ -577,12 +577,12 @@ class DeviceConfig:
...
@@ -577,12 +577,12 @@ class DeviceConfig:
def
__init__
(
self
,
device
:
str
=
"auto"
)
->
None
:
def
__init__
(
self
,
device
:
str
=
"auto"
)
->
None
:
if
device
==
"auto"
:
if
device
==
"auto"
:
# Automated device type detection
# Automated device type detection
if
torch
.
cuda
.
is_available
():
if
is_neuron
():
self
.
device_type
=
"cuda"
elif
is_neuron
():
self
.
device_type
=
"neuron"
self
.
device_type
=
"neuron"
else
:
else
:
raise
RuntimeError
(
"No supported device detected."
)
# We don't call torch.cuda.is_available() here to
# avoid initializing CUDA before workers are forked
self
.
device_type
=
"cuda"
else
:
else
:
# Device type is assigned explicitly
# Device type is assigned explicitly
self
.
device_type
=
device
self
.
device_type
=
device
...
...
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