Revert "Make distributed modules importable even when backend not built (#159889)" (#162568)

This reverts commit a0d026688cd69583d5a4e0c6f3e5fda141a7f4a9.

Revert "Always build USE_DISTRIBUTED. (#160449)"

This reverts commit d80297a6846f1f2c36fd4f19e22919f2abe8fcea.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/162568
Approved by: https://github.com/huydhn
This commit is contained in:
Edward Yang
2025-09-10 00:24:16 -04:00
committed by PyTorch MergeBot
parent 11acfed3ce
commit dda071587f
50 changed files with 436 additions and 759 deletions

View File

@ -88,7 +88,8 @@ def build_pytorch(
) -> None:
my_env = _create_build_env()
if (
not check_negative_env_flag("USE_CUDA")
not check_negative_env_flag("USE_DISTRIBUTED")
and not check_negative_env_flag("USE_CUDA")
and not check_negative_env_flag("USE_NCCL")
and not check_env_flag("USE_SYSTEM_NCCL")
):