Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177609
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 2 Unrelated FailuresAs of commit b9da75b with merge base ec48f0c ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
This is looks nice. Lets add a general tag validation for Linux, Linux aarch64, Windows, MacOS the tag is located inside WHEEL file and looks like: |
atalman
left a comment
There was a problem hiding this comment.
lgtm. lets merge on green
|
it seems like the failure is not related to my changes |
|
@pytorchbot merge |
|
@pytorchbot merge -i |
|
@pytorchbot merge -i |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
Merge failedReason: 1 jobs have failed, first few of them are: windows-arm64-binary-wheel / wheel-py3_13-cpu-test Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 4 checks: trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 3, 5, lf.linux.g6.4xlarge.experimental.nvidia.gpu), windows-arm64-binary-wheel / wheel-py3_11-cpu-test, windows-arm64-binary-wheel / wheel-py3_12-cpu-test, windows-arm64-binary-wheel / wheel-py3_13-cpu-test Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ch#177609) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
Fixes #177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: #177609 Approved by: https://github.com/atalman
…) (#177903) Fixes #177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: #177609 Approved by: https://github.com/atalman
…ch#177609) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
…ch#177609) (pytorch#177903) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
…ch#177609) (pytorch#177903) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
…ch#177609) (pytorch#177903) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
…ch#177609) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
…ch#177609) (pytorch#177903) Fixes pytorch#177140 # Summary Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries. For example, given a wheel like: ``` torch-2.12.0.dev20260316-cp313-cp313t-macosx_11_0_arm64.whl ``` The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0. Pull Request resolved: pytorch#177609 Approved by: https://github.com/atalman
This job builds a wheel and never imports it -- the smoke test further down is gated on *full-debug*, which this build environment is not -- so an extension module named wrongly passes silently. That is not hypothetical: run 33078360947, on this branch two days ago, linked `torch/_C.so` untagged and went green. The cause was pytorchgh-189388, which has since landed: FindPython does not run the interpreter to compute Python_SOABI while cross-compiling, so WITH_SOABI composes a name with no ABI tag. Run 33243561273, on the rebase that picked the fix up, links `torch/_C.cpython-312-riscv64-linux-gnu.so` instead. Nothing in CI checks that, which is how the class went unnoticed long enough to be reported from conda-forge rather than found here. The check asks whether the wheel is self-consistent, rather than comparing it against the running interpreter. A wheel states its tags twice -- in the filename and in .dist-info/WHEEL -- and the extension module inside has to agree with both. So it verifies that those two agree, that exactly one torch/_C module is present, that it is not the untagged torch/_C.so, and that its ABI tag matches the wheel's, cp312 against cpython-312. Deriving the expectation from sysconfig instead, as a first draft did, makes the result depend on which interpreter happens to be active -- for a cross build that is the crossenv interpreter reporting the target's values, not the obvious one. That held here, but only by construction: it is a property of where the call sits relative to the crossenv activation, invisible at the call site, and it would silently become a false failure if either moved. Reading the wheel's own tags has no such coupling, and lets the check run under any interpreter. It also catches more. A wheel whose filename and metadata disagree, or whose module is tagged for a different Python than the wheel claims, are both real mis-builds that the sysconfig form would have passed whenever the checker happened to run under the matching interpreter. The checker lives in .ci/pytorch/check_wheel_soabi.py rather than inline: as a file it is linted and directly testable, which an embedded heredoc is not, and .ci/pytorch already holds print_sccache_log.py and rocm_preflight.py. It takes any number of wheels so the caller passes the glob directly -- dist/ is not guaranteed to hold exactly one, pip_install_whl in common_utils.sh already splits a multi-path argument for that reason, and an earlier draft using `$(echo dist/*.whl)` would have silently checked whichever wheel sorted first. It is gated on the riscv64 cross environment. A native build satisfies it trivially, and adding wheel inspection to every build job is a wider change than this branch should make; the check is cheap enough that generalising it later is worth considering. There is adjacent prior art. .ci/pytorch/smoke_test/check_wheel_tags.py, added in pytorch#177609, validates a wheel's declared tags against the running interpreter and TARGET_OS -- answering "did we build for the target we meant to", which does need an external reference. It never inspects the extension module's filename, so an untagged torch/_C.so inside a correctly tagged wheel passes it cleanly; that is the gap pytorchgh-189388 fell through. It is also reachable only via smoke_test.py, which imports torch and therefore cannot run in a cross job. Folding the module-name check in there would cover every platform's binary builds rather than this one job, and is worth doing, but it is filed separately: that file is smoke-test-only, so the cross job would still need its own call site. This commit was authored with the assistance of an AI coding assistant. Test Plan: The assertion needs a ciflow/riscv64 run to exercise in place, and should pass: run 33243561273 already produced the tagged name it looks for. Because the check reads only the wheel, the riscv64 case is testable without a riscv64 toolchain -- a wheel is a zip. These were built to order and run under **host CPython 3.10 on x86_64**, deliberately neither the Python nor the architecture the wheels claim, which is the property the sysconfig form lacked: | wheel under test | exit | | --- | --- | | `cp312-cp312-linux_riscv64` shipping `_C.cpython-312-riscv64-linux-gnu.so` | 0 | | same, shipping untagged `torch/_C.so` (the pytorchgh-189388 regression) | 1 | | same, shipping no `torch/_C*` at all (the conda-forge symptom) | 1 | | filename says `cp312-...`, `.dist-info/WHEEL` says `cp310-...` | 1 | | declares `cp312`, ships `_C.cpython-310-riscv64-linux-gnu.so` | 1 | | ships both the tagged module and an untagged `torch/_C.so` | 1 | | a libtorch wheel plus a good torch wheel (former skipped) | 0 | | a libtorch wheel alone, so nothing was verified | 1 | Each failure names what it found and what it expected. Exit codes were read directly rather than through a pipe, since `head` would otherwise mask them. Lint: ``` lintrunner --paths-cmd='git diff --cached --name-only' bash -n .ci/pytorch/build.sh ```
This job builds a wheel and never imports it -- the smoke test further down is gated on *full-debug*, which this build environment is not -- so an extension module named wrongly passes silently. That is not hypothetical: run 33078360947, on this branch two days ago, linked `torch/_C.so` untagged and went green. The cause was pytorchgh-189388, which has since landed: FindPython does not run the interpreter to compute Python_SOABI while cross-compiling, so WITH_SOABI composes a name with no ABI tag. Run 33243561273, on the rebase that picked the fix up, links `torch/_C.cpython-312-riscv64-linux-gnu.so` instead. Nothing in CI checks that, which is how the class went unnoticed long enough to be reported from conda-forge rather than found here. The check asks whether the wheel is self-consistent, rather than comparing it against the running interpreter. A wheel states its tags twice -- in the filename and in .dist-info/WHEEL -- and the extension module inside has to agree with both. So it verifies that those two agree, that exactly one torch/_C module is present, that it is not the untagged torch/_C.so, and that its ABI tag matches the wheel's, cp312 against cpython-312. Deriving the expectation from sysconfig instead, as a first draft did, makes the result depend on which interpreter happens to be active -- for a cross build that is the crossenv interpreter reporting the target's values, not the obvious one. That held here, but only by construction: it is a property of where the call sits relative to the crossenv activation, invisible at the call site, and it would silently become a false failure if either moved. Reading the wheel's own tags has no such coupling, and lets the check run under any interpreter. It also catches more. A wheel whose filename and metadata disagree, or whose module is tagged for a different Python than the wheel claims, are both real mis-builds that the sysconfig form would have passed whenever the checker happened to run under the matching interpreter. The checker lives in .ci/pytorch/check_wheel_soabi.py rather than inline: as a file it is linted and directly testable, which an embedded heredoc is not, and .ci/pytorch already holds print_sccache_log.py and rocm_preflight.py. It takes any number of wheels so the caller passes the glob directly -- dist/ is not guaranteed to hold exactly one, pip_install_whl in common_utils.sh already splits a multi-path argument for that reason, and an earlier draft using `$(echo dist/*.whl)` would have silently checked whichever wheel sorted first. It is gated on the riscv64 cross environment. A native build satisfies it trivially, and adding wheel inspection to every build job is a wider change than this branch should make; the check is cheap enough that generalising it later is worth considering. There is adjacent prior art. .ci/pytorch/smoke_test/check_wheel_tags.py, added in pytorch#177609, validates a wheel's declared tags against the running interpreter and TARGET_OS -- answering "did we build for the target we meant to", which does need an external reference. It never inspects the extension module's filename, so an untagged torch/_C.so inside a correctly tagged wheel passes it cleanly; that is the gap pytorchgh-189388 fell through. It is also reachable only via smoke_test.py, which imports torch and therefore cannot run in a cross job. Folding the module-name check in there would cover every platform's binary builds rather than this one job, and is worth doing, but it is filed separately: that file is smoke-test-only, so the cross job would still need its own call site. This commit was authored with the assistance of an AI coding assistant. Test Plan: The assertion needs a ciflow/riscv64 run to exercise in place, and should pass: run 33243561273 already produced the tagged name it looks for. Because the check reads only the wheel, the riscv64 case is testable without a riscv64 toolchain -- a wheel is a zip. These were built to order and run under **host CPython 3.10 on x86_64**, deliberately neither the Python nor the architecture the wheels claim, which is the property the sysconfig form lacked: | wheel under test | exit | | --- | --- | | `cp312-cp312-linux_riscv64` shipping `_C.cpython-312-riscv64-linux-gnu.so` | 0 | | same, shipping untagged `torch/_C.so` (the pytorchgh-189388 regression) | 1 | | same, shipping no `torch/_C*` at all (the conda-forge symptom) | 1 | | filename says `cp312-...`, `.dist-info/WHEEL` says `cp310-...` | 1 | | declares `cp312`, ships `_C.cpython-310-riscv64-linux-gnu.so` | 1 | | ships both the tagged module and an untagged `torch/_C.so` | 1 | | a libtorch wheel plus a good torch wheel (former skipped) | 0 | | a libtorch wheel alone, so nothing was verified | 1 | Each failure names what it found and what it expected. Exit codes were read directly rather than through a pipe, since `head` would otherwise mask them. Lint: ``` lintrunner --paths-cmd='git diff --cached --name-only' bash -n .ci/pytorch/build.sh ```
Fixes #177140
Summary
Adds a check to validate that the macOS wheel platform tag matches the actual minos (minimum OS version) in the Mach-O binaries.
For example, given a wheel like:
The platform tag claims macosx_11_0_arm64, meaning minos should be 11.0. This script runs otool -l on each installed .dylib and verifies the minos from LC_BUILD_VERSION (or LC_VERSION_MIN_MACOSX) matches 11.0.