From 68bb122eb458a42169dd9d1772a7b32b84b2be95 Mon Sep 17 00:00:00 2001 From: Huazhong Ji Date: Sat, 12 Apr 2025 17:20:25 +0800 Subject: [PATCH] [MISC] Make GroupCoordinator compatible with out-of-tree devices (#16464) Signed-off-by: hzji210@gmail.com --- vllm/distributed/parallel_state.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/distributed/parallel_state.py b/vllm/distributed/parallel_state.py index fa493fef..e0eeeffb 100644 --- a/vllm/distributed/parallel_state.py +++ b/vllm/distributed/parallel_state.py @@ -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")