Skip to content

Commit 4ae6061

Browse files
Synchronize vLLM flags to support cross-node inference (#897)
synchronize 12 vLLM flags to non-driver workers in Ray executor FIX "not warmed-up" bucket issue in cross-node vLLM inference. Root cause: the issue is caused by not synchronizing the 12 vLLM flags to all the non-driver workers within the Ray cluster ![image](https://github.com/user-attachments/assets/fb51cefc-b23a-434d-a641-493592d896a6) --------- Co-authored-by: Michał Kuligowski <mkuligowski@habana.ai>
1 parent ec06496 commit 4ae6061

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

vllm/executor/ray_distributed_executor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ def _init_workers_ray(self, placement_group: "PlacementGroup",
141141
**ray_remote_kwargs):
142142
num_gpus = envs.VLLM_RAY_PER_WORKER_GPUS
143143

144+
def retain_envs(var_name):
145+
retain_var_list = [
146+
'GLOO_SOCKET_IFNAME', 'HCCL_SOCKET_IFNAME',
147+
'NCCL_SOCKET_IFNAME'
148+
]
149+
return ('HPU' in var_name or 'RAY' in var_name
150+
or 'VLLM' in var_name or var_name in retain_var_list)
151+
144152
# The driver dummy worker does not actually use any resources.
145153
# It holds the resource for the driver worker.
146154
self.driver_dummy_worker: Optional[RayWorkerWrapper] = None
@@ -198,11 +206,16 @@ def _init_workers_ray(self, placement_group: "PlacementGroup",
198206
)(RayWorkerWrapper).remote(vllm_config=self.vllm_config,
199207
rpc_rank=rank)
200208
else:
209+
runtime_env_vars = {
210+
k: v
211+
for k, v in os.environ.items() if retain_envs(k)
212+
}
201213
worker = ray.remote(
202214
num_cpus=0,
203215
num_gpus=0,
204216
resources={current_platform.ray_device_key: num_gpus},
205217
scheduling_strategy=scheduling_strategy,
218+
runtime_env={"env_vars": runtime_env_vars},
206219
**ray_remote_kwargs,
207220
)(RayWorkerWrapper).remote(vllm_config=self.vllm_config,
208221
rpc_rank=rank)

0 commit comments

Comments
 (0)