Skip to content

Commit a6ac118

Browse files
authored
[main] remove pytorch-triton-rocm (#90)
Relates to:ROCm/pytorch#2500 and https://github.com/ROCm/triton/pull/866/commits Change pytorch-triton-rocm to triton We will only change the triton package name for the rocm7.1_internal testing branch for now. Validation: http://rocm-ci.amd.com/job/mainline-pytorch2.8-manylinux-wheels-k8/5/ http://rocm-ci.amd.com/job/mainline-pytorch2.8-manylinux-wheels-k8/9/ Docker build log ``` Successfully installed apex-1.9.0a0+rocm7.0.0.git4b035815 contourpy-1.3.0 cxxfilt-0.3.0 cycler-0.12.1 fonttools-4.59.0 importlib-resources-6.5.2 kiwisolver-1.4.7 matplotlib-3.9.4 pyparsing-3.2.3 torch-2.9.0.dev20250813+rocm7.0.0.lw.git796d7080 torchaudio-2.8.0+rocm7.0.0.git0c223473 torchvision-0.24.0+rocm7.0.0.git98f8b375 triton-3.4.0+rocm7.0.0.git711e2a92 ```
1 parent 97cf04a commit a6ac118

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

manywheel/build_rocm.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ROCM_VERSION_WITH_PATCH=rocm${ROCM_VERSION_MAJOR}.${ROCM_VERSION_MINOR}.${ROCM_V
7575
ROCM_INT=$(($ROCM_VERSION_MAJOR * 10000 + $ROCM_VERSION_MINOR * 100 + $ROCM_VERSION_PATCH))
7676

7777
PYTORCH_VERSION=$(cat $PYTORCH_ROOT/version.txt | grep -oP "[0-9]+\.[0-9]+\.[0-9]+")
78-
78+
PYTORCH_VERSION_FULL=$(cat "$PYTORCH_ROOT/version.txt")
7979
do_lightweight_build() {
8080
echo "=== Building LIGHTWEIGHT variant ==="
8181

@@ -348,25 +348,34 @@ ver() {
348348
# Assuming PYTORCH_VERSION=x.y.z, if x >= 2
349349
if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then
350350
if [[ $(uname) == "Linux" ]] && [[ "$DESIRED_PYTHON" != "3.12" || $(ver $PYTORCH_VERSION) -ge $(ver 2.4) ]]; then
351-
# Triton commit got unified in PyTorch 2.5
352-
if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then
351+
# Triton commit got unified in PyTorch 2.5
352+
if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then
353353
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
354-
else
354+
else
355355
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt)
356-
fi
356+
fi
357357
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
358-
# Only linux Python < 3.13 are supported wheels for triton
359-
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)"
360-
361-
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
362-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
358+
# Only linux Python < 3.13 are supported wheels for triton
359+
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)"
360+
# Use "triton" for dev builds, else "pytorch-triton-rocm"
361+
# Temp: Currently enabling for rocm7.1_internal_testing branch only but plan to expand it to other branches
362+
if [[ "$PYTORCH_VERSION_FULL" == *"2.9.0a0"* ]]; then
363+
PKG="triton"
363364
else
364-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
365+
PKG="pytorch-triton-rocm"
365366
fi
367+
368+
REQ="${PKG}==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
369+
370+
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
371+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${REQ}"
372+
else
373+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${REQ}"
374+
fi
375+
unset PKG REQ
366376
fi
367377
fi
368378

369-
370379
echo "PYTORCH_ROCM_ARCH: ${PYTORCH_ROCM_ARCH}"
371380

372381
export LIGHTWEIGHT_WHEELNAME_MARKER="${LIGHTWEIGHT_WHEELNAME_MARKER}"

0 commit comments

Comments
 (0)