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
c7742d61
Unverified
Commit
c7742d61
authored
Jul 25, 2025
by
Rui Qiao
Committed by
GitHub
Jul 25, 2025
Browse files
[Bugfix] Always set RAY_ADDRESS for Ray actor before spawn (#21540)
Signed-off-by:
Rui Qiao
<
ruisearch42@gmail.com
>
parent
cea96a01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
vllm/utils/__init__.py
vllm/utils/__init__.py
+10
-9
No files found.
vllm/utils/__init__.py
View file @
c7742d61
...
@@ -2883,26 +2883,27 @@ def _maybe_force_spawn():
...
@@ -2883,26 +2883,27 @@ def _maybe_force_spawn():
if
os
.
environ
.
get
(
"VLLM_WORKER_MULTIPROC_METHOD"
)
==
"spawn"
:
if
os
.
environ
.
get
(
"VLLM_WORKER_MULTIPROC_METHOD"
)
==
"spawn"
:
return
return
reason
=
None
reasons
=
[]
if
cuda_is_initialized
():
if
is_in_ray_actor
():
reason
=
"CUDA is initialized"
elif
xpu_is_initialized
():
reason
=
"XPU is initialized"
elif
is_in_ray_actor
():
# even if we choose to spawn, we need to pass the ray address
# even if we choose to spawn, we need to pass the ray address
# to the subprocess so that it knows how to connect to the ray cluster.
# to the subprocess so that it knows how to connect to the ray cluster.
# env vars are inherited by subprocesses, even if we use spawn.
# env vars are inherited by subprocesses, even if we use spawn.
import
ray
import
ray
os
.
environ
[
"RAY_ADDRESS"
]
=
ray
.
get_runtime_context
().
gcs_address
os
.
environ
[
"RAY_ADDRESS"
]
=
ray
.
get_runtime_context
().
gcs_address
reason
=
"In a Ray actor and can only be spawned"
reasons
.
append
(
"In a Ray actor and can only be spawned"
)
if
cuda_is_initialized
():
reasons
.
append
(
"CUDA is initialized"
)
elif
xpu_is_initialized
():
reasons
.
append
(
"XPU is initialized"
)
if
reason
is
not
None
:
if
reason
s
:
logger
.
warning
(
logger
.
warning
(
"We must use the `spawn` multiprocessing start method. "
"We must use the `spawn` multiprocessing start method. "
"Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. "
"Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. "
"See https://docs.vllm.ai/en/latest/usage/"
"See https://docs.vllm.ai/en/latest/usage/"
"troubleshooting.html#python-multiprocessing "
"troubleshooting.html#python-multiprocessing "
"for more information. Reason: %s"
,
reason
)
"for more information. Reason
s
: %s"
,
"; "
.
join
(
reason
s
)
)
os
.
environ
[
"VLLM_WORKER_MULTIPROC_METHOD"
]
=
"spawn"
os
.
environ
[
"VLLM_WORKER_MULTIPROC_METHOD"
]
=
"spawn"
...
...
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