From ece19bf01815796337698fab2ffb62ee4eecb1d8 Mon Sep 17 00:00:00 2001 From: Joel Schlosser Date: Mon, 10 Jul 2023 14:20:08 -0400 Subject: [PATCH] Update run_test.py to use TEST_WITH_SLOW_GRADCHECK flag (#104819) Finishes the job from #104537. See https://github.com/pytorch/pytorch/pull/104537#pullrequestreview-1520065008 Pull Request resolved: https://github.com/pytorch/pytorch/pull/104819 Approved by: https://github.com/huydhn --- test/run_test.py | 4 ++-- torch/testing/_internal/common_utils.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/run_test.py b/test/run_test.py index 5ad4f0ccc77..2000cad75b9 100755 --- a/test/run_test.py +++ b/test/run_test.py @@ -24,13 +24,13 @@ from torch.testing._internal.common_utils import ( FILE_SCHEMA, get_report_path, IS_CI, - is_slow_gradcheck_env, parser as common_parser, retry_shell, set_cwd, shell, TEST_WITH_ASAN, TEST_WITH_ROCM, + TEST_WITH_SLOW_GRADCHECK, ) from torch.utils import cpp_extension @@ -1397,7 +1397,7 @@ def get_selected_tests(options) -> List[ShardedTest]: "PyTorch is built without LAPACK support.", ) - if is_slow_gradcheck_env(): + if TEST_WITH_SLOW_GRADCHECK: selected_tests = exclude_tests( TESTS_NOT_USING_GRADCHECK, selected_tests, diff --git a/torch/testing/_internal/common_utils.py b/torch/testing/_internal/common_utils.py index f9ed3cb4309..3ba2331e7cd 100644 --- a/torch/testing/_internal/common_utils.py +++ b/torch/testing/_internal/common_utils.py @@ -4068,10 +4068,6 @@ GRADCHECK_NONDET_TOL = 1e-12 TestEnvironment.def_flag("TEST_WITH_SLOW_GRADCHECK", env_var="PYTORCH_TEST_WITH_SLOW_GRADCHECK") -# TODO: Remove once run_test.py is updated to use the flag instead. -def is_slow_gradcheck_env() -> bool: - return TEST_WITH_SLOW_GRADCHECK - skipIfSlowGradcheckEnv = unittest.skipIf( TEST_WITH_SLOW_GRADCHECK, "Tests that don't use gradcheck don't need to run on slow_gradcheck CI"