mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[XPU] Split triton version as 2 files to decouple triton version bump (#155313)
Triton XPU shares its version file with the community one. When the community updates Triton version, it will temporarily break the XPU CI/CD because they use different repositories and commits. To decouple Triton version bumps between the community and XPU, we propose splitting the version into two separate files. Refer the latest community triton version bump PR #153117 Pull Request resolved: https://github.com/pytorch/pytorch/pull/155313 Approved by: https://github.com/etaf, https://github.com/EikanWang, https://github.com/atalman
This commit is contained in:
committed by
PyTorch MergeBot
parent
2cdcd16e83
commit
5116293f7e
1
.ci/docker/triton_xpu_version.txt
Normal file
1
.ci/docker/triton_xpu_version.txt
Normal file
@ -0,0 +1 @@
|
||||
3.3.1
|
@ -72,7 +72,7 @@ ARG TRITON
|
||||
COPY ./common/install_triton.sh install_triton.sh
|
||||
COPY ./common/common_utils.sh common_utils.sh
|
||||
COPY ci_commit_pins/triton-xpu.txt triton-xpu.txt
|
||||
COPY triton_version.txt triton_version.txt
|
||||
COPY triton_xpu_version.txt triton_version.txt
|
||||
RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
|
||||
RUN rm install_triton.sh common_utils.sh triton-xpu.txt triton_version.txt
|
||||
|
||||
|
@ -105,6 +105,7 @@ fi
|
||||
|
||||
# Set triton via PYTORCH_EXTRA_INSTALL_REQUIREMENTS for triton xpu package
|
||||
if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*xpu.* ]]; then
|
||||
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_xpu_version.txt)
|
||||
TRITON_REQUIREMENT="pytorch-triton-xpu==${TRITON_VERSION}"
|
||||
if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then
|
||||
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-xpu.txt)
|
||||
|
2
.github/scripts/windows/build_triton.bat
vendored
2
.github/scripts/windows/build_triton.bat
vendored
@ -15,4 +15,4 @@ call conda run -n %PYTHON_PREFIX% pip install wheel pybind11 certifi cython cmak
|
||||
dir "%VC_INSTALL_PATH%"
|
||||
|
||||
call "%VC_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
call conda run -n %PYTHON_PREFIX% python .github/scripts/build_triton_wheel.py --device=%BUILD_DEVICE% %RELEASE%
|
||||
call conda run -n %PYTHON_PREFIX% python .github/scripts/build_triton_wheel.py --device=%BUILD_DEVICE% %TRITON_VERSION% %RELEASE%
|
||||
|
8
.github/workflows/build-triton-wheel.yml
vendored
8
.github/workflows/build-triton-wheel.yml
vendored
@ -156,8 +156,9 @@ jobs:
|
||||
fi
|
||||
|
||||
if [[ "${BUILD_DEVICE}" == xpu ]]; then
|
||||
TRITON_VERSION=$(cat .ci/docker/triton_xpu_version.txt)
|
||||
docker exec -t "${container_name}" bash -c "dnf install -y gcc-toolset-13-gcc-c++"
|
||||
docker exec -t "${container_name}" bash -c "source /opt/rh/gcc-toolset-13/enable && ${PYTHON_EXECUTABLE} /pytorch/.github/scripts/build_triton_wheel.py --device=$BUILD_DEVICE $RELEASE"
|
||||
docker exec -t "${container_name}" bash -c "source /opt/rh/gcc-toolset-13/enable && ${PYTHON_EXECUTABLE} /pytorch/.github/scripts/build_triton_wheel.py --device=$BUILD_DEVICE --triton-version=$TRITON_VERSION $RELEASE"
|
||||
else
|
||||
docker exec -t "${container_name}" bash -c "${PYTHON_EXECUTABLE} /pytorch/.github/scripts/build_triton_wheel.py --device=$BUILD_DEVICE $RELEASE $WITH_CLANG_LDD"
|
||||
fi
|
||||
@ -254,6 +255,11 @@ jobs:
|
||||
if [[ "${IS_RELEASE_TAG}" == true ]]; then
|
||||
export RELEASE="--release"
|
||||
fi
|
||||
export TRITON_VERSION=""
|
||||
if [[ "${{ matrix.device }}" == "xpu" ]]; then
|
||||
triton_version=$(cat .ci/docker/ci_commit_pins/triton-xpu.txt)
|
||||
export TRITON_VERSION="--triton-version=${triton_version}"
|
||||
fi
|
||||
.github/scripts/windows/build_triton.bat
|
||||
mkdir -p "${RUNNER_TEMP}/artifacts/"
|
||||
mv ./*.whl "${RUNNER_TEMP}/artifacts/"
|
||||
|
@ -20,7 +20,7 @@ else
|
||||
# 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_VERSION="pytorch-triton-xpu==$(cat .ci/docker/triton_xpu_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}
|
||||
|
Reference in New Issue
Block a user