Skip to content

Commit d83f718

Browse files
authored
Add triton version for nightly and release (#1703) (#1704)
1 parent 80b420a commit d83f718

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

manywheel/build_cuda.sh

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

265-
# No triton dependency for now on 3.12 since we don't have binaries for it
266-
# and torch.compile doesn't work.
267-
if [[ $(uname) == "Linux" && "$DESIRED_PYTHON" != "3.12" ]]; then
268-
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
269-
TRITON_REQUIREMENT="triton==${TRITON_VERSION}; platform_system == 'Linux' and platform_machine == 'x86_64'"
270265

271-
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then
272-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}"
273-
else
274-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
275-
fi
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
271+
TRITON_SHORTHASH=$(cut -c1-10 $PYTORCH_ROOT/.github/ci_commit_pins/triton.txt)
272+
TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
273+
fi
274+
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}"
276279
fi
277280

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

0 commit comments

Comments
 (0)