@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / a43a3f1770
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bugfix][DP] DP distribution does not require ray[default] (#23822)

Signed-off-by: Kebe <mail@kebe7jun.com>

Kebe committed Sep 4, 2025 at 05:21 UTC a43a3f1770525b7ac88151667da76bc2f15ec50d
1 file changed +10 -14
vllm/v1/engine/utils.py
+10 -14
@@ -315,7 +315,6 @@ class CoreEngineActorManager:
315
316 import ray
317 from ray._private.state import available_resources_per_node
318 - from ray.util.state import list_nodes
318
319 logger.info("Creating placement groups for data parallel")
320 dp_master_ip = \
@@ -324,31 +323,28 @@ class CoreEngineActorManager:
323 local_engine_count = \
324 vllm_config.parallel_config.data_parallel_size_local
325
327 - nodes = sorted(list_nodes(filters=[("state", "=", "ALIVE")]),
328 - key=lambda node: node.node_ip != dp_master_ip)
329 - assert nodes[0].node_ip == dp_master_ip, (
330 - "The head node is missing or dead")
331 - assert len(nodes) == 1 or nodes[1].node_ip != dp_master_ip, (
332 - "There can only be one head node")
333 -
326 available_resources = available_resources_per_node()
327 world_size = vllm_config.parallel_config.world_size
328 placement_groups: list[PlacementGroup] = []
329 local_dp_ranks: list[int] = []
338 -
339 - for node in nodes:
340 - node_ip = node.node_ip
341 - node_resources = available_resources[node.node_id]
330 + dp_master_ip_key = f'node:{dp_master_ip}'
331 + nodes = sorted(available_resources.values(),
332 + key=lambda x: dp_master_ip_key not in x)
333 + assert len(nodes) > 0, (
334 + "No nodes with resources found in Ray cluster.")
335 + assert dp_master_ip_key in nodes[0], (
336 + "The DP master node (ip: %s) is missing or dead", dp_master_ip)
337 + for node_resources in nodes:
338 if "GPU" not in node_resources:
339 continue
340 # For now, each DP rank can only be assigned to one node
341 # TODO(rui): support allocating a single DP rank
342 # to multiple nodes
343 available_engine_count = int(node_resources["GPU"]) // world_size
348 - if node_ip == dp_master_ip:
344 + if dp_master_ip_key in node_resources:
345 assert available_engine_count >= local_engine_count, (
346 "Not enough resources to allocate DP ranks "
351 - f"on DP master node {node_ip}")
347 + f"on DP master node {dp_master_ip}")
348 for i in range(local_engine_count):
349 bundles = [{
350 "GPU": 1.0,