Skip to content

[CD] Use compatible-release (~=) triton pins for release builds - #191941

Closed
atalman wants to merge 2 commits into
pytorch:mainfrom
atalman:triton_pin_update_release
Closed

atalman wants to merge 2 commits into
pytorch:mainfrom
atalman:triton_pin_update_release

Conversation

@atalman

@atalman atalman commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

Release wheels should take any patch release of the pinned triton minor
(~=X.Y.Z) instead of a single exact version, so a triton patch fix can ship
without respinning torch. Nightly is unchanged — it keeps the exact
==<version>+git<shorthash> pin against the nightly index.

Every release-path triton pin in the tree, before this PR:

location package release spec nightly spec
binary_populate_env.sh:78 triton ~= ✅ already ==...+git
binary_populate_env.sh:88 triton-rocm ~= ✅ already ==...+git
binary_populate_env.sh:107 triton-xpu == ❌ ==...+git
scripts/install_triton_wheel.sh:19 triton / triton-xpu == ❌ ==...+git

triton and triton-rocm were already switched to ~= in #188251; this PR
covers the two that were missed.

scripts/install_triton_wheel.sh

The package name is now held separately from the version. The single
TRITON_VERSION="triton==$(...)" variable was shared by both paths, and ~=
could not simply be substituted into it: PEP 440 disallows a local version
segment in a compatible-release clause, so the nightly path would have produced
the invalid triton~=3.8.0+git10f6be36.

Rendered specs after the change (verified by running the script with pip
stubbed out):

release/2.13, cuda : --index-url .../whl/test/    triton~=3.8.0
release/2.13, xpu  : --index-url .../whl/test/    triton-xpu~=3.7.2
main,         cuda : --index-url .../whl/nightly/ triton==3.8.0+git10f6be36
main,         xpu  : --index-url .../whl/nightly/ triton-xpu==3.7.2+git5fcc14d9

shellcheck is clean on both files.

Note Dockerfile declares ARG TRITON_VERSION (fed by docker-release.yml)
but never installs triton with it — triton arrives transitively via torch — so
no change is needed there.

Release (non-nightly) wheels pinned triton-xpu with `==`, while the CUDA and
ROCm paths already use `~=`. Use `~=` for triton-xpu too so a patch release of
triton-xpu can be picked up without respinning torch wheels.

Nightly builds are unchanged: they keep the exact `==<version>+git<hash>` pin.
@atalman
atalman requested a review from a team as a code owner August 3, 2026 17:03
@pytorch-bot

pytorch-bot Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/191941

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 972c21e with merge base 8f85dcc (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Splits the package name from the version so the release branch gets
`<pkg>~=<version>` while nightly keeps the exact `<pkg>==<version>+git<hash>`
pin — reusing one variable is not possible because PEP 440 disallows a local
version segment in a compatible-release clause.
@atalman atalman changed the title [CD] Use compatible-release specifier for triton-xpu on release builds [CD] Use compatible-release (~=) triton pins for release builds Aug 3, 2026
@pytorchgreenlight

pytorchgreenlight Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

PR approved to be merged without human review

Why
Two-file CD pin change that makes the release-path triton specs use compatible-release `~=`, matching the `triton~=` and `triton-rocm~=` specs already present at binary_populate_env.sh:78 and :88; only the xpu release spec at :107 and scripts/install_triton_wheel.sh:23 changed. The nightly paths are preserved exactly (`==${TRITON_VERSION}+git${SHORTHASH}` against the nightly index), which is required since PEP 440 forbids a local version segment under `~=`; splitting TRITON_PACKAGE from TRITON_VERSION in install_triton_wheel.sh is what makes that possible and also adds proper quoting to the pip args. Grep confirms no other consumer of these variables or of the old exact `triton-xpu==` release spec, so scope is narrow, no safety logic or CI gate is removed, and no tests apply to these shell scripts.

reason: clean

Inference job

@jeanschmidt

Copy link
Copy Markdown
Contributor

PR approved to be merged without human review

still didn't add the bot to merge rules, but seems to be working :)

@chuanqi129 chuanqi129 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the change

@atalman

atalman commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "all looks good"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: Approvers from one of the following sets are needed:

  • OSS CI (alband, pytorch/pytorch-dev-infra)
  • Metamates (8Keep, aditvenk, AmesingFlank, amirafzali, angelayi, ...)
  • Core Reviewers (mruberry, lezcano, Skylion007, ngimel, peterbell10, ...)
  • Core Maintainers (soumith, gchanan, ezyang, malfet, albanD, ...)
Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@huydhn huydhn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chuanqi129

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 5, 2026
@atalman

atalman commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "all looks good"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants