mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Nccl update to 2.25.1 for cuda 12.4-12.8 (#146073)"
This reverts commit 06f4a5c0e578d7da10ebdf14edcd24e5dcef78d6. Reverted https://github.com/pytorch/pytorch/pull/146073 on behalf of https://github.com/atalman due to breaks macos builds: ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package ([comment](https://github.com/pytorch/pytorch/pull/146073#issuecomment-2659802389))
This commit is contained in:
32
setup.py
32
setup.py
@ -401,28 +401,6 @@ def get_submodule_folders():
|
||||
]
|
||||
|
||||
|
||||
def read_nccl_pin() -> str:
|
||||
nccl_file = "nccl-cu12.txt"
|
||||
if os.getenv("DESIRED_CUDA", "").startswith("11") or os.getenv(
|
||||
"CUDA_VERSION", ""
|
||||
).startswith("11"):
|
||||
nccl_file = "nccl-cu11.txt"
|
||||
nccl_pin_path = os.path.join(cwd, ".ci", "docker", "ci_commit_pins", nccl_file)
|
||||
with open(nccl_pin_path) as f:
|
||||
return f.read().strip()
|
||||
|
||||
|
||||
def checkout_nccl():
|
||||
release_tag = read_nccl_pin()
|
||||
report(f"-- Checkout nccl release tag: {release_tag}")
|
||||
nccl_basedir = os.path.join(third_party_path, "nccl")
|
||||
subprocess.check_call(
|
||||
["git", "clone", "https://github.com/NVIDIA/nccl.git", "nccl"],
|
||||
cwd=third_party_path,
|
||||
)
|
||||
subprocess.check_call(["git", "checkout", release_tag], cwd=nccl_basedir)
|
||||
|
||||
|
||||
def check_submodules():
|
||||
def check_for_files(folder, files):
|
||||
if not any(os.path.exists(os.path.join(folder, f)) for f in files):
|
||||
@ -441,16 +419,16 @@ def check_submodules():
|
||||
# If none of the submodule folders exists, try to initialize them
|
||||
if all(not_exists_or_empty(folder) for folder in folders):
|
||||
try:
|
||||
report(" --- Trying to initialize submodules")
|
||||
print(" --- Trying to initialize submodules")
|
||||
start = time.time()
|
||||
subprocess.check_call(
|
||||
["git", "submodule", "update", "--init", "--recursive"], cwd=cwd
|
||||
)
|
||||
end = time.time()
|
||||
report(f" --- Submodule initialization took {end - start:.2f} sec")
|
||||
print(f" --- Submodule initialization took {end - start:.2f} sec")
|
||||
except Exception:
|
||||
report(" --- Submodule initalization failed")
|
||||
report("Please run:\n\tgit submodule update --init --recursive")
|
||||
print(" --- Submodule initalization failed")
|
||||
print("Please run:\n\tgit submodule update --init --recursive")
|
||||
sys.exit(1)
|
||||
for folder in folders:
|
||||
check_for_files(
|
||||
@ -506,7 +484,7 @@ def mirror_files_into_torchgen():
|
||||
# all the work we need to do _before_ setup runs
|
||||
def build_deps():
|
||||
report("-- Building version " + version)
|
||||
checkout_nccl()
|
||||
|
||||
check_submodules()
|
||||
check_pydep("yaml", "pyyaml")
|
||||
build_python = not BUILD_LIBTORCH_WHL
|
||||
|
Reference in New Issue
Block a user