99
99
MACOS_M1_RUNNER = "macos-m1-stable"
100
100
101
101
PACKAGES_TO_INSTALL_WHL = "torch torchvision torchaudio"
102
+ PACKAGES_TO_INSTALL_GETTING_STARTED_WHL = "torch torchvision"
102
103
PACKAGES_TO_INSTALL_WHL_WIN_ARM64 = "torch"
103
104
WHL_INSTALL_BASE = "pip3 install"
104
105
DOWNLOAD_URL_BASE = "https://download.pytorch.org"
@@ -274,10 +275,16 @@ def get_wheel_install_command(
274
275
python_version : str ,
275
276
use_only_dl_pytorch_org : bool ,
276
277
use_split_build : bool = False ,
278
+ getting_started : bool = False ,
277
279
) -> str :
280
+ PACKAGES_TO_INSTALL = (
281
+ PACKAGES_TO_INSTALL_GETTING_STARTED_WHL
282
+ if getting_started
283
+ else PACKAGES_TO_INSTALL_WHL
284
+ )
278
285
if use_split_build :
279
286
if (gpu_arch_version in CUDA_ARCHES ) and (os == LINUX ) and (channel == NIGHTLY ):
280
- 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
287
+ return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL } --index-url { get_base_download_url_for_repo ('whl' , channel , gpu_arch_type , desired_cuda )} _pypi_pkg" # noqa: E501
281
288
else :
282
289
raise ValueError (
283
290
"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
@@ -291,7 +298,7 @@ def get_wheel_install_command(
291
298
or (os == LINUX_AARCH64 )
292
299
)
293
300
):
294
- return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL_WHL } "
301
+ return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL } "
295
302
else :
296
303
whl_install_command = ""
297
304
if os == WINDOWS_ARM64 :
@@ -300,9 +307,9 @@ def get_wheel_install_command(
300
307
f"{ WHL_INSTALL_BASE } --pre { PACKAGES_TO_INSTALL_WHL_WIN_ARM64 } " # noqa: E501
301
308
)
302
309
elif channel == "nightly" :
303
- whl_install_command = f"{ WHL_INSTALL_BASE } --pre { PACKAGES_TO_INSTALL_WHL } "
310
+ whl_install_command = f"{ WHL_INSTALL_BASE } --pre { PACKAGES_TO_INSTALL } "
304
311
else :
305
- whl_install_command = f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL_WHL } "
312
+ whl_install_command = f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL } "
306
313
return f"{ whl_install_command } --index-url { get_base_download_url_for_repo ('whl' , channel , gpu_arch_type , desired_cuda )} " # noqa: E501
307
314
308
315
@@ -409,6 +416,7 @@ def generate_wheels_matrix(
409
416
limit_pr_builds : bool ,
410
417
use_only_dl_pytorch_org : bool ,
411
418
use_split_build : bool = False ,
419
+ getting_started : bool = False ,
412
420
python_versions : Optional [List [str ]] = None ,
413
421
arches : Optional [List [str ]] = None ,
414
422
) -> List [Dict [str , str ]]:
@@ -483,6 +491,8 @@ def generate_wheels_matrix(
483
491
desired_cuda ,
484
492
python_version ,
485
493
use_only_dl_pytorch_org ,
494
+ use_split_build ,
495
+ getting_started ,
486
496
),
487
497
"channel" : channel ,
488
498
"upload_to_base_bucket" : upload_to_base_bucket ,
@@ -526,6 +536,7 @@ def generate_build_matrix(
526
536
use_only_dl_pytorch_org : str ,
527
537
build_python_only : str ,
528
538
use_split_build : str = "false" ,
539
+ getting_started : str = "false" ,
529
540
python_versions : Optional [List [str ]] = None ,
530
541
) -> Dict [str , List [Dict [str , str ]]]:
531
542
includes = []
@@ -550,6 +561,7 @@ def generate_build_matrix(
550
561
limit_pr_builds == "true" ,
551
562
use_only_dl_pytorch_org == "true" ,
552
563
use_split_build == "true" ,
564
+ getting_started == "true" ,
553
565
python_versions ,
554
566
)
555
567
)
@@ -645,6 +657,14 @@ def main(args: List[str]) -> None:
645
657
default = os .getenv ("USE_SPLIT_BUILD" , DISABLE ),
646
658
)
647
659
660
+ parser .add_argument (
661
+ "--getting-started" ,
662
+ help = "Matrix for getting started page" ,
663
+ type = str ,
664
+ choices = ["true" , "false" ],
665
+ default = os .getenv ("GETTING_STARTED" , "false" ),
666
+ )
667
+
648
668
parser .add_argument (
649
669
"--python-versions" ,
650
670
help = "Only build the select JSON-encoded list of python versions" ,
@@ -674,6 +694,7 @@ def main(args: List[str]) -> None:
674
694
options .use_only_dl_pytorch_org ,
675
695
options .build_python_only ,
676
696
options .use_split_build ,
697
+ options .getting_started ,
677
698
python_versions ,
678
699
)
679
700
0 commit comments