Skip to content

Commit

Permalink
Revert "[Export] Support retraceability test on existing cases (pytor…
Browse files Browse the repository at this point in the history
…ch#115402)"

This reverts commit b0c7dd4.

Reverted pytorch#115402 on behalf of https://github.com/atalman due to OSSCI oncall, broke CI tests ([comment](pytorch#115402 (comment)))
  • Loading branch information
pytorchmergebot committed Dec 13, 2023
1 parent 3b87681 commit bda6f02
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 66 deletions.
13 changes: 0 additions & 13 deletions test/export/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def f(x, y):
inp = ([torch.ones(1, 3)], torch.ones(1, 3))
self._test_export_same_as_eager(f, inp)

@testing.expectedFailureRetraceability
def test_external_call_non_strict_real_tensor(self):
class ExternalMethod:
def add(self, x):
Expand All @@ -150,7 +149,6 @@ def forward(self, x):
ep = export(f, args, strict=False)
self.assertEqual(ep(*args), f(*args))

@testing.expectedFailureRetraceability
def test_basic_non_strict_real_tensor(self):
class Basic(torch.nn.Module):
def __init__(self):
Expand All @@ -165,7 +163,6 @@ def forward(self, x, y):
ep = export(f, args, strict=False)
self.assertEqual(ep(*args), f(*args))

@testing.expectedFailureRetraceability
def test_basic_non_strict_fake_tensor(self):
class Basic(torch.nn.Module):
def __init__(self):
Expand Down Expand Up @@ -270,7 +267,6 @@ def g(x):
with self.assertRaisesRegex(torchdynamo.exc.UserError, "Expected tensor as input to dynamic_dim"):
constraints = [dynamic_dim(inp_for_g, 0)]

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_map(self):
def list_tensor_map(xs, y, z):
Expand All @@ -282,7 +278,6 @@ def body(x, y, z):
inps = (torch.ones(6, 4), torch.tensor(5), torch.tensor(4))
self._test_export_same_as_eager(list_tensor_map, inps)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_kwargs(self):
def kw_func(arg1, arg2, kw1, kw2):
Expand All @@ -292,7 +287,6 @@ def kw_func(arg1, arg2, kw1, kw2):
kwargs = {"kw1": torch.ones(1, 1), "kw2": torch.ones(6, 4)}
self._test_export_same_as_eager(kw_func, args, kwargs)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_pytree_kwargs(self):
def kw_func(arg1, arg2, a, b):
Expand All @@ -302,7 +296,6 @@ def kw_func(arg1, arg2, a, b):
kwargs = {"a": {"kw1": torch.ones(2, 3), "kw2": torch.ones(3, 4)}, "b": [torch.ones(2, 3), torch.ones(3, 4)]}
self._test_export_same_as_eager(kw_func, args, kwargs)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_default_kwargs(self):
def kw_func(arg1, arg2, a, b=1):
Expand All @@ -328,7 +321,6 @@ def kw_func(arg1, arg2, *args):
args = (torch.ones(2, 3), torch.ones(3, 4), torch.ones(2, 3), torch.ones(3, 4))
self._test_export_same_as_eager(kw_func, args)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_keyword_only_args(self):
def kw_func(arg1, arg2, *args, kw1, kw2):
Expand All @@ -338,7 +330,6 @@ def kw_func(arg1, arg2, *args, kw1, kw2):
kwargs = {"kw1": torch.ones(2, 3), "kw2": torch.ones(3, 4)}
self._test_export_same_as_eager(kw_func, args, kwargs)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_var_keyword_args(self):
def kw_func(arg1, arg2, *args, kw1, kw2, **kwargs):
Expand All @@ -348,7 +339,6 @@ def kw_func(arg1, arg2, *args, kw1, kw2, **kwargs):
kwargs = {"kw1": torch.ones(2, 3), "kw2": torch.ones(3, 4), "kw3": torch.ones(2, 3), "kw4": torch.ones(3, 4)}
self._test_export_same_as_eager(kw_func, args, kwargs)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_func_with_var_keyword_pytree_args(self):
def kw_func(arg1, arg2, *args, kw1, kw2, **kwargs):
Expand Down Expand Up @@ -1421,7 +1411,6 @@ def forward(self, x):
exp_source_fns = [["cond", "cos"], ["cond", "sin"]]
self.assertEqual(actual_source_fns, exp_source_fns)

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_lifted_constants(self) -> None:
def f(x):
Expand Down Expand Up @@ -1546,7 +1535,6 @@ def forward(self, x):
self.assertTrue(torch.allclose(core_aten_ep(*inp), m(*inp)))
self.assertEqual(id(state_dict), id(ep.state_dict))

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_export_decomps_dynamic(self):
class M(torch.nn.Module):
Expand Down Expand Up @@ -1583,7 +1571,6 @@ def f(x):
inp = torch.randn(2)
self.assertTrue(torch.allclose(ep(inp), torch.nonzero(inp)))

@testing.expectedFailureRetraceability
@testing.expectedFailureNonStrict
def test_redundant_asserts(self):
def f(x):
Expand Down
47 changes: 0 additions & 47 deletions test/export/test_retraceability.py

This file was deleted.

6 changes: 0 additions & 6 deletions test/export/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,3 @@ def _fn(*args, **kwargs):
def expectedFailureNonStrict(fn):
fn._expected_failure_non_strict = True
return fn


# Controls tests generated in test/export/test_retraceability.py
def expectedFailureRetraceability(fn):
fn._expected_failure_retrace = True
return fn

0 comments on commit bda6f02

Please sign in to comment.