Skip to content

Enable fetch-tags in checkout-pytorch to fix release tag detection - #180508

Merged
atalman merged 1 commit into
release/2.12from
cherry-pick-180504-by-pytorch_bot_bot_
Apr 15, 2026
Merged

atalman merged 1 commit into
release/2.12from
cherry-pick-180504-by-pytorch_bot_bot_

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

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)

…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)
@pytorch-bot

pytorch-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown

🔗 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.

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Apr 15, 2026
@atalman
atalman merged commit 489deee into release/2.12 Apr 15, 2026
22 of 54 checks passed
@github-actions
github-actions Bot deleted the cherry-pick-180504-by-pytorch_bot_bot_ branch May 16, 2026 02:27
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants