Skip to content

Full git fetch on tag pushes so release manywheel builds detect the tag - #187042

Closed
atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:fix_ref_tags
Closed

atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:fix_ref_tags

Conversation

@atalman

@atalman atalman commented Jun 11, 2026 •

Copy link
Copy Markdown
Collaborator

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallow fetch-depth: 2. On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow checkout, 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, producing wheels versioned 2.13.0.devYYYYMMDD and pinning triton to a +git<hash> version that does not exist on the test index.

Root cause: #187001 added fetch-tags: true but kept fetch-depth: 2. fetch-tags is ineffective when ref is a bare SHA and the fetch is shallow; git does not write the tag ref locally. The proven path (the checkout-pytorch action) works because it uses fetch-depth: 0, where a full fetch brings all tags regardless.

Fix: in the linux binary build template, set fetch-depth to 0 on tag pushes (github.ref_type == 'tag') and keep 2 for nightlies so they stay fast. With a full fetch the tag is present, git describe --tags --exact succeeds, and the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

PR: #187047

Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each unified build job getting the conditional fetch-depth and fetch-tags:

python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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.

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64)
check out a pinned commit SHA with a shallow `fetch-depth: 2`. On a release
tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow
checkout, 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, producing wheels versioned `2.13.0.devYYYYMMDD`
and pinning triton to a `+git<hash>` version that does not exist on the test
index.

Root cause: pytorch#187001 added `fetch-tags: true` but kept `fetch-depth: 2`.
`fetch-tags` is ineffective when `ref` is a bare SHA and the fetch is shallow;
git does not write the tag ref locally. The proven path (the checkout-pytorch
action) works because it uses `fetch-depth: 0`, where a full fetch brings all
tags regardless.

Fix: in the linux binary build template, set `fetch-depth` to 0 on tag pushes
(`github.ref_type == 'tag'`) and keep 2 for nightlies so they stay fast. With
a full fetch the tag is present, `git describe --tags --exact` succeeds, and
the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

Regenerated the workflows from the template and confirmed only the two linux
manywheel workflows change, each unified build job getting the conditional
fetch-depth and fetch-tags:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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
atalman requested a review from a team as a code owner June 11, 2026 13:34
@pytorch-bot

pytorch-bot Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 77 Pending, 5 Unclassified Failures

As of commit 5cc9782 with merge base e5db9e9 (image):

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

  • windows-binary-wheel / wheel-py3_10-xpu-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ninja: build stopped: subcommand failed
  • windows-binary-wheel / wheel-py3_12-xpu-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    No files were found with the provided path: C:\actions-runner\_work\_temp/artifacts. No artifacts will be uploaded.
  • windows-binary-wheel / wheel-py3_14-xpu-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    No files were found with the provided path: C:\actions-runner\_work\_temp/artifacts. No artifacts will be uploaded.
  • windows-binary-wheel / wheel-py3_14t-cuda13_2-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    No files were found with the provided path: C:\actions-runner\_work\_temp/artifacts. No artifacts will be uploaded.
  • windows-binary-wheel / wheel-py3_14t-xpu-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    No files were found with the provided path: C:\actions-runner\_work\_temp/artifacts. No artifacts will be uploaded.

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 Jun 11, 2026

@NicolasHug NicolasHug left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

stamping

@atalman atalman added the ciflow/binaries Trigger all binary build and upload jobs on the PR label Jun 11, 2026
@atalman

atalman commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "looks good, test is successful"

@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, andrewor14, andyanwang, ...)
  • 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

@albanD albanD 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.

Sounds good if CI failure is unrelated!

@atalman

atalman commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "looks good, test is successful"

@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

@atalman

atalman commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot cherry-pick --onto release/2.13 -c critical

@pytorchbot

Copy link
Copy Markdown
Collaborator

Cherry picking #187042

The cherry pick PR is at #187055 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

