From c767a8961b4e714afbb2981a01fb3682997a7b3c Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 08:25:22 -0700 Subject: [PATCH 01/10] remove pytorch-triton-rocm --- manywheel/build_rocm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index 13de66170..963ed026a 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -359,9 +359,9 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="triton==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" else - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | triton==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" fi fi fi From 3aab5faf7a988fa641ec31de66ced767a2ca85ee Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 12:03:13 -0700 Subject: [PATCH 02/10] Change logic --- manywheel/build_rocm.sh | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index 963ed026a..e0e372b03 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -348,25 +348,37 @@ ver() { # Assuming PYTORCH_VERSION=x.y.z, if x >= 2 if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then if [[ $(uname) == "Linux" ]] && [[ "$DESIRED_PYTHON" != "3.12" || $(ver $PYTORCH_VERSION) -ge $(ver 2.4) ]]; then - # Triton commit got unified in PyTorch 2.5 - if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then - TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt) - else - TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt) - fi - TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt) - # Only linux Python < 3.13 are supported wheels for triton - TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" + # Triton commit got unified in PyTorch 2.5 + if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then + TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt") + else + TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt") + fi + TRITON_VERSION=$(cat "$PYTORCH_ROOT/.ci/docker/triton_version.txt") + + # Only linux Python < 3.13 are supported wheels for triton + TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" + + # Use "triton" for dev builds, else "pytorch-triton-rocm" + if [[ "$PYTORCH_VERSION" == *".dev0a0"* ]]; then + PKG="triton" + else + PKG="pytorch-triton-rocm" + fi + + REQ="${PKG}==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="triton==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${REQ}" else - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | triton==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${REQ}" fi + unset PKG REQ fi fi + echo "PYTORCH_ROCM_ARCH: ${PYTORCH_ROCM_ARCH}" export LIGHTWEIGHT_WHEELNAME_MARKER="${LIGHTWEIGHT_WHEELNAME_MARKER}" From 9d7154cc3c0e8fcc3cd7acee70accd9198c141a5 Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 12:04:04 -0700 Subject: [PATCH 03/10] Update build_rocm.sh --- manywheel/build_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index e0e372b03..5b4e626c7 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -354,7 +354,7 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then else TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt") fi - TRITON_VERSION=$(cat "$PYTORCH_ROOT/.ci/docker/triton_version.txt") + TRITON_VERSION=$(cat "$PYTORCH_ROOT/.ci/docker/triton_version.txt") # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" From bd8c55759ba7e3b9a27cd34a7a128ae7448b2766 Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 12:04:37 -0700 Subject: [PATCH 04/10] Update build_rocm.sh --- manywheel/build_rocm.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index 5b4e626c7..de58d8352 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -355,20 +355,18 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt") fi TRITON_VERSION=$(cat "$PYTORCH_ROOT/.ci/docker/triton_version.txt") - # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" - # Use "triton" for dev builds, else "pytorch-triton-rocm" if [[ "$PYTORCH_VERSION" == *".dev0a0"* ]]; then PKG="triton" else PKG="pytorch-triton-rocm" fi - - REQ="${PKG}==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" - - if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then + + REQ="${PKG}==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" + + if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${REQ}" else export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${REQ}" From b3e9c5bce3cb69923f1e9391369258bffef6744d Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 14:38:55 -0700 Subject: [PATCH 05/10] Update build_rocm.sh --- manywheel/build_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index de58d8352..c9de7f33d 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -358,7 +358,7 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" # Use "triton" for dev builds, else "pytorch-triton-rocm" - if [[ "$PYTORCH_VERSION" == *".dev0a0"* ]]; then + if [[ "$PYTORCH_VERSION_FULL" == *".0a0"* ]]; then PKG="triton" else PKG="pytorch-triton-rocm" From 5d8b471434ee821eeb8bbc7b2fbb101a0c98809d Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Tue, 12 Aug 2025 19:06:17 -0700 Subject: [PATCH 06/10] Update build_rocm.sh --- manywheel/build_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index c9de7f33d..8b0e74e61 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -75,7 +75,7 @@ ROCM_VERSION_WITH_PATCH=rocm${ROCM_VERSION_MAJOR}.${ROCM_VERSION_MINOR}.${ROCM_V ROCM_INT=$(($ROCM_VERSION_MAJOR * 10000 + $ROCM_VERSION_MINOR * 100 + $ROCM_VERSION_PATCH)) PYTORCH_VERSION=$(cat $PYTORCH_ROOT/version.txt | grep -oP "[0-9]+\.[0-9]+\.[0-9]+") - +PYTORCH_VERSION_FULL=$(cat "$PYTORCH_ROOT/version.txt") do_lightweight_build() { echo "=== Building LIGHTWEIGHT variant ===" From 8d1e94b32b6ec04af06ece172bfd9e4ed1875ffb Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Wed, 13 Aug 2025 06:00:05 -0700 Subject: [PATCH 07/10] Update build_rocm.sh --- manywheel/build_rocm.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index 8b0e74e61..a22690e8f 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -375,8 +375,6 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then fi fi - - echo "PYTORCH_ROCM_ARCH: ${PYTORCH_ROCM_ARCH}" export LIGHTWEIGHT_WHEELNAME_MARKER="${LIGHTWEIGHT_WHEELNAME_MARKER}" From 1ab9453875177bfe114bede19fd914f060cb523f Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Wed, 13 Aug 2025 09:28:27 -0700 Subject: [PATCH 08/10] Make sure that we are only using rocm7.1_internal_testing --- manywheel/build_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index a22690e8f..af799ba9e 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -358,7 +358,7 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" # Use "triton" for dev builds, else "pytorch-triton-rocm" - if [[ "$PYTORCH_VERSION_FULL" == *".0a0"* ]]; then + if [[ "$PYTORCH_VERSION_FULL" == *".0a0"* ]] && [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.9) ]]; then PKG="triton" else PKG="pytorch-triton-rocm" From f462975d610aa0d55f5213f890f198eb149b622f Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Wed, 13 Aug 2025 11:39:40 -0700 Subject: [PATCH 09/10] Add in comment --- manywheel/build_rocm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index af799ba9e..29807d314 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -358,7 +358,8 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" # Use "triton" for dev builds, else "pytorch-triton-rocm" - if [[ "$PYTORCH_VERSION_FULL" == *".0a0"* ]] && [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.9) ]]; then + # Temp: Currently enabling for rocm7.1_internal_testing branch only but plan to expand it to other branches + if [[ "$PYTORCH_VERSION_FULL" == *"2.9.0a0"* ]]; then PKG="triton" else PKG="pytorch-triton-rocm" From c6f60ec1858883936176c5b8c959b4e4ea585c52 Mon Sep 17 00:00:00 2001 From: Ethan Wee Date: Wed, 13 Aug 2025 11:42:28 -0700 Subject: [PATCH 10/10] Removing unneeded changes --- manywheel/build_rocm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manywheel/build_rocm.sh b/manywheel/build_rocm.sh index 29807d314..dc84b4832 100755 --- a/manywheel/build_rocm.sh +++ b/manywheel/build_rocm.sh @@ -350,11 +350,11 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then if [[ $(uname) == "Linux" ]] && [[ "$DESIRED_PYTHON" != "3.12" || $(ver $PYTORCH_VERSION) -ge $(ver 2.4) ]]; then # Triton commit got unified in PyTorch 2.5 if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then - TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt") + TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt) else - TRITON_SHORTHASH=$(cut -c1-8 "$PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt") + TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt) fi - TRITON_VERSION=$(cat "$PYTORCH_ROOT/.ci/docker/triton_version.txt") + TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt) # Only linux Python < 3.13 are supported wheels for triton TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'$(if [[ $(ver "$PYTORCH_VERSION") -le $(ver "2.5") ]]; then echo " and python_version < '3.13'"; fi)" # Use "triton" for dev builds, else "pytorch-triton-rocm"