diff --git a/.github/scripts/tests_to_skip.txt b/.github/scripts/tests_to_skip.txt new file mode 100644 index 000000000..7c0e95f00 --- /dev/null +++ b/.github/scripts/tests_to_skip.txt @@ -0,0 +1 @@ +_disabled_in_oss_compatibility diff --git a/.github/workflows/unittest_ci_cpu.yml b/.github/workflows/unittest_ci_cpu.yml index df8c74ecc..0c53bbe7d 100644 --- a/.github/workflows/unittest_ci_cpu.yml +++ b/.github/workflows/unittest_ci_cpu.yml @@ -72,6 +72,14 @@ jobs: python -c "import numpy" echo "numpy succeeded" conda install -n build_binary -y pytest + # Read the list of tests to skip from a file, ignoring empty lines and comments + skip_expression=$(awk '!/^($|#)/ {printf " and not %s", $0}' ./.github/scripts/tests_to_skip.txt) + # Check if skip_expression is effectively empty + if [ -z "$skip_expression" ]; then + skip_expression="" + else + skip_expression=${skip_expression:5} # Remove the leading " and " + fi conda run -n build_binary \ python -m pytest torchrec -v -s -W ignore::pytest.PytestCollectionWarning --continue-on-collection-errors \ - --ignore-glob=**/test_utils/ + --ignore-glob=**/test_utils/ -k "$skip_expression" diff --git a/torchrec/ir/tests/test_serializer.py b/torchrec/ir/tests/test_serializer.py index 90bde12ca..a997a288d 100644 --- a/torchrec/ir/tests/test_serializer.py +++ b/torchrec/ir/tests/test_serializer.py @@ -253,13 +253,7 @@ def test_serialize_deserialize_ebc(self) -> None: self.assertEqual(deserialized.shape, orginal.shape) self.assertTrue(torch.allclose(deserialized, orginal)) - # pyre-ignore[56]: Pyre was not able to infer the type of argument - @unittest.skipIf( - torch.cuda.device_count() == 0, - "skip this test in OSS (no GPU available) because torch.export uses training ir in OSS", - ) - def test_dynamic_shape_ebc(self) -> None: - # TODO: https://fb.workplace.com/groups/1028545332188949/permalink/1138699244506890/ + def test_dynamic_shape_ebc_disabled_in_oss_compatibility(self) -> None: model = self.generate_model() feature1 = KeyedJaggedTensor.from_offsets_sync( keys=["f1", "f2", "f3"], diff --git a/torchrec/models/experimental/test_transformerdlrm.py b/torchrec/models/experimental/test_transformerdlrm.py index 15bd38e02..07f49ecf2 100644 --- a/torchrec/models/experimental/test_transformerdlrm.py +++ b/torchrec/models/experimental/test_transformerdlrm.py @@ -61,12 +61,7 @@ def test_larger(self) -> None: concat_dense = inter_arch(dense_features, sparse_features) self.assertEqual(concat_dense.size(), (B, D * (F + 1))) - # pyre-ignore[56]: Pyre was not able to infer the type of argument - @unittest.skipIf( - torch.cuda.device_count() == 0, - "skip this test in OSS (no GPU available) because seed might be different in OSS", - ) - def test_correctness(self) -> None: + def test_correctness_disabled_in_oss_compatibility(self) -> None: D = 4 B = 3 # multi-head attentions @@ -170,12 +165,7 @@ def test_correctness(self) -> None: ) ) - # pyre-ignore[56]: Pyre was not able to infer the type of argument - @unittest.skipIf( - torch.cuda.device_count() == 0, - "skip this test in OSS (no GPU available) because seed might be different in OSS", - ) - def test_numerical_stability(self) -> None: + def test_numerical_stability_disabled_in_oss_compatibility(self) -> None: D = 4 B = 3 # multi-head attentions @@ -204,12 +194,7 @@ def test_numerical_stability(self) -> None: class DLRMTransformerTest(unittest.TestCase): - # pyre-ignore[56]: Pyre was not able to infer the type of argument - @unittest.skipIf( - torch.cuda.device_count() == 0, - "skip this test in OSS (no GPU available) because seed might be different in OSS", - ) - def test_basic(self) -> None: + def test_basic_disabled_in_oss_compatibility(self) -> None: torch.manual_seed(0) B = 2 D = 8