Skip to content

Commit 4160b8c

Browse files
Mike Ruberryfacebook-github-bot
authored andcommitted
adds sync to flaky test_events_multi_gpu_query (#26231)
Summary: This test can sometimes fail in CI. I suspect this flakiness is because the test asks a CUDA stream to record an event, fails to synchronize the CPU with that stream, then checks if the event is recorded on the CPU. There is no guarantee this will have happened. This one-line change preserves the intent of the test while ensuring the GPU has recorded the event before the CPU queries it. Pull Request resolved: #26231 Differential Revision: D17382110 Pulled By: mruberry fbshipit-source-id: 35b701f87f41c24b208aafde48bf10e1a54de059
1 parent fbf991d commit 4160b8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/test_cuda.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,7 @@ def test_events_multi_gpu_query(self):
19621962
with torch.cuda.device(d0):
19631963
s0 = torch.cuda.current_stream()
19641964
e0 = s0.record_event()
1965+
s0.synchronize()
19651966

19661967
with torch.cuda.device(d1):
19671968
s1 = torch.cuda.current_stream()

0 commit comments

Comments
 (0)