Skip to content

Commit 1a5841d

Browse files
committed
Add 3.15/3.15t torch validation for Linux x86 + aarch64 (test channel)
Add Python 3.15 and 3.15t to the test-channel validation matrix, scoped to Linux x86 and aarch64 only. torchvision wheels are not published for these versions yet, so the install command requests torch only. - PYTHON_ARCHES_DICT["test"] gains 3.15 / 3.15t (nightly and release unchanged). - LINUX_ONLY_PYTHON_ARCHES strips these from Windows/macOS matrices. - TORCH_ONLY_PYTHON_ARCHES makes get_wheel_install_command request torch only. - Add unit tests covering the OS scoping and torch-only install command. Existing golden assets (generated with the nightly channel) are unchanged.
1 parent 9c8c45b commit 1a5841d

2 files changed

Lines changed: 71 additions & 1 deletion

File tree

tools/scripts/generate_binary_build_matrix.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@
2323

2424
PYTHON_ARCHES_DICT = {
2525
"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"],
26+
"test": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
2727
"release": ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"],
2828
}
2929

30+
# Python versions validated on Linux (x86 and aarch64) only for now. They are
31+
# stripped from Windows and macOS matrices since torch wheels for these versions
32+
# are not built/validated there yet.
33+
LINUX_ONLY_PYTHON_ARCHES = ["3.15", "3.15t"]
34+
35+
# Python versions for which only torch is validated (no torchvision). torchvision
36+
# wheels are not published for these versions yet, so the install command must
37+
# request torch alone.
38+
TORCH_ONLY_PYTHON_ARCHES = ["3.15", "3.15t"]
39+
3040
MACOS_PYTHON_POINT_VERSIONS = {
3141
"3.10": "3.10.19",
3242
"3.11": "3.11.14",
@@ -293,6 +303,11 @@ def get_wheel_install_command(
293303
else PACKAGES_TO_INSTALL_WHL
294304
)
295305

306+
# Validate torch only (no torchvision) for versions without published
307+
# torchvision wheels, e.g. 3.15 / 3.15t.
308+
if python_version in TORCH_ONLY_PYTHON_ARCHES:
309+
PACKAGES_TO_INSTALL = "torch"
310+
296311
if (
297312
channel == RELEASE
298313
and (not use_only_dl_pytorch_org)
@@ -430,6 +445,13 @@ def generate_wheels_matrix(
430445
if os == WINDOWS_ARM64:
431446
python_versions = ["3.11", "3.12", "3.13"] # only versions for now
432447

448+
# Restrict Linux-only Python versions (e.g. 3.15/3.15t) to the Linux x86 and
449+
# aarch64 matrices so Windows/macOS validation is unaffected.
450+
if os not in (LINUX, LINUX_AARCH64):
451+
python_versions = [
452+
pv for pv in python_versions if pv not in LINUX_ONLY_PYTHON_ARCHES
453+
]
454+
433455
if os == LINUX:
434456
# NOTE: We only build manywheel packages for linux
435457
package_type = "manywheel"

tools/tests/test_generate_binary_build_matrix.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,54 @@ def test_linux_wheel_cuda_xpu_nocpu(self):
126126
reference_output_file="build_matrix_linux_wheel_xpu.json",
127127
)
128128

129+
def _test_channel_python_versions(self, operating_system: str) -> set:
130+
out = generate_build_matrix(
131+
"wheel",
132+
operating_system,
133+
"test",
134+
"enable",
135+
"enable" if operating_system in ("linux",) else "disable",
136+
"enable",
137+
"enable" if operating_system in ("linux", "windows") else "disable",
138+
"false",
139+
"false",
140+
"disable",
141+
)
142+
return {entry["python_version"] for entry in out["include"]}
143+
144+
def test_linux_only_python_arches_on_linux(self):
145+
# 3.15 / 3.15t are validated on Linux x86 and aarch64 for the test channel.
146+
for operating_system in ("linux", "linux-aarch64"):
147+
versions = self._test_channel_python_versions(operating_system)
148+
self.assertIn("3.15", versions)
149+
self.assertIn("3.15t", versions)
150+
151+
def test_linux_only_python_arches_excluded_elsewhere(self):
152+
# Windows and macOS must not pick up the Linux-only versions.
153+
for operating_system in ("windows", "macos"):
154+
versions = self._test_channel_python_versions(operating_system)
155+
self.assertNotIn("3.15", versions)
156+
self.assertNotIn("3.15t", versions)
157+
158+
def test_torch_only_install_command_for_linux_only_arches(self):
159+
out = generate_build_matrix(
160+
"wheel",
161+
"linux",
162+
"test",
163+
"enable",
164+
"enable",
165+
"enable",
166+
"enable",
167+
"false",
168+
"false",
169+
"disable",
170+
)
171+
for entry in out["include"]:
172+
if entry["python_version"] in ("3.15", "3.15t"):
173+
# torchvision is not published for these versions yet.
174+
self.assertNotIn("torchvision", entry["installation"])
175+
self.assertIn("torch", entry["installation"])
176+
129177

130178
def parse_args():
131179
parser = argparse.ArgumentParser(description="Test generate build matrix")

0 commit comments

Comments
 (0)