Skip to content

Build a single py3-none wheel per arch x accelerator variant - #9643

Merged
NicolasHug merged 13 commits into
pytorch:mainfrom
NicolasHug:manypython
Oct 7, 2026
Merged

NicolasHug merged 13 commits into
pytorch:mainfrom
NicolasHug:manypython

Conversation

@NicolasHug

@NicolasHug NicolasHug commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Up until now we were building ~7 wheels for each arch x accelerator variant, i.e. one for each CPython version (including the free-threaded ones).

TorchVision doesn't rely on the Python C APIs, so it's Python-ABI-stable. This is now reflected on the wheel builds by explicitly marking it as py3-none. We now only need one wheel per arch x accelerator variant. I added CI jobs that:

  • assert we don't build more than one wheel per arch x accelerator variant
  • assert that the same wheel built e.g. on 3.11 still works on 3.14, 3.15 and 3.15t.

Also confirmed visually that only one wheel is being built from the uploaded artifacts.

@pytorch-bot

pytorch-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 Pending, 3 Unclassified Failures

As of commit e899cc9 with merge base 7a7520f (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:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@NicolasHug NicolasHug changed the title Build a single abi3 wheel instead of one per Python version Build a single py3-none wheel per arch x accelerator variant Oct 7, 2026
Comment thread setup.py
extra_compile_args["nvcc"].append("/Zc:preprocessor")
extra_compile_args["nvcc"].append("-DCCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING")
if sysconfig.get_config_var("Py_GIL_DISABLED"):
extra_compile_args["cxx"].append("-DPy_GIL_DISABLED")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

drive-by cleanup

@NicolasHug
NicolasHug merged commit 9dfb7a0 into pytorch:main Oct 7, 2026
@NicolasHug
NicolasHug deleted the manypython branch October 7, 2026 15:19
prewaskar-nv added a commit to NVIDIA/pytorch-windows-ci that referenced this pull request Oct 9, 2026
#29)

* fix(woa): accept extension wheels by pip's tag rules, not by tag shape

The 2026-10-08 nightly's sign job refused torchaudio and torchvision
(https://github.com/NVIDIA/pytorch-windows-ci/actions/runs/37760319300):
on 2026-10-07 upstream switched both to one py3-none wheel per platform
(pytorch/audio#4234, pytorch/vision#9643), and wheel_repack.py only
accepted torch's own tag or abi3. github_release.py had the same
abi3-only rule for a wheel that several cells share.

Both now ask what pip asks: is one of the wheel's tags among the tags the
cell's torch interpreter supports? wheel_tags.py lists those tags the way
packaging.tags does for CPython, and its tests hold the two to the same
set for 3.10 to 3.15, with and without the GIL. Any tagging upstream
picks next is accepted if pip would install it there, and refused if not.
github_release.py also checks every wheel a cell vouches for against that
cell's torch, which is what now keeps a cell-specific wheel from arriving
twice.

* fix(woa): give free-threaded cells abi3t, their stable ABI

packaging 26.3 offers a free-threaded CPython the abi3t stable ABI
(PEP 803) back to cp32, where it offers a GIL build abi3. wheel_tags.py
offered free-threaded cells no stable ABI at all, so an abi3t extension
for 3.15t would be refused, and the check that our tags match
packaging's failed under packaging 26.3. CI passed only because its
runner had an older packaging.

CI now installs packaging>=26.3, so that check covers abi3t. On older
packaging, the test leaves abi3t out of the comparison.

* fix(woa): refuse a cell whose torch is built for another Python

Now that a wheel name may arrive from several cells, a cell whose torch
was built for another cell's Python would share every wheel name with
that cell and pass every check. The release would then carry one cell's
torch for both. check_evidence now requires each cell's torch to be
built for the interpreter the cell is named for. That keeps a wheel
built for one Python unique to one cell, as the base commit's
duplicate-name check did.

Also:
- pin packaging to 26.3 in CI, since the tag test compares against it
  exactly;
- say in the docs that the platform tag is still fixed to win_arm64;
- spell out _torch_interpreter's no-torch case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants