Skip to content

Commit db5ec52

Browse files
authored
[bugfix][distributed] improve p2p capability test (#5612)
[bugfix][distributed] do not error if two processes do not agree on p2p capability (#5612)
1 parent 114d727 commit db5ec52

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vllm/distributed/device_communicators/custom_all_reduce_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def consumer(batch_tgt: Sequence[int],
7171
if open_success:
7272
# modify the memory
7373
lib.cudaMemset(pointer, 2, 1024)
74+
lib.cudaDeviceSynchronize()
7475
# use two queues to simulate barrier
7576
producer_queue.get()
7677
consumer_queue.put(0)
@@ -142,8 +143,13 @@ def can_actually_p2p(
142143
for src, tgt in zip(batch_src, batch_tgt):
143144
a = result_queue.get()
144145
b = result_queue.get()
145-
assert a == b
146-
result.append(a)
146+
if a != b:
147+
logger.warning(
148+
"Two processes do not agree on the P2P access"
149+
" status on %d -> %d, treat as disabled.", src, tgt)
150+
result.append(False)
151+
else:
152+
result.append(a)
147153
return result
148154

149155

0 commit comments

Comments
 (0)