Skip to content

Commit 1e74276

Browse files
juliendenizedevpatelio
authored andcommitted
[BugFix] Ray with multiple nodes (vllm-project#28873)
Signed-off-by: Julien Denize <julien.denize@mistral.ai>
1 parent cb9cc58 commit 1e74276

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

vllm/v1/worker/gpu_worker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ def init_device(self):
205205
assert self.local_rank < torch.cuda.device_count(), (
206206
f"DP adjusted local rank {self.local_rank} is out of bounds. "
207207
)
208-
visible_device_count = (
209-
torch.cuda.device_count() if torch.cuda.is_available() else 0
210-
)
211-
assert self.parallel_config.local_world_size <= visible_device_count, (
212-
f"local_world_size ({self.parallel_config.local_world_size}) must be "
213-
f"less than or equal to the number of visible devices "
214-
f"({visible_device_count})."
215-
)
208+
visible_device_count = (
209+
torch.cuda.device_count() if torch.cuda.is_available() else 0
210+
)
211+
assert self.parallel_config.local_world_size <= visible_device_count, (
212+
f"local_world_size ({self.parallel_config.local_world_size}) must "
213+
f"be less than or equal to the number of visible devices "
214+
f"({visible_device_count})."
215+
)
216216
self.device = torch.device(f"cuda:{self.local_rank}")
217217
current_platform.set_device(self.device)
218218

0 commit comments

Comments
 (0)