Skip to content

Commit fa8b6d6

Browse files
authored
Add triton version for nightly and release (#1703)
1 parent 850d28b commit fa8b6d6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

manywheel/build_cuda.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,19 +262,20 @@ else
262262
exit 1
263263
fi
264264

265-
# TODO: Remove me when Triton has a proper release channel
266-
# No triton dependency for now on 3.12 since we don't have binaries for it
267-
# and torch.compile doesn't work.
268-
if [[ $(uname) == "Linux" && "$DESIRED_PYTHON" != "3.12" ]]; then
265+
266+
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
267+
# Only linux Python < 3.12 are supported wheels for triton
268+
TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64' and python_version < '3.12'"
269+
TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}; ${TRITON_CONSTRAINT}"
270+
if [[ -n "$OVERRIDE_PACKAGE_VERSION" && "$OVERRIDE_PACKAGE_VERSION" =~ .*dev.* ]]; then
269271
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.github/ci_commit_pins/triton.txt)
270-
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
271-
TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+${TRITON_SHORTHASH}; platform_system == 'Linux' and platform_machine == 'x86_64'"
272+
TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
273+
fi
272274

273-
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
274-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}"
275-
else
276-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
277-
fi
275+
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
276+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}"
277+
else
278+
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
278279
fi
279280

280281
# builder/test.sh requires DESIRED_CUDA to know what tests to exclude

0 commit comments

Comments
 (0)