Skip to content

Commit 2b26379

Browse files
authored
[Rocm6.4] Update triton requirements and conditionalize python_version < '3.13' only for PyTorch <= 2.5 (#68) AND add in conda to dockerfile for torchvision (#70)
* Append torch commit to wheel name (#67) * Append torch commit if it is set * Remove git * Rename wheels * lint * refactor * [rocm6.3] Update triton requirements and conditionalize python_version < '3.13' only for PyTorch <= 2.5 (#68) * conditionalize and python_version < '3.13'" only for PyTorch 2.5 and older * Limit TRITON_CONSTRAINT * Change triton wheel name to .git with 8 characters * Create install_conda_docker.sh * Add conda in dockerfile
1 parent 84c7792 commit 2b26379

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

common/install_conda_docker.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# Script used only in CD pipeline
3+
set -ex
4+
5+
# Anaconda
6+
# Latest anaconda is using openssl-3 which is incompatible with all currently published versions of git
7+
# Which are using openssl-1.1.1, see https://anaconda.org/anaconda/git/files?version=2.40.1 for example
8+
MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py311_23.5.2-0-Linux-x86_64.sh
9+
wget -q $MINICONDA_URL
10+
# NB: Manually invoke bash per https://github.com/conda/conda/issues/10431
11+
bash $(basename "$MINICONDA_URL") -b -p /opt/conda
12+
rm $(basename "$MINICONDA_URL")
13+
export PATH=/opt/conda/bin:$PATH
14+
# See https://github.com/pytorch/builder/issues/1473
15+
# Pin conda to 23.5.2 as it's the last one compatible with openssl-1.1.1
16+
conda install -y conda=23.5.2 conda-build anaconda-client git ninja
17+
# The cmake version here needs to match with the minimum version of cmake
18+
# supported by PyTorch (3.18). There is only 3.18.2 on anaconda
19+
/opt/conda/bin/pip3 install cmake==3.18.2
20+
conda remove -y --force patchelf

manywheel/Dockerfile_2_28

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ COPY --from=jni /usr/local/include/jni.h /usr/local/
123123
FROM common as cpu_final
124124
ARG BASE_CUDA_VERSION=11.8
125125
ARG DEVTOOLSET_VERSION=11
126+
# Install Anaconda
127+
ADD ./common/install_conda_docker.sh install_conda.sh
128+
RUN bash ./install_conda.sh && rm install_conda.sh
129+
ENV PATH /opt/conda/bin:$PATH
126130
# Ensure the expected devtoolset is used
127131
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
128132
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH

manywheel/build_rocm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,18 @@ if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then
312312
if [[ $(uname) == "Linux" ]] && [[ "$DESIRED_PYTHON" != "3.12" || $(ver $PYTORCH_VERSION) -ge $(ver 2.4) ]]; then
313313
# Triton commit got unified in PyTorch 2.5
314314
if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.5) ]]; then
315-
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
315+
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
316316
else
317-
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt)
317+
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-rocm.txt)
318318
fi
319319
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
320320
# Only linux Python < 3.13 are supported wheels for triton
321-
TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64' and python_version < '3.13'"
321+
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)"
322322

323323
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
324-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
324+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
325325
else
326-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
326+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | pytorch-triton-rocm==${TRITON_VERSION}+${ROCM_VERSION_WITH_PATCH}.git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
327327
fi
328328
fi
329329
fi

0 commit comments

Comments
 (0)