9999MACOS_M1_RUNNER = "macos-m1-stable"
100100
101101PACKAGES_TO_INSTALL_WHL = "torch torchvision torchaudio"
102+ PACKAGES_TO_INSTALL_GETTING_STARTED_WHL = "torch torchvision"
102103PACKAGES_TO_INSTALL_WHL_WIN_ARM64 = "torch"
103104WHL_INSTALL_BASE = "pip3 install"
104105DOWNLOAD_URL_BASE = "https://download.pytorch.org"
@@ -274,10 +275,16 @@ def get_wheel_install_command(
274275 python_version : str ,
275276 use_only_dl_pytorch_org : bool ,
276277 use_split_build : bool = False ,
278+ getting_started : bool = False ,
277279) -> str :
280+ PACKAGES_TO_INSTALL = (
281+ PACKAGES_TO_INSTALL_GETTING_STARTED_WHL
282+ if getting_started
283+ else PACKAGES_TO_INSTALL_WHL
284+ )
278285 if use_split_build :
279286 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
281288 else :
282289 raise ValueError (
283290 "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(
291298 or (os == LINUX_AARCH64 )
292299 )
293300 ):
294- return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL_WHL } "
301+ return f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL } "
295302 else :
296303 whl_install_command = ""
297304 if os == WINDOWS_ARM64 :
@@ -300,9 +307,9 @@ def get_wheel_install_command(
300307 f"{ WHL_INSTALL_BASE } --pre { PACKAGES_TO_INSTALL_WHL_WIN_ARM64 } " # noqa: E501
301308 )
302309 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 } "
304311 else :
305- whl_install_command = f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL_WHL } "
312+ whl_install_command = f"{ WHL_INSTALL_BASE } { PACKAGES_TO_INSTALL } "
306313 return f"{ whl_install_command } --index-url { get_base_download_url_for_repo ('whl' , channel , gpu_arch_type , desired_cuda )} " # noqa: E501
307314
308315
@@ -409,6 +416,7 @@ def generate_wheels_matrix(
409416 limit_pr_builds : bool ,
410417 use_only_dl_pytorch_org : bool ,
411418 use_split_build : bool = False ,
419+ getting_started : bool = False ,
412420 python_versions : Optional [List [str ]] = None ,
413421 arches : Optional [List [str ]] = None ,
414422) -> List [Dict [str , str ]]:
@@ -483,6 +491,8 @@ def generate_wheels_matrix(
483491 desired_cuda ,
484492 python_version ,
485493 use_only_dl_pytorch_org ,
494+ use_split_build ,
495+ getting_started ,
486496 ),
487497 "channel" : channel ,
488498 "upload_to_base_bucket" : upload_to_base_bucket ,
@@ -526,6 +536,7 @@ def generate_build_matrix(
526536 use_only_dl_pytorch_org : str ,
527537 build_python_only : str ,
528538 use_split_build : str = "false" ,
539+ getting_started : str = "false" ,
529540 python_versions : Optional [List [str ]] = None ,
530541) -> Dict [str , List [Dict [str , str ]]]:
531542 includes = []
@@ -550,6 +561,7 @@ def generate_build_matrix(
550561 limit_pr_builds == "true" ,
551562 use_only_dl_pytorch_org == "true" ,
552563 use_split_build == "true" ,
564+ getting_started == "true" ,
553565 python_versions ,
554566 )
555567 )
@@ -645,6 +657,14 @@ def main(args: List[str]) -> None:
645657 default = os .getenv ("USE_SPLIT_BUILD" , DISABLE ),
646658 )
647659
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+
648668 parser .add_argument (
649669 "--python-versions" ,
650670 help = "Only build the select JSON-encoded list of python versions" ,
@@ -674,6 +694,7 @@ def main(args: List[str]) -> None:
674694 options .use_only_dl_pytorch_org ,
675695 options .build_python_only ,
676696 options .use_split_build ,
697+ options .getting_started ,
677698 python_versions ,
678699 )
679700
0 commit comments