diff --git a/test/run_test.py b/test/run_test.py index 15fb6c81da1..d8a0ef417f0 100644 --- a/test/run_test.py +++ b/test/run_test.py @@ -940,7 +940,7 @@ def get_selected_tests(options): WINDOWS_BLOCKLIST.append("jit") WINDOWS_BLOCKLIST.append("jit_fuser") - # This is exception thats caused by this issue https://github.com/pytorch/pytorch/issues/69460 + # This is exception that's caused by this issue https://github.com/pytorch/pytorch/issues/69460 # This below code should be removed once this issue is solved if torch.version.cuda is not None and LooseVersion(torch.version.cuda) >= "11.5": WINDOWS_BLOCKLIST.append("test_cpp_extensions_aot") @@ -969,6 +969,11 @@ def get_selected_tests(options): which_shard, num_shards, selected_tests, TEST_TIMES_FILE ) + # skip all distributed tests if distributed package is not available. + if not dist.is_available(): + selected_tests = exclude_tests(DISTRIBUTED_TESTS, selected_tests, + "PyTorch is built without distributed support.") + return selected_tests