Skip to content

Commit

Permalink
Work around pytorch#47028 until a proper fix is identified.
Browse files Browse the repository at this point in the history
Otherwise, this test will appear flaky for ROCm even though it is a
generic PyTorch issue.
  • Loading branch information
jeffdaily committed Nov 23, 2020
1 parent 671ee71 commit dae6996
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -1779,8 +1779,11 @@ def test_streaming_backward_sync_graph_root(self):
# bwd ops don't sync with bwd_ambient_stream before consuming grad.
torch.autograd.backward(tensors=c, grad_tensors=grad)

# See https://github.com/pytorch/pytorch/issues/47028
# assertEquals below run on bwd_ambient_stream, so this test may also fail
# if backward() fails to sync with bwd_ambient_stream at the end.
# Synchronizing here works around the issue until a proper fix can be made.
torch.cuda.synchronize()
with torch.no_grad():
self.assertEqual(a.grad, grad * b)
self.assertEqual(b.grad, grad * a)
Expand Down

0 comments on commit dae6996

Please sign in to comment.