Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vllm/distributed/device_communicators/custom_all_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def __init__(self,
dist.all_gather(gather_list, tensor, group=self.group)
physical_device_ids = [t.item() for t in gather_list]

# 3 nodes will be like [0,1,2,3,0,1,0,1]
if sorted(physical_device_ids)[-1] + 1 != world_size:
logger.warning(
"Custom allreduce is disabled because this feature is "
"not intended for multi node use case.")
return

Comment on lines +152 to +158
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not safe. It is possible, that one node uses gpu 0, 1 , while the other node uses 2, 3, and the world size is 4. In this case, we cannot use custom allreduce. However, this code will not capture it.

# test nvlink first, this will filter out most of the cases
# where custom allreduce is not supported
# this checks hardware and driver support for NVLink
Expand Down