Skip distributed tests if built with USE_DISTRIBUTED=0 (#70677)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/70676

Pull Request resolved: https://github.com/pytorch/pytorch/pull/70677

Reviewed By: albanD

Differential Revision: D33439808

Pulled By: janeyx99

fbshipit-source-id: 7f9971eb564dbbb6625fe5f78328c3abe3808719
This commit is contained in:
Ilya Persky 2022-01-06 08:53:50 -08:00 committed by Facebook GitHub Bot
parent ff408fca7f
commit bc514cb425

View file

@ -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