Skip to content

ci(pytorch): add Python 3.15 release builds - #8394

Merged
ethanwee1 merged 24 commits into
mainfrom
users/ethanwee/python315-pytorch
Nov 5, 2026
Merged

ethanwee1 merged 24 commits into
mainfrom
users/ethanwee/python315-pytorch

Conversation

@ethanwee1

@ethanwee1 ethanwee1 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Enable Python 3.15 PyTorch release builds in TheRock, including regular/shared CPython paths and all portable manylinux consumers. Unsupported PyTorch release/2.12 combinations remain excluded.

Risk Assessment

Level 3 (build/ci): release matrices, reusable workflows, dependency mirroring, and portable wheel packaging change across Linux and Windows; ROCm runtime code is unchanged.

Related

Device / Architecture Coverage

  • Local: gfx942 / gfx94X-dcgpu.
  • CI: Linux gfx94X-dcgpu plus the existing multi-arch Linux and Windows matrices.
  • Current-head manual builds: Linux 41900743552 and Windows 41900748079.

Testing Checklist

Flags / Guardrails

No new runtime feature flag. Python 3.15 is included only in release matrices; CI defaults remain unchanged.

Technical Changes

  • Add cp315 to release matrix, dependency mirror policy, portable build arguments, shared-Python configuration, and release-copy inputs.
  • Pin all manylinux consumers to the merged Python 3.15-capable image.
  • Enable prerelease-aware Python setup for wheel workflows.

Closes #5400
Tracked in AIPYTORCH-1241.

Track per-ref platform support so unsupported combinations are excluded.
Provide cp315 build, dependency mirror, prerelease setup, and promotion support.
@therock-pr-bot

therock-pr-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

[release/2.11] Point torchaudio at the legacy-setuptools fix for wheel builds

release/2.11 pins torchaudio at pytorch/audio 34c52a67, which passes pathlib.Path
objects as extension `sources` and fails on the builder's setuptools with
"AssertionError: 'sources' must be a list of strings". Repoint at the str() fix
(ethanwee1/audio 143129b5) so the ROCm 7.2.4 wheel build reaches torchaudio green.

