Skip to content

Commit 35570e7

Browse files
committed
Fix macos libtorch instructions
1 parent ceb0350 commit 35570e7

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

published_versions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@
124124
"cuda.x": {
125125
"note": null,
126126
"versions": {
127-
"MacOS binaries do not support CUDA. Download default libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
127+
"Download default libtorch here (ROCm and CUDA not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
128128
}
129129
},
130130
"cuda.y": {
131131
"note": null,
132132
"versions": {
133-
"MacOS binaries do not support CUDA. Download CPU libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
133+
"Download default libtorch here (ROCm and CUDA not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
134134
}
135135
},
136136
"rocm5.x": {
137137
"note": null,
138138
"versions": {
139-
"ROCm is not available on MacOS. Download default libtorch here:": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
139+
"Download default libtorch here (ROCm and CUDA not supported):": "https://download.pytorch.org/libtorch/nightly/cpu/libtorch-macos-latest.zip"
140140
}
141141
}
142142
}
@@ -2237,4 +2237,4 @@
22372237
}
22382238
}
22392239
}
2240-
}
2240+
}

scripts/gen_quick_start_module.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class OperatingSystem(Enum):
2929
DEFAULT = "default"
3030
ENABLE = "enable"
3131
DISABLE = "disable"
32+
MACOS = "macos"
3233

3334
# Mapping json to release matrix default values
3435
acc_arch_ver_default = {
@@ -56,6 +57,7 @@ class OperatingSystem(Enum):
5657
CXX11_ABI: "Download here (cxx11 ABI):",
5758
RELEASE: "Download here (Release version):",
5859
DEBUG: "Download here (Debug version):",
60+
MACOS: "Download default libtorch here (ROCm and CUDA not supported):",
5961
}
6062

6163
def load_json_from_basedir(filename: str):
@@ -137,6 +139,13 @@ def update_versions(versions, release_matrix, release_version):
137139
if instr["versions"] is not None:
138140
for ver in [RELEASE, DEBUG]:
139141
instr["versions"][LIBTORCH_DWNL_INSTR[ver]] = rel_entry_dict[ver]
142+
elif os_key == OperatingSystem.MACOS.value:
143+
rel_entry_dict = {
144+
x["devtoolset"]: x["installation"] for x in pkg_arch_matrix
145+
if x["libtorch_variant"] == "shared-with-deps"
146+
}
147+
if instr["versions"] is not None:
148+
instr["versions"][LIBTORCH_DWNL_INSTR[MACOS]] = list(rel_entry_dict.values())[0]
140149

141150
# This method is used for generating new quick-start-module.js
142151
# from the versions json object
@@ -188,7 +197,7 @@ def gen_ver_list(chan, gpu_arch_type):
188197
def main():
189198
parser = argparse.ArgumentParser()
190199
parser.add_argument('--autogenerate', dest='autogenerate', action='store_true')
191-
parser.set_defaults(autogenerate=False)
200+
parser.set_defaults(autogenerate=True)
192201

193202
options = parser.parse_args()
194203
versions = read_published_versions()

0 commit comments

Comments
 (0)