Repository navigation
Fix Windows libtorch x86_64 and arm64 packages overwriting each other - #187973
Merged
Merged
Conversation
…#187837) Fixes #187812 ## Problem The Windows libtorch CD packages for x86_64 and arm64 are generated with the **same filename** and uploaded to the **same S3 location**, so the arm64 build clobbers the x86_64 one. Users downloading the Windows x64 libtorch release actually receive Aarch64 binaries (`c10.dll: PE32+ executable (DLL) (GUI) Aarch64`). ## Root cause `compute_zip_prefix()` in `.ci/libtorch/extract_libtorch_from_wheel.py` returned `libtorch-win-shared-with-deps` for every Windows build regardless of architecture (the docstring even named `libtorch-win-arm64-shared-with-deps`, but the code never produced it). Both x86_64 and arm64 are CPU builds, so the upload subfolder (`DESIRED_CUDA=cpu`) and the zip filename were identical, and the S3 object key is the zip filename. The arch-blind naming was introduced in #174753 (which added the wheel-extraction approach); the collision became live once the windows-arm64 wheel workflow started running the same extraction in #181586. ## Fix Thread architecture through the extraction so arm64 produces `libtorch-win-arm64-shared-with-deps-{version}.zip` while x86_64 keeps its existing `libtorch-win-shared-with-deps-{version}.zip` name (preserving the public download URL). `generate_libtorch_extraction_configs` also gives the arm64 job a distinct `build_name` so the GitHub artifact and job names no longer alias. ## Test Plan Verified prefix logic: ``` x86_64 -> libtorch-win-shared-with-deps arm64 -> libtorch-win-arm64-shared-with-deps ``` Regenerated the binary build workflows (`python .github/scripts/generate_ci_workflows.py`); the windows-arm64 wheel workflow now passes `--arch arm64` and uploads a distinct `libtorch-arm64-cpu-shared-with-deps-release` artifact, while the x86_64 workflow is unchanged apart from an explicit `--arch x86_64`. This PR was authored with the assistance of an AI coding assistant (Claude Code). Pull Request resolved: #187837 Approved by: https://github.com/Skylion007, https://github.com/huydhn, https://github.com/malfet (cherry picked from commit 599fb5c)
This was referenced Jun 23, 2026
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187973
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 Unclassified FailureAs of commit 5723061 with merge base 636bc91 ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
20 of 27 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.
Fixes #187812
Problem
The Windows libtorch CD packages for x86_64 and arm64 are generated with the same filename and uploaded to the same S3 location, so the arm64 build clobbers the x86_64 one. Users downloading the Windows x64 libtorch release actually receive Aarch64 binaries (
c10.dll: PE32+ executable (DLL) (GUI) Aarch64).Root cause
compute_zip_prefix()in.ci/libtorch/extract_libtorch_from_wheel.pyreturnedlibtorch-win-shared-with-depsfor every Windows build regardless of architecture (the docstring even namedlibtorch-win-arm64-shared-with-deps, but the code never produced it). Both x86_64 and arm64 are CPU builds, so the upload subfolder (DESIRED_CUDA=cpu) and the zip filename were identical, and the S3 object key is the zip filename.The arch-blind naming was introduced in #174753 (which added the wheel-extraction approach); the collision became live once the windows-arm64 wheel workflow started running the same extraction in #181586.
Fix
Thread architecture through the extraction so arm64 produces
libtorch-win-arm64-shared-with-deps-{version}.zipwhile x86_64 keeps its existinglibtorch-win-shared-with-deps-{version}.zipname (preserving the public download URL).generate_libtorch_extraction_configsalso gives the arm64 job a distinctbuild_nameso the GitHub artifact and job names no longer alias.Test Plan
Verified prefix logic:
Regenerated the binary build workflows (
python .github/scripts/generate_ci_workflows.py); the windows-arm64 wheel workflow now passes--arch arm64and uploads a distinctlibtorch-arm64-cpu-shared-with-deps-releaseartifact, while the x86_64 workflow is unchanged apart from an explicit--arch x86_64.This PR was authored with the assistance of an AI coding assistant (Claude Code).