[bugfix][distributed] fix 16 gpus local rank arrangement (#5604)

This commit is contained in:
youkaichao 2024-06-17 14:35:04 -07:00 committed by GitHub
parent 9e4e6fe207
commit 1b44aaf4e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -137,6 +137,12 @@ class RayGPUExecutor(DistributedGPUExecutor):
for i, (node_id, gpu_ids) in enumerate(worker_node_and_gpu_ids):
node_workers[node_id].append(i)
# `gpu_ids` can be a list of strings or integers.
# convert them to integers for consistency.
# NOTE: gpu_ids can be larger than 9 (e.g. 16 GPUs),
# string sorting is not sufficient.
# see https://github.com/vllm-project/vllm/issues/5590
gpu_ids = [int(x) for x in gpu_ids]
node_gpus[node_id].extend(gpu_ids)
for node_id, gpu_ids in node_gpus.items():
node_gpus[node_id] = sorted(gpu_ids)