diff --git a/test/test_testing.py b/test/test_testing.py index 2cba4d060382533..f157c6641a664a5 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -1783,9 +1783,11 @@ def test_circular_dependencies(self) -> None: if not sys.version_info >= (3, 9): ignored_modules.append("torch.utils.benchmark") if IS_WINDOWS or IS_MACOS: - # Distributed should be importable on Windows but not on Mac + # Distributed should be importable on Windows(except nn.api.), but not on Mac if IS_MACOS: ignored_modules.append("torch.distributed.") + else: + ignored_modules.append("torch.distributed.nn.api.") ignored_modules.append("torch.testing._internal.dist_utils") # And these both end up with transitive dependencies on distributed ignored_modules.append("torch.nn.parallel._replicated_tensor_ddp_interop")