Skip to content

Commit a4ba360

Browse files
authored
Enable Python 3.15 / 3.15t by default in the binary build matrix (#8427)
## What Promotes **Python 3.15 / 3.15t** from opt-in preview to the **default** binary build matrix, on **all operating systems**, for the **nightly** and **test** channels. Follow-up to #8241, which added them as opt-in. - `3.15`, `3.15t` added to `PYTHON_ARCHES_DICT["nightly"]` and `["test"]` - `PREVIEW_PYTHON_ARCHES_DICT` deleted - the `INCLUDE_PREVIEW_PYTHON_VERSIONS` env var, the `--include-preview-python-versions` CLI flag, the `include-preview-python-versions` reusable-workflow input, and the `include_preview_python_versions` parameter threaded through `generate_build_matrix` / `generate_wheels_matrix` / `generate_libtorch_matrix` are all removed - the two `include-preview-python-versions: enable` call sites in `validate-linux-binaries.yml` and `validate-aarch64-linux-binaries.yml` are dropped, since the behaviour is now the default **`release` deliberately keeps 3.15 out.** 3.15 is still a CPython pre-release (wheels are built against 3.15.0b4), so it must not land in the release matrix or on the getting-started page until it ships final. This is the one channel that still differs, and it is now the only reason `PYTHON_ARCHES_DICT` has an asymmetric entry. Resulting default python versions per OS/channel: | os | nightly / test | release | |---|---|---| | linux | +3.15, +3.15t | unchanged | | linux-aarch64 | +3.15, +3.15t | unchanged | | windows | +3.15, +3.15t | unchanged | | macos-arm64 | +3.15, +3.15t | unchanged | | windows-arm64 | unchanged (pins its own `3.11/3.12/3.13` list) | unchanged | `TORCH_ONLY_PYTHON_ARCHES` is untouched, so 3.15 install commands stay torch-only (no torchvision wheels for 3.15 yet). ## Reviewer notes — three things worth a look 1. **Removing the reusable-workflow input is breaking for any external caller.** Passing an undefined input to a reusable workflow is a hard error in GitHub Actions. `grep` finds only the two in-repo call sites (both removed here), and the input is ~1 month old, so downstream repos are unlikely to reference it — but if any do, they break on merge. Happy to keep it as an accepted-but-ignored input for a deprecation window instead. 2. **No macOS point-version pin was added for 3.15, on purpose.** `MACOS_PYTHON_POINT_VERSIONS` has no `3.15` entry, so macOS falls through `.get(python_version, python_version)` to plain `3.15` / `3.15t` — the same treatment `3.13` and `3.14t` already get. This is required for correctness: that value feeds `conda create "python=${PYTHON_VERSION}"` in `setup-binary-builds`, whose `case` arms match on exactly `3.15)` / `3.15t)` to swap in `3.15.0b4` plus the `conda-forge/label/python_dev` + `python_rc` channels. A `3.15.0b1`-style pin here would miss those arms and the solve would fail. 3. **Windows 3.15 and the openssl pin.** `setup-binary-builds` clears `OPENSSL_PIN` for 3.15 because the beta requires `openssl>=3.5.7`, and the old comment justified that with "3.15 is Linux-only". That is no longer true, so Windows 3.15 builds are now exposed to the openssl 3.5.7 ASN.1 regression at smoke-test time (pytorch/pytorch#186846). I updated the comment to say so rather than silently leave a stale rationale; the pin cannot simply be re-applied because 3.5.6 is unsatisfiable for the 3.15 beta. ## Test plan - `python -m tools.tests.test_generate_binary_build_matrix` — **11 passed** - Reference assets regenerated via `--update-reference-files` (7 asset files; the bulk of the diff) - Tests rewritten from opt-in semantics to default-on: - `test_python_3_15_enabled_by_default` — asserts 3.15/3.15t present for nightly and test across linux, linux-aarch64, windows, macos-arm64 - `test_python_3_15_excluded_on_release_channel` — asserts absent on release for all four - `test_python_3_15_excluded_on_windows_arm64` — guards the hardcoded list - Spot-checked the generator directly for every os × channel combination, and confirmed macOS emits `3.15` / `3.15t` with torch-only install commands. Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>
1 parent 6996e8f commit a4ba360

13 files changed

Lines changed: 3083 additions & 86 deletions

.github/actions/setup-binary-builds/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ runs:
151151
# and rejects a malformed cert in the Windows machine cert store,
152152
# breaking ssl.create_default_context() with "[ASN1: NOT_ENOUGH_DATA]"
153153
# at smoke-test time. See https://github.com/pytorch/pytorch/pull/186846
154-
# The 3.15 cases below clear this: the 3.15 beta requires openssl>=3.5.7,
155-
# and 3.15 is Linux-only with its smoke test skipped, so the Windows
156-
# regression does not apply.
154+
# The 3.15 cases below clear this because the 3.15 beta requires
155+
# openssl>=3.5.7, so the 3.5.6 pin is unsatisfiable there. NOTE: 3.15
156+
# is no longer Linux-only, so Windows 3.15 builds are exposed to the
157+
# ASN.1 regression above until openssl ships a fix.
157158
export OPENSSL_PIN="openssl=3.5.6"
158159
159160
# shellcheck disable=SC2153

.github/workflows/generate_binary_build_matrix.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ on:
5252
description: "A JSON-encoded list of python versions to build. An empty list means building all supported versions"
5353
default: "[]"
5454
type: string
55-
include-preview-python-versions:
56-
description: "Include opt-in preview python versions (torch-only, Linux x86 and aarch64), e.g. 3.15/3.15t"
57-
default: "disable"
58-
required: false
59-
type: string
6055
getting-started:
6156
description: "Release matrix for getting started page"
6257
required: false
@@ -102,7 +97,6 @@ jobs:
10297
BUILD_PYTHON_ONLY: ${{ inputs.build-python-only }}
10398
GETTING_STARTED: ${{ inputs.getting-started }}
10499
PYTHON_VERSIONS: ${{ inputs.python-versions }}
105-
INCLUDE_PREVIEW_PYTHON_VERSIONS: ${{ inputs.include-preview-python-versions }}
106100
run: |
107101
set -eou pipefail
108102
MATRIX_BLOB="$(python3 tools/scripts/generate_binary_build_matrix.py)"

.github/workflows/validate-aarch64-linux-binaries.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ jobs:
9999
with-cuda: enable
100100
with-cpu: enable
101101
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
102-
# Validate torch-only preview python versions (3.15/3.15t) on the nightly and test channels.
103-
include-preview-python-versions: enable
104102

105103
linux-aarch64:
106104
needs: generate-aarch64-linux-matrix

.github/workflows/validate-linux-binaries.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ jobs:
108108
channel: ${{ inputs.channel }}
109109
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
110110
with-xpu: enable
111-
# Validate torch-only preview python versions (3.15/3.15t) on the nightly and test channels.
112-
include-preview-python-versions: enable
113111

114112
linux:
115113
needs: generate-linux-matrix

tools/scripts/generate_binary_build_matrix.py

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,16 @@
2121
from typing import Any, Callable, Dict, List, Optional, Tuple
2222

2323

24+
# 3.15 / 3.15t are enabled by default on the nightly and test channels for every
25+
# operating system. They are deliberately absent from "release": 3.15 is still a
26+
# CPython pre-release, so it must not appear in the release matrix or on the
27+
# getting-started page until it ships final.
2428
PYTHON_ARCHES_DICT = {
25-
"nightly": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"],
26-
"test": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"],
29+
"nightly": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
30+
"test": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
2731
"release": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"],
2832
}
2933

30-
# Preview Python versions validated for torch only, on Linux x86 and aarch64.
31-
# These are opt-in via INCLUDE_PREVIEW_PYTHON_VERSIONS so that the shared
32-
# generator default is unchanged for domain libraries (torchvision, torchaudio)
33-
# and for Windows/macOS, which do not have wheels for these versions yet.
34-
PREVIEW_PYTHON_ARCHES_DICT = {
35-
"nightly": ["3.15", "3.15t"],
36-
"test": ["3.15", "3.15t"],
37-
"release": [],
38-
}
39-
4034
# Python versions for which only torch is validated (no torchvision). torchvision
4135
# wheels are not published for these versions yet, so the install command must
4236
# request torch alone.
@@ -350,9 +344,7 @@ def generate_libtorch_matrix(
350344
abi_versions: Optional[List[str]] = None,
351345
arches: Optional[List[str]] = None,
352346
libtorch_variants: Optional[List[str]] = None,
353-
include_preview_python_versions: bool = False,
354347
) -> List[Dict[str, str]]:
355-
# libtorch is python-agnostic; the preview python versions do not apply.
356348
ret: List[Dict[str, str]] = []
357349

358350
if arches is None:
@@ -444,7 +436,6 @@ def generate_wheels_matrix(
444436
getting_started: bool = False,
445437
python_versions: Optional[List[str]] = None,
446438
arches: Optional[List[str]] = None,
447-
include_preview_python_versions: bool = False,
448439
) -> List[Dict[str, str]]:
449440
package_type = "wheel"
450441

@@ -454,17 +445,6 @@ def generate_wheels_matrix(
454445
# Define default python version
455446
python_versions = list(PYTHON_ARCHES)
456447

457-
# Opt-in preview versions (e.g. 3.15/3.15t) are torch-only and validated
458-
# on Linux x86/aarch64 and macOS arm64. Append them to the default list
459-
# so the shared default (used by domain libraries and Windows) is
460-
# unaffected.
461-
if include_preview_python_versions and os in (
462-
LINUX,
463-
LINUX_AARCH64,
464-
MACOS_ARM64,
465-
):
466-
python_versions += PREVIEW_PYTHON_ARCHES_DICT.get(channel, [])
467-
468448
if os == WINDOWS_ARM64:
469449
python_versions = ["3.11", "3.12", "3.13"] # only versions for now
470450

@@ -564,7 +544,6 @@ def generate_build_matrix(
564544
build_python_only: str,
565545
getting_started: str = "false",
566546
python_versions: Optional[List[str]] = None,
567-
include_preview_python_versions: str = "disable",
568547
) -> Dict[str, List[Dict[str, str]]]:
569548
includes = []
570549

@@ -594,8 +573,6 @@ def generate_build_matrix(
594573
use_only_dl_pytorch_org == "true",
595574
getting_started == "true",
596575
python_versions,
597-
include_preview_python_versions=include_preview_python_versions
598-
== ENABLE,
599576
)
600577
)
601578

@@ -697,15 +674,6 @@ def main(args: List[str]) -> None:
697674
default=os.getenv("PYTHON_VERSIONS", "[]"),
698675
)
699676

700-
parser.add_argument(
701-
"--include-preview-python-versions",
702-
help="Include opt-in preview python versions (torch-only, Linux x86 and "
703-
"aarch64) in the matrix",
704-
type=str,
705-
choices=[ENABLE, DISABLE],
706-
default=os.getenv("INCLUDE_PREVIEW_PYTHON_VERSIONS", DISABLE),
707-
)
708-
709677
options = parser.parse_args(args)
710678
try:
711679
python_versions = json.loads(options.python_versions)
@@ -729,7 +697,6 @@ def main(args: List[str]) -> None:
729697
options.build_python_only,
730698
options.getting_started,
731699
python_versions,
732-
options.include_preview_python_versions,
733700
)
734701

735702
print(json.dumps(build_matrix))

tools/tests/assets/build_matrix_linux_wheel_cuda.json

Lines changed: 676 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)