From 8281f40a5d9c0ef59c2c6f33df9ec6722d1451d3 Mon Sep 17 00:00:00 2001 From: Jack Taylor Date: Tue, 2 Jun 2026 04:40:58 -0500 Subject: [PATCH 1/2] Pin Triton to ROCm internal 3.7 branch Update the Triton pin to the tip of ROCm release/internal/3.7.x and route non-XPU Triton builds through the ROCm fork. Co-authored-by: Cursor --- .ci/docker/ci_commit_pins/triton.txt | 2 +- .ci/docker/common/install_triton.sh | 2 +- .github/scripts/build_triton_wheel.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.ci/docker/ci_commit_pins/triton.txt b/.ci/docker/ci_commit_pins/triton.txt index ab27e757c6e57..9c78a57cca3ad 100644 --- a/.ci/docker/ci_commit_pins/triton.txt +++ b/.ci/docker/ci_commit_pins/triton.txt @@ -1 +1 @@ -b4e20bbe55617cc798b986c2555a2bc7b303c737 +9c610c781cb810a11bfcc9accba094550b189a5e diff --git a/.ci/docker/common/install_triton.sh b/.ci/docker/common/install_triton.sh index 1b68e3c247839..b2fdebdcc4747 100755 --- a/.ci/docker/common/install_triton.sh +++ b/.ci/docker/common/install_triton.sh @@ -21,7 +21,7 @@ elif [ -n "${TRITON_CPU}" ]; then TRITON_REPO="https://github.com/triton-lang/triton-cpu" TRITON_TEXT_FILE="triton-cpu" else - TRITON_REPO="https://github.com/triton-lang/triton" + TRITON_REPO="https://github.com/ROCm/triton" TRITON_TEXT_FILE="triton" fi diff --git a/.github/scripts/build_triton_wheel.py b/.github/scripts/build_triton_wheel.py index de0fa7739edc5..938123bfefded 100644 --- a/.github/scripts/build_triton_wheel.py +++ b/.github/scripts/build_triton_wheel.py @@ -70,7 +70,7 @@ def build_triton( triton_basedir = Path(tmpdir) / "triton" triton_pythondir = triton_basedir / "python" - triton_repo = "https://github.com/openai/triton" + triton_repo = "https://github.com/ROCm/triton" if device == "rocm": triton_pkg_name = "triton-rocm" elif device == "xpu": @@ -89,7 +89,8 @@ def build_triton( ) else: check_call( - ["git", "checkout", f"release/{ver}.{rev}.x"], cwd=triton_basedir + ["git", "checkout", f"release/internal/{ver}.{rev}.x"], + cwd=triton_basedir, ) else: check_call(["git", "fetch", "origin", commit_hash], cwd=triton_basedir) From 123256577417ef6c232f5abb0cc534cd2dea21ab Mon Sep 17 00:00:00 2001 From: Jack Taylor Date: Tue, 2 Jun 2026 04:41:37 -0500 Subject: [PATCH 2/2] Build Triton from internal branch in CI Use release/internal/3.7.x for non-XPU Triton source builds in Docker and wheel CI instead of checking out the triton.txt commit. Co-authored-by: Cursor --- .ci/docker/common/install_triton.sh | 8 ++++++-- .github/scripts/build_triton_wheel.py | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.ci/docker/common/install_triton.sh b/.ci/docker/common/install_triton.sh index b2fdebdcc4747..c68bef68b473c 100755 --- a/.ci/docker/common/install_triton.sh +++ b/.ci/docker/common/install_triton.sh @@ -26,7 +26,11 @@ else fi # The logic here is copied from .ci/pytorch/common_utils.sh -TRITON_PINNED_COMMIT=$(get_pinned_commit ${TRITON_TEXT_FILE}) +if [ "${TRITON_TEXT_FILE}" = "triton" ]; then + TRITON_REF="release/internal/3.7.x" +else + TRITON_REF=$(get_pinned_commit ${TRITON_TEXT_FILE}) +fi if [ -n "${UBUNTU_VERSION}" ];then apt update @@ -49,7 +53,7 @@ pushd /var/lib/jenkins/ as_jenkins git clone --recursive ${TRITON_REPO} triton cd triton -as_jenkins git checkout ${TRITON_PINNED_COMMIT} +as_jenkins git checkout ${TRITON_REF} as_jenkins git submodule update --init --recursive # Old versions of python have setup.py in ./python; newer versions have it in ./ diff --git a/.github/scripts/build_triton_wheel.py b/.github/scripts/build_triton_wheel.py index 938123bfefded..59f17b28bde38 100644 --- a/.github/scripts/build_triton_wheel.py +++ b/.github/scripts/build_triton_wheel.py @@ -79,22 +79,22 @@ def build_triton( else: triton_pkg_name = "triton" check_call(["git", "clone", triton_repo, "triton"], cwd=tmpdir) - if release: + if device == "xpu" and release: ver, rev, patch = version.split(".") - if device == "xpu": - # XPU uses the patch version in the release branch name - check_call( - ["git", "checkout", f"release/{ver}.{rev}.{patch}"], - cwd=triton_basedir, - ) - else: - check_call( - ["git", "checkout", f"release/internal/{ver}.{rev}.x"], - cwd=triton_basedir, - ) - else: + # XPU uses the patch version in the release branch name + check_call( + ["git", "checkout", f"release/{ver}.{rev}.{patch}"], + cwd=triton_basedir, + ) + elif device == "xpu": check_call(["git", "fetch", "origin", commit_hash], cwd=triton_basedir) check_call(["git", "checkout", commit_hash], cwd=triton_basedir) + else: + ver, rev, _patch = version.split(".") + check_call( + ["git", "checkout", f"release/internal/{ver}.{rev}.x"], + cwd=triton_basedir, + ) # change built wheel name and version env["TRITON_WHEEL_NAME"] = triton_pkg_name