2
2
3
3
"""Generates a matrix to be utilized through github actions
4
4
5
+ Important. After making changes to this file please run following command:
6
+ python -m tools.tests.test_generate_binary_build_matrix --update-reference-files
7
+
5
8
Will output a condensed version of the matrix if on a pull request that only
6
9
includes the latest version of python we support built on four different
7
10
architectures:
11
14
* Latest XPU
12
15
"""
13
16
14
-
15
17
import argparse
16
18
import json
17
19
import os
18
20
import sys
19
21
from typing import Any , Callable , Dict , List , Optional , Tuple
20
22
23
+
21
24
PYTHON_ARCHES_DICT = {
22
25
"nightly" : ["3.9" , "3.10" , "3.11" , "3.12" ],
23
26
"test" : ["3.9" , "3.10" , "3.11" , "3.12" ],
26
29
CUDA_ARCHES_DICT = {
27
30
"nightly" : ["11.8" , "12.6" , "12.8" ],
28
31
"test" : ["11.8" , "12.6" , "12.8" ],
29
- "release" : ["11.8" , "12.6 " , "12.8 " ],
32
+ "release" : ["11.8" , "12.4 " , "12.6 " ],
30
33
}
31
34
ROCM_ARCHES_DICT = {
32
- "nightly" : ["6.1" , "6.2" ],
33
- "test" : ["6.1" , "6.2" ],
34
- "release" : ["6.1" , "6.2" ],
35
+ "nightly" : ["6.2.4" , "6.3" ],
36
+ "test" : ["6.2.4" , "6.3" ],
37
+ "release" : ["6.1" , "6.2.4" ],
38
+ }
39
+
40
+ CUDA_CUDNN_VERSIONS = {
41
+ "11.8" : {"cuda" : "11.8.0" , "cudnn" : "9" },
42
+ "12.4" : {"cuda" : "12.4.1" , "cudnn" : "9" },
43
+ "12.6" : {"cuda" : "12.6.3" , "cudnn" : "9" },
44
+ "12.8" : {"cuda" : "12.8.0" , "cudnn" : "9" },
45
+ }
46
+
47
+ STABLE_CUDA_VERSIONS = {
48
+ "nightly" : "12.6" ,
49
+ "test" : "12.6" ,
50
+ "release" : "12.4" ,
35
51
}
36
52
53
+ CUDA_AARCH64_ARCHES = ["12.8-aarch64" , "12.6-aarch64" , "11.8-aarch64" ]
54
+
37
55
PACKAGE_TYPES = ["wheel" , "conda" , "libtorch" ]
38
- PRE_CXX11_ABI = "pre-cxx11"
39
56
CXX11_ABI = "cxx11-abi"
40
57
RELEASE = "release"
41
58
DEBUG = "debug"
59
76
60
77
CURRENT_NIGHTLY_VERSION = "2.8.0"
61
78
CURRENT_CANDIDATE_VERSION = "2.7.0"
62
- CURRENT_STABLE_VERSION = "2.7 .0"
79
+ CURRENT_STABLE_VERSION = "2.6 .0"
63
80
CURRENT_VERSION = CURRENT_STABLE_VERSION
64
81
65
82
# By default use Nightly for CUDA arches
@@ -94,7 +111,7 @@ def arch_type(arch_version: str) -> str:
94
111
return ROCM
95
112
elif arch_version == CPU_AARCH64 :
96
113
return CPU_AARCH64
97
- elif arch_version == CUDA_AARCH64 :
114
+ elif arch_version in CUDA_AARCH64_ARCHES :
98
115
return CUDA_AARCH64
99
116
elif arch_version == XPU :
100
117
return XPU
@@ -140,11 +157,14 @@ def initialize_globals(channel: str, build_python_only: bool) -> None:
140
157
else :
141
158
PYTHON_ARCHES = PYTHON_ARCHES_DICT [channel ]
142
159
WHEEL_CONTAINER_IMAGES = {
143
- "11.8" : "pytorch/manylinux2_28-builder:cuda11.8" ,
144
- "12.1" : "pytorch/manylinux2_28-builder:cuda12.1" ,
145
- "12.4" : "pytorch/manylinux2_28-builder:cuda12.4" ,
146
- "12.6" : "pytorch/manylinux2_28-builder:cuda12.6" ,
147
- "12.8" : "pytorch/manylinux2_28-builder:cuda12.8" ,
160
+ ** {
161
+ gpu_arch : f"pytorch/manylinux2_28-builder:cuda{ gpu_arch } "
162
+ for gpu_arch in CUDA_ARCHES
163
+ },
164
+ ** {
165
+ gpu_arch : f"pytorch/manylinuxaarch64-builder:cuda{ gpu_arch .replace ('-aarch64' , '' )} "
166
+ for gpu_arch in CUDA_AARCH64_ARCHES
167
+ },
148
168
** {
149
169
gpu_arch : f"pytorch/manylinux2_28-builder:rocm{ gpu_arch } "
150
170
for gpu_arch in ROCM_ARCHES
@@ -153,26 +173,17 @@ def initialize_globals(channel: str, build_python_only: bool) -> None:
153
173
XPU : "pytorch/manylinux2_28-builder:xpu" ,
154
174
# TODO: Migrate CUDA_AARCH64 image to manylinux2_28_aarch64-builder:cuda12.4
155
175
CPU_AARCH64 : "pytorch/manylinux2_28_aarch64-builder:cpu-aarch64" ,
156
- CUDA_AARCH64 : "pytorch/manylinuxaarch64-builder:cuda12.4 " ,
176
+ CUDA_AARCH64 : "pytorch/manylinuxaarch64-builder:cuda12.6 " ,
157
177
}
158
178
LIBTORCH_CONTAINER_IMAGES = {
159
- ** {
160
- (gpu_arch , PRE_CXX11_ABI ): f"pytorch/manylinux2_28-builder:cuda{ gpu_arch } "
161
- for gpu_arch in CUDA_ARCHES
162
- },
163
179
** {
164
180
(gpu_arch , CXX11_ABI ): f"pytorch/libtorch-cxx11-builder:cuda{ gpu_arch } "
165
181
for gpu_arch in CUDA_ARCHES
166
182
},
167
- ** {
168
- (gpu_arch , PRE_CXX11_ABI ): f"pytorch/manylinux2_28-builder:rocm{ gpu_arch } "
169
- for gpu_arch in ROCM_ARCHES
170
- },
171
183
** {
172
184
(gpu_arch , CXX11_ABI ): f"pytorch/libtorch-cxx11-builder:rocm{ gpu_arch } "
173
185
for gpu_arch in ROCM_ARCHES
174
186
},
175
- (CPU , PRE_CXX11_ABI ): "pytorch/manylinux2_28-builder:cpu" ,
176
187
(CPU , CXX11_ABI ): "pytorch/libtorch-cxx11-builder:cpu" ,
177
188
}
178
189
@@ -181,7 +192,7 @@ def translate_desired_cuda(gpu_arch_type: str, gpu_arch_version: str) -> str:
181
192
return {
182
193
CPU : "cpu" ,
183
194
CPU_AARCH64 : CPU ,
184
- CUDA_AARCH64 : "cu124 " ,
195
+ CUDA_AARCH64 : f"cu { gpu_arch_version . replace ( '-aarch64' , '' ). replace ( '.' , '' ) } " ,
185
196
CUDA : f"cu{ gpu_arch_version .replace ('.' , '' )} " ,
186
197
ROCM : f"rocm{ gpu_arch_version } " ,
187
198
XPU : "xpu" ,
@@ -272,7 +283,7 @@ def get_wheel_install_command(
272
283
return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL_WHL } --index-url { get_base_download_url_for_repo ('whl' , channel , gpu_arch_type , desired_cuda )} _pypi_pkg" # noqa: E501
273
284
else :
274
285
raise ValueError (
275
- "Split build is not supported for this configuration. It is only supported for CUDA 11.8, 12.4, 12.6, 12.8 on Linux nightly builds." # noqa: E501
286
+ "Split build is not supported for this configuration. It is only supported for CUDA 11.8, 12.4, 12.6 on Linux nightly builds." # noqa: E501
276
287
)
277
288
if (
278
289
channel == RELEASE
@@ -343,7 +354,7 @@ def generate_libtorch_matrix(
343
354
if os == WINDOWS :
344
355
abi_versions = [RELEASE , DEBUG ]
345
356
elif os == LINUX :
346
- abi_versions = [PRE_CXX11_ABI , CXX11_ABI ]
357
+ abi_versions = [CXX11_ABI ]
347
358
elif os in [MACOS_ARM64 ]:
348
359
abi_versions = [CXX11_ABI ]
349
360
else :
@@ -422,11 +433,6 @@ def generate_wheels_matrix(
422
433
# Define default python version
423
434
python_versions = list (PYTHON_ARCHES )
424
435
425
- # If the list of python versions is set explicitly by the caller, stick with it instead
426
- # of trying to add more versions behind the scene
427
- if channel == NIGHTLY and (os in (LINUX , MACOS_ARM64 , LINUX_AARCH64 )):
428
- python_versions += ["3.13" ]
429
-
430
436
if os == LINUX :
431
437
# NOTE: We only build manywheel packages for linux
432
438
package_type = "manywheel"
@@ -442,7 +448,11 @@ def generate_wheels_matrix(
442
448
if os == LINUX_AARCH64 :
443
449
# Only want the one arch as the CPU type is different and
444
450
# uses different build/test scripts
445
- arches = [CPU_AARCH64 , CUDA_AARCH64 ]
451
+ arches = []
452
+ if with_cpu == ENABLE :
453
+ arches += [CPU_AARCH64 ]
454
+ elif with_cuda == ENABLE :
455
+ arches += CUDA_AARCH64_ARCHES
446
456
447
457
if with_cuda == ENABLE :
448
458
upload_to_base_bucket = "no"
@@ -463,15 +473,15 @@ def generate_wheels_matrix(
463
473
ret : List [Dict [str , Any ]] = []
464
474
for python_version in python_versions :
465
475
for arch_version in arches :
466
- # TODO: Enable Python 3.13 support for ROCM
467
- if arch_version in ROCM_ARCHES and python_version == "3.13" :
468
- continue
469
-
470
476
gpu_arch_type = arch_type (arch_version )
471
477
gpu_arch_version = (
472
478
"" if arch_version in [CPU , CPU_AARCH64 , XPU ] else arch_version
473
479
)
474
480
481
+ # TODO: Enable python 3.13t on cpu-s390x or Windows
482
+ if (gpu_arch_type == "cpu-s390x" ) and python_version == "3.13t" :
483
+ continue
484
+
475
485
desired_cuda = translate_desired_cuda (gpu_arch_type , gpu_arch_version )
476
486
entry = {
477
487
"python_version" : python_version ,
0 commit comments