File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ COPY --from=jni /usr/local/include/jni.h /usr/local/
123123FROM common as cpu_final
124124ARG BASE_CUDA_VERSION=11.8
125125ARG 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
127131ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
128132ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH
Original file line number Diff line number Diff 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
329329fi
You can’t perform that action at this time.
0 commit comments