Skip to content

Commit 1256cba

Browse files
t-vifacebook-github-bot
authored andcommitted
Relax limits for gradients in test_jit's checkGraph (pytorch#14094)
Summary: - This should help TestJit.test_lstm_fusion_concat_cuda to be less flaky. (Checked on manual_seed 0..99) Fixes: pytorch#14026 - Revert the renaming of test_fused_abs that was introduced to game the order of tests to avoid the flakiness above. Pull Request resolved: pytorch#14094 Differential Revision: D13100174 Pulled By: soumith fbshipit-source-id: 91bb63b07a960a81dddfc0bf25c67696c0f6c46d
1 parent 2983998 commit 1256cba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_jit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def allSum(vs):
383383
for g2, g2_ge in zip(grads2, grads2_ge):
384384
if g2 is None and g2_ge is None:
385385
continue
386-
self.assertTrue(torch.allclose(g2, g2_ge, atol=7e-4, rtol=1e-4))
386+
self.assertTrue(torch.allclose(g2, g2_ge, atol=8e-4, rtol=8e-4))
387387

388388
return ge
389389

@@ -1478,7 +1478,7 @@ def foo(a):
14781478
def test_ge_unoptimized(self):
14791479
self.run_ge_tests(False, False)
14801480

1481-
def _test_proper_fused_abs(self, device='cpu'):
1481+
def _test_fused_abs(self, device='cpu'):
14821482

14831483
@torch.jit.script
14841484
def func(x):
@@ -1490,14 +1490,14 @@ def func(x):
14901490

14911491
@unittest.skipIf(IS_WINDOWS or IS_SANDCASTLE, "NYI: fuser support for Windows or Sandcastle")
14921492
@enable_cpu_fuser
1493-
def test_proper_fused_abs_cpu(self):
1494-
self._test_proper_fused_abs()
1493+
def test_fused_abs_cpu(self):
1494+
self._test_fused_abs()
14951495

14961496
@unittest.skipIf(IS_WINDOWS, "NYI: fuser support for Windows")
14971497
@unittest.skipIf(not RUN_CUDA, "requires CUDA")
14981498
@skipIfRocm
1499-
def test_proper_fused_abs_cuda(self):
1500-
self._test_proper_fused_abs(device="cuda")
1499+
def test_fused_abs_cuda(self):
1500+
self._test_fused_abs(device="cuda")
15011501

15021502
@unittest.skipIf(IS_WINDOWS or IS_SANDCASTLE, "NYI: fuser support for Windows or Sandcastle")
15031503
@enable_cpu_fuser

0 commit comments

Comments
 (0)