[MISC] Make GroupCoordinator compatible with out-of-tree devices (#16464)

Signed-off-by: hzji210@gmail.com <hzji210@gmail.com>
This commit is contained in:
Huazhong Ji 2025-04-12 17:20:25 +08:00 committed by GitHub
parent d9fc8cd9da
commit 68bb122eb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,9 +194,11 @@ class GroupCoordinator:
from vllm.platforms import current_platform
# TODO: fix it for other platforms
if current_platform.is_cuda_alike():
self.device = torch.device(f"cuda:{local_rank}")
elif current_platform.is_out_of_tree():
self.device = torch.device(
f"{current_platform.device_name}:{local_rank}")
else:
self.device = torch.device("cpu")