Repository navigation
Enable fetch-tags in checkout-pytorch to fix release tag detection - #180508
Merged
Merged
Conversation
…180504) ## Summary Release candidate builds triggered by tags (e.g. `v2.12.0-rc1`) are incorrectly producing dev nightly versions instead of RC versions. The root cause is that #172544 added `single-branch: true` to the `checkout-pytorch` action when switching from `actions/checkout@v4` to `pytorch/test-infra/.github/actions/checkout@main`. With `single-branch: true`, git restricts the fetch refspec and tags are no longer fetched — even with `fetch-depth: 0`. This causes `binary_populate_env.sh` to fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exact fatal: No names found, cannot describe anything. and fall through to the dev version path, producing `2.12.0.dev20260415+cpu` instead of `2.12.0+cpu`. The fix adds `fetch-tags: true` to both checkout steps (primary and retry) in the `checkout-pytorch` action, ensuring tags are explicitly fetched regardless of `single-branch` mode. Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912 ## Test plan - Verify that a workflow triggered by an RC tag (e.g. `v2.12.0-rc1`) correctly sets `PYTORCH_BUILD_VERSION=2.12.0+cpu` instead of `2.12.0.dev<date>+cpu` - Verify that nightly builds on the `nightly` branch are unaffected (they should still produce dev versions) Pull Request resolved: #180504 Approved by: https://github.com/seemethere (cherry picked from commit ba240c9)
This was referenced Apr 15, 2026
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/180508
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
atalman
approved these changes
Apr 15, 2026
57 of 86 tasks
atalman
added a commit
that referenced
this pull request
Jun 11, 2026
Release candidate builds triggered by a tag (e.g. v2.13.0-rc1) were producing wheels that pinned triton to a dev-style version such as triton==3.7.1+git5d6048aa instead of the release triton==3.7.1, which then fails to install in the test job because that version does not exist on the test index. Root cause: the unified inline manywheel build job (cpu/cpu-aarch64/ cuda/cuda-aarch64) checks out the raw commit via `ref: github.sha` with `fetch-depth: 2`. Checking out a bare SHA does not fetch the tag ref, so `tagged_version()` in .ci/pytorch/binary_populate_env.sh (`git describe --tags --exact`) fails and the build falls through to the `<version>.dev<DATE>` default. binary_populate_env.sh then takes its `.*dev.*` branch and appends `+git<triton-shorthash>` to the triton requirement that gets baked into the wheel metadata. Fix: add `fetch-tags: true` to the inline build job checkout in the linux binary build template so the tag pointing at the checked-out commit is fetched, letting `git describe --tags --exact` succeed and the build resolve to the release version. The ROCm/XPU/s390x builds use the reusable _binary-build-linux.yml whose checkout has no pinned ref (it uses the default tag ref for a tag push) and are unaffected. This is the same class of bug fixed for the older checkout-pytorch path in #180508; this covers the inlined unified build job introduced since. Test Plan: Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each gaining `fetch-tags: true` on its four unified build jobs: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows grep -c 'fetch-tags: true' \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing on the base files): ``` python3 -c "import yaml; yaml.safe_load(open(f)) for f in (...)" lintrunner --take ACTIONLINT \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` This PR was authored with the assistance of an AI coding assistant.
atalman
added a commit
that referenced
this pull request
Jun 11, 2026
#187001) Release candidate builds triggered by a tag (e.g. v2.13.0-rc1) were producing wheels that pinned triton to a dev-style version such as triton==3.7.1+git5d6048aa instead of the release triton==3.7.1, which then fails to install in the test job because that version does not exist on the test index. Root cause: the unified inline manywheel build job (cpu/cpu-aarch64/ cuda/cuda-aarch64) checks out the raw commit via `ref: github.sha` with `fetch-depth: 2`. Checking out a bare SHA does not fetch the tag ref, so `tagged_version()` in .ci/pytorch/binary_populate_env.sh (`git describe --tags --exact`) fails and the build falls through to the `<version>.dev<DATE>` default. binary_populate_env.sh then takes its `.*dev.*` branch and appends `+git<triton-shorthash>` to the triton requirement that gets baked into the wheel metadata. Fix: add `fetch-tags: true` to the inline build job checkout in the linux binary build template so the tag pointing at the checked-out commit is fetched, letting `git describe --tags --exact` succeed and the build resolve to the release version. The ROCm/XPU/s390x builds use the reusable _binary-build-linux.yml whose checkout has no pinned ref (it uses the default tag ref for a tag push) and are unaffected. This is the same class of bug fixed for the older checkout-pytorch path in #180508; this covers the inlined unified build job introduced since. Test Plan: Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each gaining `fetch-tags: true` on its four unified build jobs: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows grep -c 'fetch-tags: true' \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing on the base files): ``` python3 -c "import yaml; yaml.safe_load(open(f)) for f in (...)" lintrunner --take ACTIONLINT \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` This PR was authored with the assistance of an AI coding assistant.
jemitche1
pushed a commit
to jemitche1/pytorch
that referenced
this pull request
Jun 13, 2026
Release candidate builds triggered by a tag (e.g. v2.13.0-rc1) were producing wheels that pinned triton to a dev-style version such as triton==3.7.1+git5d6048aa instead of the release triton==3.7.1, which then fails to install in the test job because that version does not exist on the test index. Root cause: the unified inline manywheel build job (cpu/cpu-aarch64/ cuda/cuda-aarch64) checks out the raw commit via `ref: github.sha` with `fetch-depth: 2`. Checking out a bare SHA does not fetch the tag ref, so `tagged_version()` in .ci/pytorch/binary_populate_env.sh (`git describe --tags --exact`) fails and the build falls through to the `<version>.dev<DATE>` default. binary_populate_env.sh then takes its `.*dev.*` branch and appends `+git<triton-shorthash>` to the triton requirement that gets baked into the wheel metadata. Fix: add `fetch-tags: true` to the inline build job checkout in the linux binary build template so the tag pointing at the checked-out commit is fetched, letting `git describe --tags --exact` succeed and the build resolve to the release version. The ROCm/XPU/s390x builds use the reusable _binary-build-linux.yml whose checkout has no pinned ref (it uses the default tag ref for a tag push) and are unaffected. This is the same class of bug fixed for the older checkout-pytorch path in pytorch#180508; this covers the inlined unified build job introduced since. Test Plan: Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each gaining `fetch-tags: true` on its four unified build jobs: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows grep -c 'fetch-tags: true' \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing on the base files): ``` python3 -c "import yaml; yaml.safe_load(open(f)) for f in (...)" lintrunner --take ACTIONLINT \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` This PR was authored with the assistance of an AI coding assistant.
gplutop7
pushed a commit
to gplutop7/pytorch
that referenced
this pull request
Jul 15, 2026
Release candidate builds triggered by a tag (e.g. v2.13.0-rc1) were producing wheels that pinned triton to a dev-style version such as triton==3.7.1+git5d6048aa instead of the release triton==3.7.1, which then fails to install in the test job because that version does not exist on the test index. Root cause: the unified inline manywheel build job (cpu/cpu-aarch64/ cuda/cuda-aarch64) checks out the raw commit via `ref: github.sha` with `fetch-depth: 2`. Checking out a bare SHA does not fetch the tag ref, so `tagged_version()` in .ci/pytorch/binary_populate_env.sh (`git describe --tags --exact`) fails and the build falls through to the `<version>.dev<DATE>` default. binary_populate_env.sh then takes its `.*dev.*` branch and appends `+git<triton-shorthash>` to the triton requirement that gets baked into the wheel metadata. Fix: add `fetch-tags: true` to the inline build job checkout in the linux binary build template so the tag pointing at the checked-out commit is fetched, letting `git describe --tags --exact` succeed and the build resolve to the release version. The ROCm/XPU/s390x builds use the reusable _binary-build-linux.yml whose checkout has no pinned ref (it uses the default tag ref for a tag push) and are unaffected. This is the same class of bug fixed for the older checkout-pytorch path in pytorch#180508; this covers the inlined unified build job introduced since. Test Plan: Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each gaining `fetch-tags: true` on its four unified build jobs: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows grep -c 'fetch-tags: true' \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing on the base files): ``` python3 -c "import yaml; yaml.safe_load(open(f)) for f in (...)" lintrunner --take ACTIONLINT \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` This PR was authored with the assistance of an AI coding assistant.
aws-kingrj
pushed a commit
to amazon-contributing/upstream-to-pytorch
that referenced
this pull request
Jul 29, 2026
Release candidate builds triggered by a tag (e.g. v2.13.0-rc1) were producing wheels that pinned triton to a dev-style version such as triton==3.7.1+git5d6048aa instead of the release triton==3.7.1, which then fails to install in the test job because that version does not exist on the test index. Root cause: the unified inline manywheel build job (cpu/cpu-aarch64/ cuda/cuda-aarch64) checks out the raw commit via `ref: github.sha` with `fetch-depth: 2`. Checking out a bare SHA does not fetch the tag ref, so `tagged_version()` in .ci/pytorch/binary_populate_env.sh (`git describe --tags --exact`) fails and the build falls through to the `<version>.dev<DATE>` default. binary_populate_env.sh then takes its `.*dev.*` branch and appends `+git<triton-shorthash>` to the triton requirement that gets baked into the wheel metadata. Fix: add `fetch-tags: true` to the inline build job checkout in the linux binary build template so the tag pointing at the checked-out commit is fetched, letting `git describe --tags --exact` succeed and the build resolve to the release version. The ROCm/XPU/s390x builds use the reusable _binary-build-linux.yml whose checkout has no pinned ref (it uses the default tag ref for a tag push) and are unaffected. This is the same class of bug fixed for the older checkout-pytorch path in pytorch#180508; this covers the inlined unified build job introduced since. Test Plan: Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each gaining `fetch-tags: true` on its four unified build jobs: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows grep -c 'fetch-tags: true' \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing on the base files): ``` python3 -c "import yaml; yaml.safe_load(open(f)) for f in (...)" lintrunner --take ACTIONLINT \ .github/workflows/generated-linux-binary-manywheel-nightly.yml \ .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml ``` This PR was authored with the assistance of an AI coding assistant.
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release candidate builds triggered by tags (e.g.
v2.12.0-rc1) are incorrectly producing dev nightly versions instead of RC versions.The root cause is that #172544 added
single-branch: trueto thecheckout-pytorchaction when switching fromactions/checkout@v4topytorch/test-infra/.github/actions/checkout@main. Withsingle-branch: true, git restricts the fetch refspec and tags are no longer fetched — even withfetch-depth: 0.This causes
binary_populate_env.shto fail at: git describe --tags --match 'v[0-9].[0-9].[0-9]*' --exactfatal: No names found, cannot describe anything.
and fall through to the dev version path, producing
2.12.0.dev20260415+cpuinstead of2.12.0+cpu.The fix adds
fetch-tags: trueto both checkout steps (primary and retry) in thecheckout-pytorchaction, ensuring tags are explicitly fetched regardless ofsingle-branchmode.Failing build: https://github.com/pytorch/pytorch/actions/runs/24474783525/job/71524093912
Test plan
v2.12.0-rc1) correctly setsPYTORCH_BUILD_VERSION=2.12.0+cpuinstead of2.12.0.dev<date>+cpunightlybranch are unaffected (they should still produce dev versions)