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
bf13d409
Unverified
Commit
bf13d409
authored
Mar 03, 2025
by
Rui Qiao
Committed by
GitHub
Mar 04, 2025
Browse files
[core] Pass all driver env vars to ray workers unless excluded (#14099)
Signed-off-by:
Rui Qiao
<
ruisearch42@gmail.com
>
parent
989f4f43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
vllm/executor/ray_distributed_executor.py
vllm/executor/ray_distributed_executor.py
+27
-3
No files found.
vllm/executor/ray_distributed_executor.py
View file @
bf13d409
# SPDX-License-Identifier: Apache-2.0
import
asyncio
import
json
import
os
from
collections
import
defaultdict
from
dataclasses
import
dataclass
...
...
@@ -48,6 +49,24 @@ class RayWorkerMetaData:
class
RayDistributedExecutor
(
DistributedExecutorBase
):
"""Ray-based distributed executor"""
# These env vars are worker-specific, therefore are NOT copied
# from the driver to the workers
WORKER_SPECIFIC_ENV_VARS
=
{
"VLLM_HOST_IP"
,
"VLLM_HOST_PORT"
,
"LOCAL_RANK"
,
"CUDA_VISIBLE_DEVICES"
}
config_home
=
envs
.
VLLM_CONFIG_ROOT
# This file contains a list of env vars that should not be copied
# from the driver to the Ray workers.
non_carry_over_env_vars_file
=
os
.
path
.
join
(
config_home
,
"ray_non_carry_over_env_vars.json"
)
if
os
.
path
.
exists
(
non_carry_over_env_vars_file
):
with
open
(
non_carry_over_env_vars_file
)
as
f
:
non_carry_over_env_vars
=
set
(
json
.
load
(
f
))
else
:
non_carry_over_env_vars
=
set
()
uses_ray
:
bool
=
True
...
...
@@ -311,9 +330,9 @@ class RayDistributedExecutor(DistributedExecutorBase):
# Environment variables to copy from driver to workers
env_vars_to_copy
=
[
"VLLM_ATTENTION_BACKEND"
,
"TPU_CHIPS_PER_HOST_BOUNDS"
,
"TPU_HOST_BOUNDS"
,
"VLLM_USE_V1"
,
"VLLM_TRACE_FUNCTION"
,
"VLLM_TORCH_PROFILER_DIR"
,
"VLLM_TEST_ENABLE_EP"
v
for
v
in
envs
.
environment_variables
if
v
not
in
self
.
WORKER_SPECIFIC_ENV_VARS
and
v
not
in
self
.
non_carry_over_env_vars
]
# Copy existing env vars to each worker's args
...
...
@@ -323,9 +342,14 @@ class RayDistributedExecutor(DistributedExecutorBase):
if
name
in
os
.
environ
:
args
[
name
]
=
os
.
environ
[
name
]
logger
.
info
(
"non_carry_over_env_vars from config: %s"
,
self
.
non_carry_over_env_vars
)
logger
.
info
(
"Copying the following environment variables to workers: %s"
,
[
v
for
v
in
env_vars_to_copy
if
v
in
os
.
environ
])
logger
.
info
(
"If certain env vars should NOT be copied to workers, add them to "
"%s file"
,
self
.
non_carry_over_env_vars_file
)
self
.
_env_vars_for_all_workers
=
(
all_args_to_update_environment_variables
)
...
...
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