Skip to content

[test] Build Python 3.15 wheels via conda-forge 3.15.0a8 (alt to #8148)#8221

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

[test] Build Python 3.15 wheels via conda-forge 3.15.0a8 (alt to #8148)#8221
atalman wants to merge 6 commits into
pytorch:mainfrom
atalman:atalman/linux-wheels-python-3.15-conda

Conversation

@atalman

@atalman atalman commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Experimental alternative to #8148 for building Python 3.15 / 3.15t Linux wheels. Based on #8148's branch (matrix + wiring), this PR changes only the conda env setup: instead of building 3.15 against the manylinux python.org interpreter, it installs Python 3.15.0a8 from conda-forge.

setup-binary-builds/action.yml now routes 3.15 through the normal conda path:

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

Both labels are required: the interpreter is published under python_dev (latest is 3.15.0a8), but the build depends on the _python_rc marker package, which lives on python_rc.

Why a separate PR (testing)

#8148 deliberately uses the manylinux interpreter because conda-forge's 3.15.0a* previously did not match the python.org alpha the torch nightly cp315 wheels were built against, causing import torch to segfault during module init. 3.15.0a8 (uploaded 2026-04-23) is still the latest 3.15 on conda-forge, so this PR is a test of whether the current nightly cp315 wheels now match a8.

Expected risk: if the wheels' python.org alpha != a8, import torch will likely still segfault during the smoke test. This PR exists to confirm that empirically without disturbing #8148.

Test plan

atalman added 6 commits June 6, 2026 16:42
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
… 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.
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.
… manylinux interpreter

Experimental alternative to pytorch#8148: instead of building 3.15/3.15t against the
manylinux python.org interpreter, install Python 3.15.0a8 from conda-forge
(python_dev label for the interpreter + python_rc label for the _python_rc
marker dependency). This tests whether the conda-forge alpha now matches the
ABI of the torch nightly cp315 wheels (the manylinux approach was adopted
because conda's 3.15.0a* previously mismatched and segfaulted on import torch).

3.15.0a8 is the latest 3.15 published on conda-forge.
@vercel

vercel Bot commented Jun 26, 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 26, 2026
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.

1 participant