Repository navigation
Followup - Full git fetch on tag pushes so release manywheel builds detect the tag - #187058
Merged
Merged
Conversation
…etect the tag (#187047) ## Problem 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. The build then 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 Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow `fetch-depth: 2` for nightlies: ```yaml fetch-depth: ${{ github.ref_type != 'tag' && 2 || 0 }} fetch-tags: ${{ github.ref_type == 'tag' }} ``` ### Why the expression is written this way GitHub Actions has no ternary, so the `A && B || C` idiom is used -- but it only works when `B` is **truthy**. The naive `github.ref_type == 'tag' && 0 || 2` is broken because `0` is falsy: on a real tag push it evaluates `true && 0` -> `0`, then `0 || 2` -> `2`, so it **always** yields `2` and the full-fetch branch is unreachable. An earlier revision shipped this broken form, which is why tag builds kept getting `fetch-depth: 2`. Negating the condition keeps the truthy literal (`2`) as the `&&` operand so the value is never swallowed: | trigger | expression | result | |---|---|---| | tag | `false && 2` -> false -> `false \|\| 0` | **0** (full fetch) | | branch / nightly | `true && 2` -> 2 | **2** (shallow) | 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` (superseding the broken expression) 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 of the 4 unified build jobs 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' && 2 || 0" \ .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 `SC1090` on `source "${BINARY_ENV_FILE}"`): ``` 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: #187047 Approved by: https://github.com/jeanschmidt, https://github.com/albanD (cherry picked from commit 1e97809)
This was referenced Jun 11, 2026
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187058
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
Jun 11, 2026
pytorchmergebot
pushed a commit
that referenced
this pull request
Jun 12, 2026
… tag (#187139) ## Problem Same issue as #187058, but for the **macOS arm64 binary wheel** build. The `wheel-build` job checks out a pinned commit SHA with the default shallow `actions/checkout` (depth 1, no tags). On a release tag push (e.g. `v2.13.0-rc1`) the tag ref is never written into that checkout, so `tagged_version()` in `.ci/pytorch/binary_populate_env.sh` (`git describe --tags --exact`, invoked per-iteration by `.ci/wheel/build_all_macos_wheels.sh`) fails. The build then falls through to the `<version>.dev<DATE>` default, producing wheels versioned `2.13.0.devYYYYMMDD` instead of the release version. ## Fix Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow checkout for nightlies: ```yaml fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }} fetch-tags: ${{ github.ref_type == 'tag' }} ``` The condition is negated (matching #187058) because GitHub Actions has no ternary and the `A && B || C` idiom only works when `B` is truthy; the naive `github.ref_type == 'tag' && 0 || 2` always yields the shallow value because `0` is falsy. Only the `wheel-build` checkout is changed; the libtorch `*-extract` job uses a sparse checkout of the already-built wheel artifact and does not need the tag. > 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 macOS wheel workflow changed, with the conditional fetch on the build job's checkout: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, `SC2086` on `uv python install $DESIRED_PYTHONS`, is pre-existing and unrelated): ``` python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))" lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml ``` *This PR was authored with the assistance of an AI coding agent.* Pull Request resolved: #187139 Approved by: https://github.com/malfet
atalman
added a commit
that referenced
this pull request
Jun 12, 2026
… tag (#187172) Full git fetch on tag pushes so macOS release wheel builds detect the tag (#187139) ## Problem Same issue as #187058, but for the **macOS arm64 binary wheel** build. The `wheel-build` job checks out a pinned commit SHA with the default shallow `actions/checkout` (depth 1, no tags). On a release tag push (e.g. `v2.13.0-rc1`) the tag ref is never written into that checkout, so `tagged_version()` in `.ci/pytorch/binary_populate_env.sh` (`git describe --tags --exact`, invoked per-iteration by `.ci/wheel/build_all_macos_wheels.sh`) fails. The build then falls through to the `<version>.dev<DATE>` default, producing wheels versioned `2.13.0.devYYYYMMDD` instead of the release version. ## Fix Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow checkout for nightlies: ```yaml fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }} fetch-tags: ${{ github.ref_type == 'tag' }} ``` The condition is negated (matching #187058) because GitHub Actions has no ternary and the `A && B || C` idiom only works when `B` is truthy; the naive `github.ref_type == 'tag' && 0 || 2` always yields the shallow value because `0` is falsy. Only the `wheel-build` checkout is changed; the libtorch `*-extract` job uses a sparse checkout of the already-built wheel artifact and does not need the tag. > 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 macOS wheel workflow changed, with the conditional fetch on the build job's checkout: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, `SC2086` on `uv python install $DESIRED_PYTHONS`, is pre-existing and unrelated): ``` python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))" lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml ``` *This PR was authored with the assistance of an AI coding agent.* Pull Request resolved: #187139 Approved by: https://github.com/malfet (cherry picked from commit fb17c34) Co-authored-by: atalman <[email protected]>
20 of 27 tasks
gplutop7
pushed a commit
to gplutop7/pytorch
that referenced
this pull request
Jul 15, 2026
… tag (pytorch#187139) ## Problem Same issue as pytorch#187058, but for the **macOS arm64 binary wheel** build. The `wheel-build` job checks out a pinned commit SHA with the default shallow `actions/checkout` (depth 1, no tags). On a release tag push (e.g. `v2.13.0-rc1`) the tag ref is never written into that checkout, so `tagged_version()` in `.ci/pytorch/binary_populate_env.sh` (`git describe --tags --exact`, invoked per-iteration by `.ci/wheel/build_all_macos_wheels.sh`) fails. The build then falls through to the `<version>.dev<DATE>` default, producing wheels versioned `2.13.0.devYYYYMMDD` instead of the release version. ## Fix Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow checkout for nightlies: ```yaml fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }} fetch-tags: ${{ github.ref_type == 'tag' }} ``` The condition is negated (matching pytorch#187058) because GitHub Actions has no ternary and the `A && B || C` idiom only works when `B` is truthy; the naive `github.ref_type == 'tag' && 0 || 2` always yields the shallow value because `0` is falsy. Only the `wheel-build` checkout is changed; the libtorch `*-extract` job uses a sparse checkout of the already-built wheel artifact and does not need the tag. > 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 macOS wheel workflow changed, with the conditional fetch on the build job's checkout: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, `SC2086` on `uv python install $DESIRED_PYTHONS`, is pre-existing and unrelated): ``` python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))" lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml ``` *This PR was authored with the assistance of an AI coding agent.* Pull Request resolved: pytorch#187139 Approved by: https://github.com/malfet
aws-kingrj
pushed a commit
to amazon-contributing/upstream-to-pytorch
that referenced
this pull request
Jul 29, 2026
… tag (pytorch#187139) ## Problem Same issue as pytorch#187058, but for the **macOS arm64 binary wheel** build. The `wheel-build` job checks out a pinned commit SHA with the default shallow `actions/checkout` (depth 1, no tags). On a release tag push (e.g. `v2.13.0-rc1`) the tag ref is never written into that checkout, so `tagged_version()` in `.ci/pytorch/binary_populate_env.sh` (`git describe --tags --exact`, invoked per-iteration by `.ci/wheel/build_all_macos_wheels.sh`) fails. The build then falls through to the `<version>.dev<DATE>` default, producing wheels versioned `2.13.0.devYYYYMMDD` instead of the release version. ## Fix Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow checkout for nightlies: ```yaml fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }} fetch-tags: ${{ github.ref_type == 'tag' }} ``` The condition is negated (matching pytorch#187058) because GitHub Actions has no ternary and the `A && B || C` idiom only works when `B` is truthy; the naive `github.ref_type == 'tag' && 0 || 2` always yields the shallow value because `0` is falsy. Only the `wheel-build` checkout is changed; the libtorch `*-extract` job uses a sparse checkout of the already-built wheel artifact and does not need the tag. > 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 macOS wheel workflow changed, with the conditional fetch on the build job's checkout: ``` python3 .github/scripts/generate_ci_workflows.py git diff --stat .github/workflows ``` Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, `SC2086` on `uv python install $DESIRED_PYTHONS`, is pre-existing and unrelated): ``` python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))" lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml ``` *This PR was authored with the assistance of an AI coding agent.* Pull Request resolved: pytorch#187139 Approved by: https://github.com/malfet
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.
Problem
The unified inline manywheel build jobs (
cpu/cpu-aarch64/cuda/cuda-aarch64) check out a pinned commit SHA with a shallowfetch-depth: 2. On a release tag push (e.g.v2.13.0-rc1) the tag ref is never written into that shallow checkout, sotagged_version()in.ci/pytorch/binary_populate_env.sh(git describe --tags --exact) fails. The build then falls through to the<version>.dev<DATE>default, producing wheels versioned2.13.0.devYYYYMMDDand pinning triton to a+git<hash>version that does not exist on the test index.Root cause
#187001 added
fetch-tags: truebut keptfetch-depth: 2.fetch-tagsis ineffective whenrefis a bare SHA and the fetch is shallow -- git does not write the tag ref locally. The proven path (thecheckout-pytorchaction) works because it usesfetch-depth: 0, where a full fetch brings all tags regardless.Fix
Do a full fetch (
fetch-depth: 0) on tag pushes and keep the shallowfetch-depth: 2for nightlies:Why the expression is written this way
GitHub Actions has no ternary, so the
A && B || Cidiom is used -- but it only works whenBis truthy. The naivegithub.ref_type == 'tag' && 0 || 2is broken because0is falsy: on a real tag push it evaluatestrue && 0->0, then0 || 2->2, so it always yields2and the full-fetch branch is unreachable. An earlier revision shipped this broken form, which is why tag builds kept gettingfetch-depth: 2.Negating the condition keeps the truthy literal (
2) as the&&operand so the value is never swallowed:false && 2-> false ->false || 0true && 2-> 2With a full fetch the tag is present,
git describe --tags --exactsucceeds, and the build resolves to the release version with a clean triton requirement.Test Plan
Regenerated the workflows from the template and confirmed only the two linux manywheel workflows change, each of the 4 unified build jobs getting the conditional
fetch-depthandfetch-tags:Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warnings are pre-existing
SC1090onsource "${BINARY_ENV_FILE}"):This PR was authored with the assistance of an AI coding assistant.