Skip to content

Commit 4ffaa4b

Browse files
youkaichaojimpang
authored and
jimpang
committed
[bugfix][distributed] fix 16 gpus local rank arrangement (vllm-project#5604)
1 parent 9ed3837 commit 4ffaa4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/executor/ray_gpu_executor.py

+6
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ def _init_workers_ray(self, placement_group: "PlacementGroup",
137137

138138
for i, (node_id, gpu_ids) in enumerate(worker_node_and_gpu_ids):
139139
node_workers[node_id].append(i)
140+
# `gpu_ids` can be a list of strings or integers.
141+
# convert them to integers for consistency.
142+
# NOTE: gpu_ids can be larger than 9 (e.g. 16 GPUs),
143+
# string sorting is not sufficient.
144+
# see https://github.com/vllm-project/vllm/issues/5590
145+
gpu_ids = [int(x) for x in gpu_ids]
140146
node_gpus[node_id].extend(gpu_ids)
141147
for node_id, gpu_ids in node_gpus.items():
142148
node_gpus[node_id] = sorted(gpu_ids)

0 commit comments

Comments
 (0)