atalman added a commit that referenced this pull request Jun 11, 2026
…ag (#187055)

Full git fetch on tag pushes so release manywheel builds detect the tag (#187042)

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallow `fetch-depth: 2`. On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow checkout, 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, producing wheels versioned `2.13.0.devYYYYMMDD` and pinning triton to a `+git<hash>` version that does not exist on the test index.

Root cause: #187001 added `fetch-tags: true` but kept `fetch-depth: 2`. `fetch-tags` is ineffective when `ref` is a bare SHA and the fetch is shallow; git does not write the tag ref locally. The proven path (the checkout-pytorch action) works because it uses `fetch-depth: 0`, where a full fetch brings all tags regardless.

Fix: in the linux binary build template, set `fetch-depth` to 0 on tag pushes (`github.ref_type == 'tag'`) and keep 2 for nightlies so they stay fast. With a full fetch the tag is present, `git describe --tags --exact` succeeds, and the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

PR: #187047

Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each unified build job getting the conditional fetch-depth and fetch-tags:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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.
Pull Request resolved: #187042
Approved by: https://github.com/NicolasHug, https://github.com/albanD, https://github.com/jeanschmidt

(cherry picked from commit 80bd062)

Co-authored-by: atalman <[email protected]>
jemitche1 pushed a commit to jemitche1/pytorch that referenced this pull request Jun 13, 2026
…ag (pytorch#187042)

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallow `fetch-depth: 2`. On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow checkout, 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, producing wheels versioned `2.13.0.devYYYYMMDD` and pinning triton to a `+git<hash>` version that does not exist on the test index.

Root cause: pytorch#187001 added `fetch-tags: true` but kept `fetch-depth: 2`. `fetch-tags` is ineffective when `ref` is a bare SHA and the fetch is shallow; git does not write the tag ref locally. The proven path (the checkout-pytorch action) works because it uses `fetch-depth: 0`, where a full fetch brings all tags regardless.

Fix: in the linux binary build template, set `fetch-depth` to 0 on tag pushes (`github.ref_type == 'tag'`) and keep 2 for nightlies so they stay fast. With a full fetch the tag is present, `git describe --tags --exact` succeeds, and the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

PR: pytorch#187047

Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each unified build job getting the conditional fetch-depth and fetch-tags:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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.
Pull Request resolved: pytorch#187042
Approved by: https://github.com/NicolasHug, https://github.com/albanD, https://github.com/jeanschmidt
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…ag (pytorch#187042)

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallow `fetch-depth: 2`. On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow checkout, 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, producing wheels versioned `2.13.0.devYYYYMMDD` and pinning triton to a `+git<hash>` version that does not exist on the test index.

Root cause: pytorch#187001 added `fetch-tags: true` but kept `fetch-depth: 2`. `fetch-tags` is ineffective when `ref` is a bare SHA and the fetch is shallow; git does not write the tag ref locally. The proven path (the checkout-pytorch action) works because it uses `fetch-depth: 0`, where a full fetch brings all tags regardless.

Fix: in the linux binary build template, set `fetch-depth` to 0 on tag pushes (`github.ref_type == 'tag'`) and keep 2 for nightlies so they stay fast. With a full fetch the tag is present, `git describe --tags --exact` succeeds, and the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

PR: pytorch#187047

Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each unified build job getting the conditional fetch-depth and fetch-tags:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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.
Pull Request resolved: pytorch#187042
Approved by: https://github.com/NicolasHug, https://github.com/albanD, https://github.com/jeanschmidt
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ag (pytorch#187042)

The unified inline manywheel build jobs (cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallow `fetch-depth: 2`. On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that shallow checkout, 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, producing wheels versioned `2.13.0.devYYYYMMDD` and pinning triton to a `+git<hash>` version that does not exist on the test index.

Root cause: pytorch#187001 added `fetch-tags: true` but kept `fetch-depth: 2`. `fetch-tags` is ineffective when `ref` is a bare SHA and the fetch is shallow; git does not write the tag ref locally. The proven path (the checkout-pytorch action) works because it uses `fetch-depth: 0`, where a full fetch brings all tags regardless.

Fix: in the linux binary build template, set `fetch-depth` to 0 on tag pushes (`github.ref_type == 'tag'`) and keep 2 for nightlies so they stay fast. With a full fetch the tag is present, `git describe --tags --exact` succeeds, and the build resolves to the release version with a clean triton requirement.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan:

PR: pytorch#187047

Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each unified build job getting the conditional fetch-depth and fetch-tags:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
grep -c "github.ref_type == 'tag' && 0 || 2" \
  .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, sys; [yaml.safe_load(open(f)) for f in sys.argv[1:]]" \
  .github/workflows/generated-linux-binary-manywheel-nightly.yml \
  .github/workflows/generated-linux-aarch64-binary-manywheel-nightly.yml
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.
Pull Request resolved: pytorch#187042
Approved by: https://github.com/NicolasHug, https://github.com/albanD, https://github.com/jeanschmidt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries Trigger all binary build and upload jobs on the PR Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants