Skip to content

Fix Windows libtorch x86_64 and arm64 packages overwriting each other - #187973

Merged
atalman merged 1 commit into
release/2.13from
cherry-pick-187837-by-pytorch_bot_bot_
Jun 23, 2026
Merged

atalman merged 1 commit into
release/2.13from
cherry-pick-187837-by-pytorch_bot_bot_

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

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

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

pytorch-bot Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

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

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 Unclassified Failure

As of commit 5723061 with merge base 636bc91 (image):

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.

@pytorch-bot pytorch-bot Bot added the release notes: releng release notes category label Jun 23, 2026

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

lgtm

@atalman
atalman merged commit 9845bb2 into release/2.13 Jun 23, 2026
138 of 139 checks passed
@github-actions
github-actions Bot deleted the cherry-pick-187837-by-pytorch_bot_bot_ branch July 24, 2026 02:26
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