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
cebc22f3
Unverified
Commit
cebc22f3
authored
May 25, 2025
by
Chenguang Li
Committed by
GitHub
May 24, 2025
Browse files
[Misc]Replace `cuda` hard code with `current_platform` in Ray (#14668)
Signed-off-by:
noemotiovon
<
757486878@qq.com
>
parent
6c6dcd86
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
vllm/executor/ray_utils.py
vllm/executor/ray_utils.py
+2
-4
No files found.
vllm/executor/ray_utils.py
View file @
cebc22f3
...
...
@@ -87,9 +87,8 @@ try:
# TODO(swang): This is needed right now because Ray Compiled Graph
# executes on a background thread, so we need to reset torch's
# current device.
import
torch
if
not
self
.
compiled_dag_cuda_device_set
:
torch
.
cuda
.
set_device
(
self
.
worker
.
device
)
current_platform
.
set_device
(
self
.
worker
.
device
)
self
.
compiled_dag_cuda_device_set
=
True
output
=
self
.
worker
.
_execute_model_spmd
(
execute_model_req
,
...
...
@@ -113,8 +112,7 @@ try:
# Not needed
pass
else
:
import
torch
torch
.
cuda
.
set_device
(
self
.
worker
.
device
)
current_platform
.
set_device
(
self
.
worker
.
device
)
self
.
compiled_dag_cuda_device_set
=
True
...
...
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