From 97c9a2f13bf59e274561400fc721f08ccadd52dc Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 13 Feb 2024 09:27:07 -0800 Subject: [PATCH] Add triton version for nightly and release --- manywheel/build_cuda.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/manywheel/build_cuda.sh b/manywheel/build_cuda.sh index 9919247ed..318273ba4 100644 --- a/manywheel/build_cuda.sh +++ b/manywheel/build_cuda.sh @@ -262,19 +262,20 @@ else exit 1 fi -# TODO: Remove me when Triton has a proper release channel -# No triton dependency for now on 3.12 since we don't have binaries for it -# and torch.compile doesn't work. -if [[ $(uname) == "Linux" && "$DESIRED_PYTHON" != "3.12" ]]; then + +TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt) +# Only linux Python < 3.12 are supported wheels for triton +TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64' and python_version < '3.12'" +TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}; ${TRITON_CONSTRAINT}" +if [[ -n "$OVERRIDE_PACKAGE_VERSION" && "$OVERRIDE_PACKAGE_VERSION" =~ .*dev.* ]]; then TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.github/ci_commit_pins/triton.txt) - TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt) - TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+${TRITON_SHORTHASH}; platform_system == 'Linux' and platform_machine == 'x86_64'" + TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}" +fi - if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}" - else - export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}" - fi +if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}" +else + export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}" fi # builder/test.sh requires DESIRED_CUDA to know what tests to exclude