61
61
CUDA_AARCH64 = "cuda-aarch64"
62
62
CUDA = "cuda"
63
63
ROCM = "rocm"
64
+ XPU = "xpu"
64
65
65
66
66
67
CURRENT_NIGHTLY_VERSION = "2.5.0"
@@ -107,6 +108,8 @@ def arch_type(arch_version: str) -> str:
107
108
return CPU_AARCH64
108
109
elif arch_version == CUDA_AARCH64 :
109
110
return CUDA_AARCH64
111
+ elif arch_version == XPU :
112
+ return XPU
110
113
else : # arch_version should always be CPU in this case
111
114
return CPU
112
115
@@ -160,6 +163,7 @@ def initialize_globals(channel: str, build_python_only: bool) -> None:
160
163
for gpu_arch in ROCM_ARCHES
161
164
},
162
165
CPU : "pytorch/manylinux-builder:cpu" ,
166
+ XPU : "pytorch/manylinux2_28-builder:xpu" ,
163
167
CPU_AARCH64 : "pytorch/manylinuxaarch64-builder:cpu-aarch64" ,
164
168
CUDA_AARCH64 : "pytorch/manylinuxaarch64-builder:cuda12.4" ,
165
169
}
@@ -199,6 +203,7 @@ def translate_desired_cuda(gpu_arch_type: str, gpu_arch_version: str) -> str:
199
203
CUDA_AARCH64 : "cu124" ,
200
204
CUDA : f"cu{ gpu_arch_version .replace ('.' , '' )} " ,
201
205
ROCM : f"rocm{ gpu_arch_version } " ,
206
+ XPU : "xpu" ,
202
207
}.get (gpu_arch_type , gpu_arch_version )
203
208
204
209
@@ -327,6 +332,7 @@ def generate_conda_matrix(
327
332
with_cuda : str ,
328
333
with_rocm : str ,
329
334
with_cpu : str ,
335
+ with_xpu : str ,
330
336
limit_pr_builds : bool ,
331
337
use_only_dl_pytorch_org : bool ,
332
338
use_split_build : bool = False ,
@@ -383,6 +389,7 @@ def generate_libtorch_matrix(
383
389
with_cuda : str ,
384
390
with_rocm : str ,
385
391
with_cpu : str ,
392
+ with_xpu : str ,
386
393
limit_pr_builds : bool ,
387
394
use_only_dl_pytorch_org : bool ,
388
395
use_split_build : bool = False ,
@@ -472,6 +479,7 @@ def generate_wheels_matrix(
472
479
with_cuda : str ,
473
480
with_rocm : str ,
474
481
with_cpu : str ,
482
+ with_xpu : str ,
475
483
limit_pr_builds : bool ,
476
484
use_only_dl_pytorch_org : bool ,
477
485
use_split_build : bool = False ,
@@ -510,6 +518,10 @@ def generate_wheels_matrix(
510
518
if os == LINUX :
511
519
arches += ROCM_ARCHES
512
520
521
+ if with_xpu == ENABLE :
522
+ if os == LINUX :
523
+ arches += [XPU ]
524
+
513
525
if limit_pr_builds :
514
526
python_versions = [python_versions [0 ]]
515
527
@@ -523,7 +535,7 @@ def generate_wheels_matrix(
523
535
continue
524
536
gpu_arch_version = (
525
537
""
526
- if arch_version in [CPU , CPU_AARCH64 ]
538
+ if arch_version in [CPU , CPU_AARCH64 , XPU ]
527
539
else arch_version
528
540
)
529
541
@@ -579,6 +591,7 @@ def generate_build_matrix(
579
591
with_cuda : str ,
580
592
with_rocm : str ,
581
593
with_cpu : str ,
594
+ with_xpu : str ,
582
595
limit_pr_builds : str ,
583
596
use_only_dl_pytorch_org : str ,
584
597
build_python_only : str ,
@@ -602,6 +615,7 @@ def generate_build_matrix(
602
615
with_cuda ,
603
616
with_rocm ,
604
617
with_cpu ,
618
+ with_xpu ,
605
619
limit_pr_builds == "true" ,
606
620
use_only_dl_pytorch_org == "true" ,
607
621
use_split_build == "true" ,
@@ -653,6 +667,13 @@ def main(args: List[str]) -> None:
653
667
choices = [ENABLE , DISABLE ],
654
668
default = os .getenv ("WITH_CPU" , ENABLE ),
655
669
)
670
+ parser .add_argument (
671
+ "--with-xpu" ,
672
+ help = "Build with XPU?" ,
673
+ type = str ,
674
+ choices = [ENABLE , DISABLE ],
675
+ default = os .getenv ("WITH_XPU" , ENABLE ),
676
+ )
656
677
# By default this is false for this script but expectation is that the caller
657
678
# workflow will default this to be true most of the time, where a pull
658
679
# request is synchronized and does not contain the label "ciflow/binaries/all"
@@ -705,6 +726,7 @@ def main(args: List[str]) -> None:
705
726
options .with_cuda ,
706
727
options .with_rocm ,
707
728
options .with_cpu ,
729
+ options .with_xpu ,
708
730
options .limit_pr_builds ,
709
731
options .use_only_dl_pytorch_org ,
710
732
options .build_python_only ,
0 commit comments