pytorch/scripts/install_triton_wheel.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
# Updates Triton to the pinned version for this copy of PyTorch
Fix make triton command on release branch (#121169) Fixes #120044 Should fix build from source instructions on release branch here: https://github.com/pytorch/pytorch#from-source Please note we are using /test/ channel for release here to make sure it works, before actual release is completed. Test main: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/nightly/ Collecting pytorch-triton==3.0.0+a9bc1a3647 Downloading https://download.pytorch.org/whl/nightly/pytorch_triton-3.0.0%2Ba9bc1a3647-cp310-cp310-linux_x86_64.whl (239.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.0/239.0 MB 8.7 MB/s eta 0:00:00 Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==3.0.0+a9bc1a3647) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 2.2.0 Uninstalling pytorch-triton-2.2.0: Successfully uninstalled pytorch-triton-2.2.0 Successfully installed pytorch-triton-3.0.0+a9bc1a3647 ``` Test release/2.2: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/test/ Collecting pytorch-triton==2.2.0 Using cached https://download.pytorch.org/whl/test/pytorch_triton-2.2.0-cp310-cp310-linux_x86_64.whl (183.1 MB) Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==2.2.0) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 3.0.0+a9bc1a3647 Uninstalling pytorch-triton-3.0.0+a9bc1a3647: Successfully uninstalled pytorch-triton-3.0.0+a9bc1a3647 Successfully installed pytorch-triton-2.2.0 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/121169 Approved by: https://github.com/seemethere
2024-03-05 13:53:53 +00:00
BRANCH=$(git rev-parse --abbrev-ref HEAD)
DOWNLOAD_PYTORCH_ORG="https://download.pytorch.org/whl"
Fix make triton command on release branch (#121169) Fixes #120044 Should fix build from source instructions on release branch here: https://github.com/pytorch/pytorch#from-source Please note we are using /test/ channel for release here to make sure it works, before actual release is completed. Test main: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/nightly/ Collecting pytorch-triton==3.0.0+a9bc1a3647 Downloading https://download.pytorch.org/whl/nightly/pytorch_triton-3.0.0%2Ba9bc1a3647-cp310-cp310-linux_x86_64.whl (239.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.0/239.0 MB 8.7 MB/s eta 0:00:00 Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==3.0.0+a9bc1a3647) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 2.2.0 Uninstalling pytorch-triton-2.2.0: Successfully uninstalled pytorch-triton-2.2.0 Successfully installed pytorch-triton-3.0.0+a9bc1a3647 ``` Test release/2.2: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/test/ Collecting pytorch-triton==2.2.0 Using cached https://download.pytorch.org/whl/test/pytorch_triton-2.2.0-cp310-cp310-linux_x86_64.whl (183.1 MB) Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==2.2.0) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 3.0.0+a9bc1a3647 Uninstalling pytorch-triton-3.0.0+a9bc1a3647: Successfully uninstalled pytorch-triton-3.0.0+a9bc1a3647 Successfully installed pytorch-triton-2.2.0 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/121169 Approved by: https://github.com/seemethere
2024-03-05 13:53:53 +00:00
if [[ -z "${USE_XPU}" ]]; then
# Default install from PyTorch source
TRITON_VERSION="pytorch-triton==$(cat .ci/docker/triton_version.txt)"
if [[ "$BRANCH" =~ .*release.* ]]; then
pip install --index-url ${DOWNLOAD_PYTORCH_ORG}/test/ $TRITON_VERSION
else
pip install --index-url ${DOWNLOAD_PYTORCH_ORG}/nightly/ $TRITON_VERSION+git$(head -c 8 .ci/docker/ci_commit_pins/triton.txt)
fi
Fix make triton command on release branch (#121169) Fixes #120044 Should fix build from source instructions on release branch here: https://github.com/pytorch/pytorch#from-source Please note we are using /test/ channel for release here to make sure it works, before actual release is completed. Test main: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/nightly/ Collecting pytorch-triton==3.0.0+a9bc1a3647 Downloading https://download.pytorch.org/whl/nightly/pytorch_triton-3.0.0%2Ba9bc1a3647-cp310-cp310-linux_x86_64.whl (239.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.0/239.0 MB 8.7 MB/s eta 0:00:00 Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==3.0.0+a9bc1a3647) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 2.2.0 Uninstalling pytorch-triton-2.2.0: Successfully uninstalled pytorch-triton-2.2.0 Successfully installed pytorch-triton-3.0.0+a9bc1a3647 ``` Test release/2.2: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/test/ Collecting pytorch-triton==2.2.0 Using cached https://download.pytorch.org/whl/test/pytorch_triton-2.2.0-cp310-cp310-linux_x86_64.whl (183.1 MB) Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==2.2.0) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 3.0.0+a9bc1a3647 Uninstalling pytorch-triton-3.0.0+a9bc1a3647: Successfully uninstalled pytorch-triton-3.0.0+a9bc1a3647 Successfully installed pytorch-triton-2.2.0 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/121169 Approved by: https://github.com/seemethere
2024-03-05 13:53:53 +00:00
else
# The Triton xpu logic is as follows:
# 1. By default, install pre-built whls.
# 2. [Not exposed to user] If the user set `TRITON_XPU_BUILD_FROM_SOURCE=1` flag,
# it will install Triton from the source.
TRITON_VERSION="pytorch-triton-xpu==$(cat .ci/docker/triton_version.txt)"
TRITON_XPU_COMMIT_ID="$(head -c 8 .ci/docker/ci_commit_pins/triton-xpu.txt)"
if [[ -z "${TRITON_XPU_BUILD_FROM_SOURCE}" ]]; then
pip install --index-url ${DOWNLOAD_PYTORCH_ORG}/nightly/ ${TRITON_VERSION}+git${TRITON_XPU_COMMIT_ID}
else
TRITON_XPU_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
# force-reinstall to ensure the pinned version is installed
pip install --force-reinstall "git+${TRITON_XPU_REPO}@${TRITON_XPU_COMMIT_ID}#subdirectory=python"
fi
Fix make triton command on release branch (#121169) Fixes #120044 Should fix build from source instructions on release branch here: https://github.com/pytorch/pytorch#from-source Please note we are using /test/ channel for release here to make sure it works, before actual release is completed. Test main: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/nightly/ Collecting pytorch-triton==3.0.0+a9bc1a3647 Downloading https://download.pytorch.org/whl/nightly/pytorch_triton-3.0.0%2Ba9bc1a3647-cp310-cp310-linux_x86_64.whl (239.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.0/239.0 MB 8.7 MB/s eta 0:00:00 Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==3.0.0+a9bc1a3647) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 2.2.0 Uninstalling pytorch-triton-2.2.0: Successfully uninstalled pytorch-triton-2.2.0 Successfully installed pytorch-triton-3.0.0+a9bc1a3647 ``` Test release/2.2: ``` make triton pip3 uninstall -y triton WARNING: Skipping triton as it is not installed. Looking in indexes: https://download.pytorch.org/whl/test/ Collecting pytorch-triton==2.2.0 Using cached https://download.pytorch.org/whl/test/pytorch_triton-2.2.0-cp310-cp310-linux_x86_64.whl (183.1 MB) Requirement already satisfied: filelock in /home/atalman/miniconda3/envs/py310/lib/python3.10/site-packages (from pytorch-triton==2.2.0) (3.13.1) Installing collected packages: pytorch-triton Attempting uninstall: pytorch-triton Found existing installation: pytorch-triton 3.0.0+a9bc1a3647 Uninstalling pytorch-triton-3.0.0+a9bc1a3647: Successfully uninstalled pytorch-triton-3.0.0+a9bc1a3647 Successfully installed pytorch-triton-2.2.0 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/121169 Approved by: https://github.com/seemethere
2024-03-05 13:53:53 +00:00
fi