From e36f733b408e4460b673f3b1ca21d7d4befd93cb Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 30 Sep 2026 11:25:45 -0700 Subject: [PATCH 1/2] Handle channels with fewer CUDA versions in gen_quick_start_module.py `extract_arch_ver_map` fills `cuda.x`/`cuda.y`/`cuda.z` from the channel's CUDA versions and leaves the rest at the hard-coded defaults. Nightly now ships only 13.2 and 13.4, so the page advertised nightly as CUDA 13.2, 13.4 and 12.4 (or 13.2, 12.1, 12.4 while 13.4 was hidden from getting-started). - Drop CUDA labels the channel has no version for. The page already strikes out any option missing from `version_map`. - When the channel has a CUDA version but the OS has no build for it (13.4 on Windows), publish a "not available" note instead of keeping the previous command, which pointed at a different CUDA version. - A new stable entry is copied from `preview`, so recreate libtorch `versions` when a CUDA entry matches; otherwise a "not available" preview entry left the new release without its download link. Test plan: ran the update-quick-start-module workflow locally (six getting-started matrices from pytorch/test-infra, then `gen_quick_start_module.py --autogenerate`): - With test-infra advertising nightly 13.2 and 13.4: nightly map is `cuda.x=13.2, cuda.y=13.4`, Linux commands use `nightly/cu132` and `nightly/cu134`, Windows 13.4 shows "CUDA 13.4 is not available on Windows". - With test-infra still hiding 13.4: nightly map is `cuda.x=13.2` only. - Release (2.14.1) output is identical to the unpatched script. --- scripts/gen_quick_start_module.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/gen_quick_start_module.py b/scripts/gen_quick_start_module.py index 7654c59ecdf4..1f074da6031c 100755 --- a/scripts/gen_quick_start_module.py +++ b/scripts/gen_quick_start_module.py @@ -107,6 +107,8 @@ def get_package_type(pkg_key: str, os_key: OperatingSystem) -> str: def get_gpu_info(acc_key, instr, acc_arch_map): + if acc_key not in acc_arch_map: + return (None, None) gpu_arch_type, gpu_arch_version = acc_arch_map[acc_key] if DEFAULT in instr: gpu_arch_type, gpu_arch_version = acc_arch_map["accnone"] @@ -146,6 +148,23 @@ def update_versions(versions, release_matrix, release_version): == (package_type, gpu_arch_type, gpu_arch_version) ] + if gpu_arch_type is None: + continue + + # A CUDA version the channel ships but this OS does not (e.g. no + # Windows build): say so instead of keeping a stale command. + if gpu_arch_type == "cuda": + if pkg_arch_matrix: + instr["note"] = None + if package_type == "libtorch" and instr.get("versions") is None: + instr["versions"] = {} + else: + instr["note"] = ( + f"NOTE: CUDA {gpu_arch_version} is not available " + f"on {os_key.capitalize()}" + ) + instr["command" if package_type != "libtorch" else "versions"] = None + if pkg_arch_matrix: if package_type != "libtorch": instr["command"] = pkg_arch_matrix[0]["installation"] @@ -236,8 +255,13 @@ def gen_ver_list(chan, gpu_arch_type): rocm_ver_list = gen_ver_list(chan, "rocm") cuda_list = sorted(cuda_ver_list.values()) acc_arch_ver_map[chan]["rocm5.x"] = ("rocm", max(rocm_ver_list.values())) - for cuda_ver, label in zip(cuda_list, ["cuda.x", "cuda.y", "cuda.z"]): + cuda_labels = ["cuda.x", "cuda.y", "cuda.z"] + for cuda_ver, label in zip(cuda_list, cuda_labels): acc_arch_ver_map[chan][label] = ("cuda", cuda_ver) + # Drop labels the channel has no CUDA version for, so the page strikes + # them out instead of showing the hard-coded defaults. + for label in cuda_labels[len(cuda_list):]: + acc_arch_ver_map[chan].pop(label, None) def main(): From 5144c27edef309682d6252c6f092d23d8699e3cb Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 30 Sep 2026 12:00:16 -0700 Subject: [PATCH 2/2] Hide CUDA boxes the selected channel does not ship The page has three fixed CUDA boxes. For a channel with fewer CUDA versions (nightly now ships 13.2 and 13.4), `changeVersion()` only struck the unused box through: it stayed visible with a stale label, and stayed clickable. Hide CUDA boxes that are not in the channel's `version_map`, widen the visible ones so the CUDA group keeps its 6 of the row's 12 columns (two boxes at `col-md-3`, three at `col-md-2`), and move the selection to the first visible box if the selected one was hidden. ROCm and CPU keep the existing strike-through behaviour. Test plan: generated `assets/quick-start-module.js` from this template with the nightly/release getting-started matrices, then drove it in Node with a minimal DOM/jQuery stand-in (npm is unavailable on the devserver, so no jsdom or browser): - Stable: three boxes, CUDA 12.6 / 13.0 / 13.2, `col-md-2`. - Preview: two boxes, CUDA 13.2 / 13.4, `col-md-3`; third hidden. Commands use `nightly/cu132` and `nightly/cu134`. - Stable with CUDA 13.2 (`cuda.z`) selected, then Preview: selection moves to `cuda.x` and the command follows. With the previous template the struck-out box stayed selected. - Preview, Windows, CUDA 13.4: shows the "not available on Windows" note. --- _includes/quick-start-module.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/_includes/quick-start-module.js b/_includes/quick-start-module.js index 345c1d0434bb..41a155bbd232 100644 --- a/_includes/quick-start-module.js +++ b/_includes/quick-start-module.js @@ -142,17 +142,43 @@ function changeVersion(ptbuild) { var elems = document.querySelectorAll('[id^="'+arch_key+'"]'); for (var i=0; i < elems.length;i++) { if(archMap[elems[i].id]) { + elems[i].style.display = ""; elems[i].style.textDecoration = ""; elems[i].children[0].textContent = info.title + " " + archMap[elems[i].id][1] + } else if (arch_key == "cuda") { + // The channel ships fewer CUDA versions than there are boxes. + elems[i].style.display = "none"; } else { elems[i].style.textDecoration = "line-through"; } } } + layoutCudaOptions(); var stable_element = document.getElementById("stable"); stable_element.children[0].textContent = stable_version; } +// The CUDA boxes share 6 of the row's 12 columns; widen them when some are +// hidden, and move the selection off a hidden box. +function layoutCudaOptions() { + var elems = Array.from(document.querySelectorAll('[id^="cuda"]')); + var visible = elems.filter(function(e) { return e.style.display != "none"; }); + if (visible.length == 0) { + return; + } + var width = "col-md-" + Math.floor(6 / visible.length); + for (var i = 0; i < elems.length; i++) { + elems[i].classList.remove("col-md-2", "col-md-3", "col-md-6"); + elems[i].classList.add(width); + } + var selected = document.getElementById(opts.cuda); + if (selected && selected.style.display == "none") { + $(cuda).removeClass("selected"); + $(visible[0]).addClass("selected"); + opts.cuda = visible[0].id; + } +} + // Change accnone name depending on OS type