Skip to content

Add Python 3.15 and 3.15t to Linux nightly wheel builds#8148

Open
atalman wants to merge 5 commits into
pytorch:mainfrom
atalman:atalman/linux-wheels-python-3.15
Open

Add Python 3.15 and 3.15t to Linux nightly wheel builds#8148
atalman wants to merge 5 commits into
pytorch:mainfrom
atalman:atalman/linux-wheels-python-3.15

Conversation

@atalman

@atalman atalman commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Python 3.15 and 3.15t (free-threaded) to the binary build matrix for Linux wheels on the nightly channel, and wires up the conda env to install them from conda-forge.

3.15 is brand new and only the Linux manywheel builders are ready for it, so the rollout is intentionally scoped:

  • Added to the nightly entry of PYTHON_ARCHES_DICT only. test and release stay at 3.10-3.14t until 3.15 is releasable.
  • generate_wheels_matrix skips any 3.15* version when the OS is not linux or linux-aarch64 (mirrors the per-OS exclusion previously used for 3.14 on Windows). macOS / Windows / Windows-arm64 are unaffected.

conda env (setup-binary-builds)

3.15 is not on the default Anaconda channel yet; conda-forge ships it under the python_dev label (currently 3.15.0a8), and the python-freethreading metapackage for 3.15 is published there too. So setup-binary-builds/action.yml installs:

  • 3.15 -> python=3.15.0a8 -c conda-forge/label/python_dev -c conda-forge
  • 3.15t -> python=3.15.0a8 python-freethreading -c conda-forge/label/python_dev -c conda-forge

This mirrors how 3.14 was first brought up via conda-forge/label/python_rc (commit 7351b79) before being switched to the default channel once it shipped (commit 13ca4ea). The pinned alpha should be bumped as newer 3.15 pre-releases are published.

Scope verification

OS nightly test/release
linux 3.15, 3.15t added unchanged
linux-aarch64 3.15, 3.15t added unchanged
macos / windows / windows-arm64 excluded excluded

Test Plan

python3 -m tools.tests.test_generate_binary_build_matrix

All 7 tests pass. Per-OS/per-channel scoping additionally verified by generating the matrix for each OS and channel.

⚠️ Temporary commit

The top commit [DO NOT MERGE] Temporarily force PR builds to test 3.15/3.15t on Linux overrides the PR-build version limiter (normally python_versions[0] = 3.10) so this PR's CI actually builds 3.15/3.15t on Linux. Drop this commit before merging.

Note: producing 3.15/3.15t Linux wheels for core torch also requires the pytorch/manylinux2_28-builder images to ship CPython 3.15 / 3.15t; tracked separately in the manylinux builder images.

This PR was authored with the assistance of an AI assistant.

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2026
@atalman atalman force-pushed the atalman/linux-wheels-python-3.15 branch 2 times, most recently from 2828c87 to 61a4d33 Compare June 4, 2026 18:35
Add 3.15 and 3.15t (free-threaded) to the binary build matrix for Linux
wheels on the nightly channel. 3.15 is brand new and only the Linux
manywheel builders are ready for it, so:

- The versions are added to the "nightly" entry of PYTHON_ARCHES_DICT
  only; "test" and "release" stay at 3.10-3.14t until 3.15 is releasable.
- generate_wheels_matrix skips any 3.15* version when the OS is not
  linux or linux-aarch64, mirroring the per-OS exclusion previously used
  for 3.14 on Windows. macOS, Windows, and Windows arm64 are unaffected.

The reference matrices under tools/tests/assets were regenerated for the
four Linux wheel configurations; macOS/Windows references are unchanged.

The interpreter setup for 3.15 (build against the manylinux python.org
interpreter rather than conda) is handled in a follow-up commit.

Test Plan:

    cd tools/tests
    python3 -m tools.tests.test_generate_binary_build_matrix
@atalman atalman force-pushed the atalman/linux-wheels-python-3.15 branch 3 times, most recently from 7bca1e4 to d730129 Compare June 7, 2026 13:46
atalman added 3 commits June 7, 2026 07:14
… conda)

Python 3.15 is still in pre-release and its C-API/ABI is not frozen.
conda-forge's python=3.15.0a* does not match the python.org alpha that the
torch nightly cp315 wheels are built against, so importing torch under a
conda 3.15 interpreter segfaults during module init (observed as
'python setup.py clean' crashing with SIGSEGV / exit 139 in the
torchvision and torchaudio cp315 builds).

For 3.15/3.15t, skip conda and build against the manylinux python.org
interpreter that produced the torch wheels (/opt/python/cp315-cp315[t]).
pkg-helpers already prepends that interpreter's bin to PATH via
BUILD_ENV_FILE, so setting CONDA_RUN='' makes the whole build and smoke
test resolve to it -- no ABI skew. Build tooling (cmake/ninja/wheel) is
pip installed; libpng/libjpeg/libwebp/pkg-config come from the manylinux
image's system packages. All other Python versions keep the conda path.
PR builds normally limit to python_versions[0] (3.10); override that to
["3.15", "3.15t"] for linux and linux-aarch64 so this PR's CI actually
exercises the new versions (macOS/Windows keep 3.10 to avoid an empty
matrix). Revert this commit before merging.
torchvision-extra-decoders is a torch C++ extension (CppExtension over
torch.utils.cpp_extension, install_requires=[], no torchvision needed), so
it's a good probe for whether the binary build path works on a new Python
such as 3.15/3.15t -- it actually compiles against libtorch for cp315
rather than just installing a pure-python package.

Mirrors meta-pytorch/torchvision-extra-decoders' linux_wheel.yaml: cpu-only
matrix, setup-py build, packaging/pre_build_script.sh (auditwheel +
conda libavif/libheif), post_build_script.sh, and the fake smoke test. On
PR CI the matrix is limited to 3.15/3.15t by the temporary force commit.
@atalman atalman force-pushed the atalman/linux-wheels-python-3.15 branch 2 times, most recently from 5c21ca1 to 7699d22 Compare June 8, 2026 14:27
The 3.15/3.15t wheels build fine, but the smoke test installs the built
wheel, which pulls required runtime deps that have no cp315 wheels yet and
fail to build from sdist -- e.g. pillow, a hard install_requires dependency
of torchvision (pip: 'Collecting pillow!=8.3.*,>=5.3.0 (from torchvision)').
The cascade is purely ecosystem readiness, not a defect in the build path
this PR delivers.

Skip the smoke step for 3.15* until cp315 wheels are published. Other
Python versions are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants