|
18 | 18 |
|
19 | 19 | from torch.testing import make_tensor
|
20 | 20 | from torch.testing._internal.common_utils import \
|
21 |
| - (IS_FBCODE, IS_SANDCASTLE, IS_WINDOWS, TestCase, run_tests, skipIfRocm, slowTest, |
| 21 | + (IS_FBCODE, IS_MACOS, IS_SANDCASTLE, IS_WINDOWS, TestCase, run_tests, skipIfRocm, slowTest, |
22 | 22 | parametrize, subtest, instantiate_parametrized_tests, dtype_name, TEST_WITH_ROCM)
|
23 | 23 | from torch.testing._internal.common_device_type import \
|
24 | 24 | (PYTORCH_TESTING_DEVICE_EXCEPT_FOR_KEY, PYTORCH_TESTING_DEVICE_ONLY_FOR_KEY, dtypes,
|
@@ -1782,9 +1782,15 @@ def test_circular_dependencies(self) -> None:
|
1782 | 1782 | # See https://github.com/pytorch/pytorch/issues/77801
|
1783 | 1783 | if not sys.version_info >= (3, 9):
|
1784 | 1784 | ignored_modules.append("torch.utils.benchmark")
|
1785 |
| - if IS_WINDOWS: |
1786 |
| - # Distributed does not work on Windows |
1787 |
| - ignored_modules.append("torch.distributed.") |
| 1785 | + if IS_WINDOWS or IS_MACOS: |
| 1786 | + # Distributed should be importable on Windows(except nn.api.), but not on Mac |
| 1787 | + if IS_MACOS: |
| 1788 | + ignored_modules.append("torch.distributed.") |
| 1789 | + else: |
| 1790 | + ignored_modules.append("torch.distributed.nn.api.") |
| 1791 | + ignored_modules.append("torch.distributed.optim.") |
| 1792 | + ignored_modules.append("torch.distributed.pipeline.") |
| 1793 | + ignored_modules.append("torch.distributed.rpc.") |
1788 | 1794 | ignored_modules.append("torch.testing._internal.dist_utils")
|
1789 | 1795 |
|
1790 | 1796 | torch_dir = os.path.dirname(torch.__file__)
|
|
0 commit comments