From 85262b0a9e88d56f11deea44f05f25c9f4b8eb30 Mon Sep 17 00:00:00 2001 From: rzou Date: Thu, 14 Dec 2023 11:00:12 -0800 Subject: [PATCH] markDynamoStrictTest some test_cpp_extensions.* (#115858) Pull Request resolved: https://github.com/pytorch/pytorch/pull/115858 Approved by: https://github.com/voznesenskym ghstack dependencies: #115845, #115855, #115856, #115857 --- test/test_cpp_api_parity.py | 2 ++ test/test_cpp_extensions_aot.py | 5 +++++ test/test_cpp_extensions_jit.py | 1 + test/test_cpp_extensions_open_device_registration.py | 1 + torch/testing/_internal/dynamo_test_failures.py | 7 ++++++- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/test_cpp_api_parity.py b/test/test_cpp_api_parity.py index f14a0973e03a..9f33a5107897 100644 --- a/test/test_cpp_api_parity.py +++ b/test/test_cpp_api_parity.py @@ -3,6 +3,7 @@ import os +import torch import torch.testing._internal.common_utils as common import torch.testing._internal.common_nn as common_nn from cpp_api_parity.parity_table_parser import parse_parity_tracker_table @@ -18,6 +19,7 @@ PARITY_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'cpp_api_parity', 'p parity_table = parse_parity_tracker_table(PARITY_TABLE_PATH) +@torch.testing._internal.common_utils.markDynamoStrictTest class TestCppApiParity(common.TestCase): module_test_params_map = {} functional_test_params_map = {} diff --git a/test/test_cpp_extensions_aot.py b/test/test_cpp_extensions_aot.py index 75b768d0c231..2d278aa69e95 100644 --- a/test/test_cpp_extensions_aot.py +++ b/test/test_cpp_extensions_aot.py @@ -37,6 +37,7 @@ except ImportError as e: ) from e +@torch.testing._internal.common_utils.markDynamoStrictTest class TestCppExtensionAOT(common.TestCase): """Tests ahead-of-time cpp extensions @@ -150,6 +151,7 @@ class TestCppExtensionAOT(common.TestCase): self.assertEqual(test, ref) +@torch.testing._internal.common_utils.markDynamoStrictTest class TestPybindTypeCasters(common.TestCase): """Pybind tests for ahead-of-time cpp extensions @@ -243,6 +245,7 @@ class TestPybindTypeCasters(common.TestCase): self.check_union(funcs) +@torch.testing._internal.common_utils.markDynamoStrictTest class TestORTTensor(common.TestCase): def test_unregistered(self): a = torch.arange(0, 10, device='cpu') @@ -294,6 +297,7 @@ class TestORTTensor(common.TestCase): self.assertEqual(grad[0].shape, input.shape) +@torch.testing._internal.common_utils.markDynamoStrictTest class TestRNGExtension(common.TestCase): def setUp(self): @@ -330,6 +334,7 @@ class TestRNGExtension(common.TestCase): self.assertEqual(rng_extension.getInstanceCount(), 0) +@torch.testing._internal.common_utils.markDynamoStrictTest @unittest.skipIf(not TEST_CUDA, "CUDA not found") class TestTorchLibrary(common.TestCase): diff --git a/test/test_cpp_extensions_jit.py b/test/test_cpp_extensions_jit.py index a634319fcfe9..3790e7091652 100644 --- a/test/test_cpp_extensions_jit.py +++ b/test/test_cpp_extensions_jit.py @@ -40,6 +40,7 @@ def remove_build_path(): # There's only one test that runs gracheck, run slow mode manually +@torch.testing._internal.common_utils.markDynamoStrictTest class TestCppExtensionJIT(common.TestCase): """Tests just-in-time cpp extensions. Don't confuse this with the PyTorch JIT (aka TorchScript). diff --git a/test/test_cpp_extensions_open_device_registration.py b/test/test_cpp_extensions_open_device_registration.py index 5fdd670454d1..6e264b760bae 100644 --- a/test/test_cpp_extensions_open_device_registration.py +++ b/test/test_cpp_extensions_open_device_registration.py @@ -51,6 +51,7 @@ class DummyModule: return 0 @unittest.skipIf(IS_ARM64, "Does not work on arm") +@torch.testing._internal.common_utils.markDynamoStrictTest class TestCppExtensionOpenRgistration(common.TestCase): """Tests Open Device Registration with C++ extensions. """ diff --git a/torch/testing/_internal/dynamo_test_failures.py b/torch/testing/_internal/dynamo_test_failures.py index 777c00b68cd9..006a87453027 100644 --- a/torch/testing/_internal/dynamo_test_failures.py +++ b/torch/testing/_internal/dynamo_test_failures.py @@ -2,4 +2,9 @@ # when run under PYTORCH_TEST_WITH_DYNAMO=1. # # This lists exists so we can more easily add large numbers of failing tests, -dynamo_expected_failures = {} +dynamo_expected_failures = { + "TestCppExtensionJIT.test_cpp_frontend_module_has_up_to_date_attribute", + "TestCppExtensionJIT.test_custom_compound_op_autograd", + "TestCppExtensionJIT.test_cpp_frontend_module_has_up_to_date_attributes", + "TestCppExtensionOpenRgistration.test_open_device_registration", +}