@@ -14070,7 +14070,10 @@ def _test(t, weight, mode):
14070
14070
if mode == 'same':
14071
14071
actual = actual[:5, :5, :10]
14072
14072
14073
- self.assertEqual(actual, expected, rtol=2e-5, atol=5e-6)
14073
+ if tf32_is_not_fp32() and (dtype == torch.float or dtype == torch.complex64):
14074
+ self.assertEqual(actual, expected, atol=0.05, rtol=0.05)
14075
+ else:
14076
+ self.assertEqual(actual, expected, rtol=2e-5, atol=5e-6)
14074
14077
14075
14078
# Global dtype for this test suite is torch.double
14076
14079
# This leads to change in type-promotion
@@ -19505,7 +19508,10 @@ def test_cudnn_convolution_relu(self, device, dtype):
19505
19508
w = w.to(memory_format=memory_format)
19506
19509
cudnn_out = torch.cudnn_convolution_relu(inp, w, None, (1, 1), (0, 0), (1, 1), 1)
19507
19510
self.assertTrue(cudnn_out.is_contiguous(memory_format=memory_format))
19508
- self.assertEqual(conv2d_out.relu(), cudnn_out)
19511
+ if tf32_is_not_fp32() and dtype == torch.float:
19512
+ self.assertEqual(conv2d_out.relu(), cudnn_out, atol=2e-4, rtol=0.006)
19513
+ else:
19514
+ self.assertEqual(conv2d_out.relu(), cudnn_out)
19509
19515
19510
19516
@onlyCUDA
19511
19517
@skipCUDAIfRocm
@@ -19533,7 +19539,10 @@ def test_cudnn_convolution_add_relu(self, device, dtype):
19533
19539
cudnn_out = torch.cudnn_convolution_add_relu(inp, w, z, alpha, None, (1, 1), (0, 0), (1, 1), 1)
19534
19540
19535
19541
self.assertTrue(cudnn_out.is_contiguous(memory_format=memory_format))
19536
- self.assertEqual(F.relu(conv2d_out + alpha * z), cudnn_out)
19542
+ if tf32_is_not_fp32() and dtype == torch.float:
19543
+ self.assertEqual(F.relu(conv2d_out + alpha * z), cudnn_out, atol=3e-4, rtol=0.006)
19544
+ else:
19545
+ self.assertEqual(F.relu(conv2d_out + alpha * z), cudnn_out)
19537
19546
19538
19547
@onlyCUDA
19539
19548
@skipCUDAIfRocm
0 commit comments