From 829af54db8655bc14adceaeb1c6bae95d37a1e2b Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 15 Dec 2022 13:00:56 -0800 Subject: [PATCH] Fix macos libtorch instructions --- published_versions.json | 16 ++++++++-------- scripts/gen_quick_start_module.py | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/published_versions.json b/published_versions.json index 25414d61418b..05b70ac2198b 100644 --- a/published_versions.json +++ b/published_versions.json @@ -118,25 +118,25 @@ "accnone": { "note": null, "versions": { - "Download here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" } }, "cuda.x": { "note": null, "versions": { - "MacOS binaries do not support CUDA. Download default libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" } }, "cuda.y": { "note": null, "versions": { - "MacOS binaries do not support CUDA. Download CPU libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" } }, "rocm5.x": { "note": null, "versions": { - "ROCm is not available on MacOS. Download default libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip" } } } @@ -317,19 +317,19 @@ "accnone": { "note": null, "versions": { - "Download here:": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" } }, "cuda.x": { "note": null, "versions": { - "MacOS binaries do not support CUDA. Download CPU libtorch here:": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" } }, "cuda.y": { "note": null, "versions": { - "MacOS binaries do not support CUDA. Download CPU libtorch here:": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" + "Download default libtorch here (ROCm and CUDA are not supported):": "https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.0.zip" } }, "rocm5.x": { @@ -2237,4 +2237,4 @@ } } } -} \ No newline at end of file +} diff --git a/scripts/gen_quick_start_module.py b/scripts/gen_quick_start_module.py index fb59dd0d5eee..920001ecb235 100755 --- a/scripts/gen_quick_start_module.py +++ b/scripts/gen_quick_start_module.py @@ -29,6 +29,7 @@ class OperatingSystem(Enum): DEFAULT = "default" ENABLE = "enable" DISABLE = "disable" +MACOS = "macos" # Mapping json to release matrix default values acc_arch_ver_default = { @@ -56,6 +57,7 @@ class OperatingSystem(Enum): CXX11_ABI: "Download here (cxx11 ABI):", RELEASE: "Download here (Release version):", DEBUG: "Download here (Debug version):", + MACOS: "Download default libtorch here (ROCm and CUDA not supported):", } def load_json_from_basedir(filename: str): @@ -137,6 +139,13 @@ def update_versions(versions, release_matrix, release_version): if instr["versions"] is not None: for ver in [RELEASE, DEBUG]: instr["versions"][LIBTORCH_DWNL_INSTR[ver]] = rel_entry_dict[ver] + elif os_key == OperatingSystem.MACOS.value: + rel_entry_dict = { + x["devtoolset"]: x["installation"] for x in pkg_arch_matrix + if x["libtorch_variant"] == "shared-with-deps" + } + if instr["versions"] is not None: + instr["versions"][LIBTORCH_DWNL_INSTR[MACOS]] = list(rel_entry_dict.values())[0] # This method is used for generating new quick-start-module.js # from the versions json object