diff --git a/.gitmodules b/.gitmodules index 6549293389..560ee54cd4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = third_party/ascend/AscendNPU-IR url = https://gitcode.com/Ascend/AscendNPU-IR.git depth = 1 +[submodule "third_party/ascend/Triton-distributed-ascend"] + path = third_party/ascend/Triton-distributed-ascend + url = https://gitcode.com/Ascend/Triton-distributed-ascend.git diff --git a/python/setup.py b/python/setup.py index 04a149c60d..1020740e1b 100644 --- a/python/setup.py +++ b/python/setup.py @@ -566,7 +566,7 @@ def build_extension(self, ext): else: cmake_args += ["-DTRITON_BUILD_PROTON=OFF"] - if check_env_flag("TRITON_BUILD_DISTRIBUTED", "OFF"): + if check_env_flag("TRITON_BUILD_DISTRIBUTED", "ON"): cmake_args += ["-DTRITON_BUILD_DISTRIBUTED=ON"] else: cmake_args += ["-DTRITON_BUILD_DISTRIBUTED=OFF"] @@ -609,28 +609,14 @@ def is_git_repo(): def ensure_distributed_submodule(): - if not check_env_flag("TRITON_BUILD_DISTRIBUTED", "OFF"): + if not check_env_flag("TRITON_BUILD_DISTRIBUTED", "ON"): return distributed_dir = Path(triton_dir) / "third_party" / "ascend" / "Triton-distributed-ascend" - if not distributed_dir.is_dir(): + if not (distributed_dir / "CMakeLists.txt").is_file() and is_git_repo(): subprocess.check_call([ - "git", - "clone", - "https://gitcode.com/Ascend/Triton-distributed-ascend.git", - "-b", - "release/3.2.2", - ], cwd=Path(triton_dir) / "third_party" / "ascend") - if is_git_repo(): - subprocess.check_call([ - "git", - "checkout", - "release/3.2.2", - ], cwd=distributed_dir) - subprocess.check_call([ - "git", - "pull", - "origin", - ], cwd=distributed_dir) + "git", "submodule", "update", "--init", "--", + "third_party/ascend/Triton-distributed-ascend" + ], cwd=triton_dir) if not (distributed_dir / "CMakeLists.txt").is_file(): raise RuntimeError(f"Triton-Distributed submodule is not initialized: {distributed_dir}") @@ -749,7 +735,7 @@ def add_links(): add_link_to_backends() if check_env_flag("TRITON_BUILD_PROTON", "ON"): # Default ON add_link_to_proton() - if check_env_flag("TRITON_BUILD_DISTRIBUTED", "OFF"): + if check_env_flag("TRITON_BUILD_DISTRIBUTED", "ON"): add_link_to_distributed() @@ -855,7 +841,7 @@ def get_packages(): packages += get_language_extra_packages() if check_env_flag("TRITON_BUILD_PROTON", "ON"): # Default ON packages += ["triton/profiler"] - if check_env_flag("TRITON_BUILD_DISTRIBUTED", "OFF"): + if check_env_flag("TRITON_BUILD_DISTRIBUTED", "ON"): distributed_root = os.path.join(os.pardir, "third_party", "ascend", "Triton-distributed-ascend", "python") distributed_pkg_root = os.path.join(distributed_root, "triton_dist") if os.path.isdir(distributed_pkg_root): diff --git a/third_party/ascend/Triton-distributed-ascend b/third_party/ascend/Triton-distributed-ascend new file mode 160000 index 0000000000..24036fa622 --- /dev/null +++ b/third_party/ascend/Triton-distributed-ascend @@ -0,0 +1 @@ +Subproject commit 24036fa622d8291f657133e3d8db75a7ec6796c2