Same pin used by the last green Jenkins wheel build (#28).
@ethanwee1
ethanwee1 marked this pull request as ready for review September 22, 2026 16:11
@ethanwee1
ethanwee1 marked this pull request as draft September 22, 2026 16:20
@therock-pr-bot

Copy link
Copy Markdown

Pre-commit check failed

⛔ pre-commit failed

Please run locally:

  • python -m pip install pre-commit
  • pre-commit install
  • pre-commit run --all-files --show-diff-on-failure

This repo uses .pre-commit-config.yaml.

Keep the existing-list coverage; black failed CI on the set comprehension line.
Match how 3.14 was added: one RELEASE_PYTHON_VERSIONS list, no per-ref map.
Stop wrapping existing cases in extra loops; 3.15 belongs on the shared version list.
Exercise the shared release default so Python version additions cannot bypass matrix coverage.
# images, with custom additional packages installed. We switch to
# new upstream versions as needed.
FROM quay.io/pypa/manylinux_2_28_x86_64@sha256:d632b5e68ab39e59e128dcf0e59e438b26f122d7f2d45f3eea69ffd2877ab017
FROM quay.io/pypa/manylinux_2_28_x86_64@sha256:531d7aa844bbb0c131d4ab011d3db741c4abc8d498cd5ccc86121046f62303b4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://quay.io/repository/pypa/manylinux_2_28_x86_64?tab=tags

looking here, the new version selected has 4 cirtical securtiy issues and is 1 month old. can we swithc to something newer? if we need to have those changes for py3.15 in the first place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

patches are strongly discouraged. considering how long this pr is open, cant we just wait until this makes it into rocm-systems? (sad to see that the pr in rocm-systems is still a draft :( )

ethanwee1 added a commit that referenced this pull request Oct 30, 2026
## Problem
The merged TheRock manylinux image does not contain CPython 3.15, so
TheRock #8394 cannot configure or build its cp315 Linux artifacts from
merged code.

## Changes
- Move to the current `manylinux_2_28_x86_64` base digest containing
CPython 3.15.
- Build shared Python 3.15 for embedded consumers such as ROCgdb.
- Install `glibc-gconv-extra` so the refreshed image retains the iconv
conversion coverage needed by ROCgdb tests.

## Sequencing
- Merge this image change and wait for the main-branch image
publication.
- Then update the published image digest across all consumers in
[TheRock #8394](#8394).
- [TheRock #8460](#8460) and
[#8565](#8565) are the earlier image
update and revert; this replaces that reverted image with the current
base and the missing shared-runtime setup.

## Validation
- `bash -n dockerfiles/install_shared_pythons.sh` passed.
- `git diff --check` passed.
- Local Docker image build passed from commit `74266a11`.
- The built image contains regular CPython 3.15.2 and shared CPython
3.15.0.
- `glibc-gconv-extra` is installed and `iconv -l` reports 1,180 entries.

Tracked in AIPYTORCH-1241.
Comment on lines +125 to +129
- name: Set up .NET
# Hosted Windows images can omit dotnet; WiX v4 is a .NET global tool.
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '8.x'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is unrelated to Python 3.15 builds, please move to another PR.

@ethanwee1
ethanwee1 requested a review from ScottTodd November 4, 2026 15:17
jithunnair-amd pushed a commit to ROCm/pytorch that referenced this pull request Nov 4, 2026
## Summary

Pin Python dependencies for the `release/2.15` bringup so CI and builds
are reproducible, and make everything resolve cleanly on Python **3.10 /
3.11 / 3.12 / 3.13 / 3.14 / 3.15**. Mirrors the 2.14 bringup (#3574),
plus the 3.15 handling that is new in this release.

Three commits, one per file:

- `requirements.txt`: pin all direct dev/install deps (with
`python_version` splits for `filelock`, `hypothesis` and `networkx`).
- `requirements-build.txt`: pin all build-system deps (with a
`python_version` split for `numpy`).
- `.ci/docker/requirements-ci.txt`: pin the previously-loose entries
(`click`, `psutil`, `pytest-rerunfailures`, `unittest-xml-reporting`,
`redis`, `pyzstd` split, `six`, `cuda-bindings`, `cupti-python`, `tqdm`,
`uv`, `librosa`) and add `python_version` conditionals for 3.14/3.15.

## Per-version splits (dev/build)

- **numpy** (build): `2.2.6` (<3.11), `2.4.6` (==3.11), `2.5.4`
(>=3.12).
- **networkx** (dev): `3.4.2` (<3.11), `3.6.1` (==3.11), `3.7` (>=3.12).
- **filelock** (dev): `4.1.0` (<3.11), `4.2.0` (>=3.11).
- **hypothesis** (dev): `6.168.5` (<3.11), `6.169.2` (>=3.11).

Every other dev/build dep resolved identically across 3.10-3.15, so
those are flat-pinned.

## 3.14 / 3.15 conditionals in requirements-ci.txt

Restored from 2.14 (lost in the 2.15 branch):

- **pywavelets**: `1.9.0` for 3.14 (1.7.0 has no cp314 wheel).
- **fbscribelogger**: guarded to `< 3.14` (its `thriftpy2` dep has no
cp314/cp315 wheel and would source-build in the compiler-less test
image).

New for 3.15 (earliest release with a cp315 wheel):

- **numpy** `2.5.2` (the existing `2.4.6` pin for 3.15 has no cp315
wheel), **pandas** `3.0.6`, **optree** `0.20.0`, **pywavelets**
`1.10.0`, **aiohttp** `3.14.4`.
- **scikit-image**: skipped on 3.15 (no release ships a cp315 wheel
yet).

## How versions were resolved

Per the documented process: installed each requirements file in a fresh
venv inside an `ubuntu:24.04` container with no C compiler (deadsnakes
for the non-native Python versions) and pinned the `pip freeze` output.
All three files install on **3.10-3.15** with `pip check` clean and no
new compiler-dependent source builds (only the pre-existing pure-Python
`pwlf` and `coremltools` sdists, plus `pyyaml` on 3.15, which builds
without its optional C extension).

## Test plan

TheRock CI `multi_arch_build_portable_linux_pytorch_wheels.yml`
(gfx94X-dcgpu, ROCm 10.2.0a20261013, `pytorch_git_ref` =
`pablo-garay/release-2.15-integration`, which is this PR plus the
related_commits from #3816):

- [x] Python 3.11: build passed, [run
38705512288](https://github.com/ROCm/TheRock/actions/runs/38705512288)
- [x] Python 3.12: build passed, [run
38705525582](https://github.com/ROCm/TheRock/actions/runs/38705525582)
- [x] Python 3.13: build passed, [run
38705535781](https://github.com/ROCm/TheRock/actions/runs/38705535781)
- [x] Python 3.14: build passed, [run
38705545732](https://github.com/ROCm/TheRock/actions/runs/38705545732)
- Python 3.10: n/a. Triton 3.9 requires Python >=3.11, and TheRock
dropped 3.10 release builds in ROCm/TheRock#8396 ([run
38705500960](https://github.com/ROCm/TheRock/actions/runs/38705500960)
fails installing the triton wheel).
- Python 3.15: n/a until ROCm/TheRock#8394 adds 3.15 to the build image
([run
38705556076](https://github.com/ROCm/TheRock/actions/runs/38705556076)
fails at setup: `Could not find python: /opt/python/cp315-cp315`). The
3.15 pins were validated by the container install above.

---------

Signed-off-by: pablo-garay <pgarayfe@amd.com>
@ScottTodd

Copy link
Copy Markdown
Member

Current merge blockers

  • Required maintainer review is pending; Scott Todd has now been re-requested after the unrelated failures were triaged.
  • CI Summary remains red because of the eight unrelated infrastructure/package failures.

Can you please revise the PR description? The PR description will be the commit message when merged and text like this is not relevant there. These are also self-evident from the pull request itself and don't need to be mentioned here.

(In general I'd recommend writing PR descriptions yourself if patterns like this continue, many coding agents are still bad at writing commit messages...)

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please link workflow run logs showing all Python 3.15 builds succeeding. The PR description has a whole lot in the "Validation" section but not what I'm actually interested in reviewing.

For example, manual runs of these workflows with the python version set to 3.15:

(In general please be mindful of https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md#ai-tool-use-policy, the text in the PR description is verbose and puts substantial extra burden on reviewers to parse through)

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ inputs.python_version }}
allow-prereleases: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't need allow-prereleases: true now, right? Or at least that could be a separate PR at this point to be more forward looking.

Comment on lines 876 to 879
"additional_requirements_files": [
_get_artifact_path("share/rocprofiler-sdk/tests/requirements.txt"),
_get_script_path("requirements-test-ninja.txt"),
],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are unrelated files showing up in the diff here. Can you keep your branch up to date instead of sprinkling unrelated commits in the history? This makes review difficult.

  • Image
  • Image

@AnticipatedD

Copy link
Copy Markdown

The ERROR: Could not find a version that satisfies the requirement torch==2.14.0+rocm10.1.0 error happens because pip cannot find that specific combination hosted on AMD's wheel repository index. This is typically caused by one of two factors:

  1. Python Version Mismatch: You are running Python 3.15 (/var/home/fedora/.conda/envs/mempalace/lib/python3.15/), which is a very recent/nightly version. Prebuilt ROCm PyTorch wheels are generally compiled only for stable Python versions (such as Python 3.11, 3.12, 3.13, or 3.14 depending on the specific ROCm release branch). Because there are no wheels compiled for Python 3.15, pip reports that no matching distribution exists.
  2. Target Device Index String Syntax: Using bracketed specifiers like [device-gfx1103] can sometimes restrict or fail resolution if the index server expects a generalized architecture tag or if the exact wheel version string formatting differs.

Step-by-Step Solution

Step 1: Check and Downshift Your Python Version

Create a new conda or virtual environment using a supported stable Python version (Python 3.12 or 3.13 are widely supported across modern PyTorch and ROCm builds):

conda create -n mempalace python=3.12 -y
conda activate mempalace

Step 2: Install PyTorch with Device-All or General Targeting

Once inside a supported Python environment, reinstall the ROCm base libraries and try pointing to the general device package or adjusting the wheel selector:

python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "rocm[libraries,device-gfx1103]==10.1.0"

Then install PyTorch using the device-all target bundle or verify the exact matching version string for your setup:

python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ \
    "torch[device-all]==2.14.0+rocm10.1.0" \
    "torchvision==0.29.0a0+rocm10.1.0" \
    "torchaudio==2.11.0.3+rocm10.1.0"

Verification: Run python -c "import torch; print(torch.cuda.is_available())". It should return True, indicating PyTorch can successfully communicate with your AMD GPU via ROCm.

@HereThereBeDragons

Copy link
Copy Markdown
Contributor

@ethanwee1 are now all other dependencies merged? or is this pr still waiting for changes in the pytorch ecosystem?

@ethanwee1
ethanwee1 requested a review from ScottTodd November 5, 2026 15:24
@ethanwee1
ethanwee1 merged commit 3e305a6 into main Nov 5, 2026
216 of 226 checks passed
@ethanwee1
ethanwee1 deleted the users/ethanwee/python315-pytorch branch November 5, 2026 17:40
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Publish Python 3.15 packages (target release 2026-10-01)

4 participants