Skip to content

Commit b1a9d3b

Browse files
ruisearch42shreyankg
authored andcommitted
[bugfix] Fix profiling for RayDistributedExecutor (vllm-project#13945)
Signed-off-by: Rui Qiao <[email protected]>
1 parent d461640 commit b1a9d3b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

vllm/executor/ray_distributed_executor.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,19 +309,24 @@ def sort_by_driver_then_worker_ip(item: RayWorkerMetaData):
309309
",".join(map(str, node_gpus[node_id])),
310310
} for (node_id, _) in worker_node_and_gpu_ids]
311311

312+
# Environment variables to copy from driver to workers
313+
env_vars_to_copy = [
314+
"VLLM_ATTENTION_BACKEND", "TPU_CHIPS_PER_HOST_BOUNDS",
315+
"TPU_HOST_BOUNDS", "VLLM_USE_V1", "VLLM_TRACE_FUNCTION",
316+
"VLLM_TORCH_PROFILER_DIR", "VLLM_TEST_ENABLE_EP"
317+
]
318+
319+
# Copy existing env vars to each worker's args
312320
for args in all_args_to_update_environment_variables:
313-
# some carry-over env vars from the driver
314321
# TODO: refactor platform-specific env vars
315-
for name in [
316-
"VLLM_ATTENTION_BACKEND",
317-
"TPU_CHIPS_PER_HOST_BOUNDS",
318-
"TPU_HOST_BOUNDS",
319-
"VLLM_USE_V1",
320-
"VLLM_TRACE_FUNCTION",
321-
]:
322+
for name in env_vars_to_copy:
322323
if name in os.environ:
323324
args[name] = os.environ[name]
324325

326+
logger.info(
327+
"Copying the following environment variables to workers: %s",
328+
[v for v in env_vars_to_copy if v in os.environ])
329+
325330
self._env_vars_for_all_workers = (
326331
all_args_to_update_environment_variables)
327332

0 commit comments

Comments
 (0)