Skip to content

Drop unused CUDA entries from preview in published_versions.json - #2140

Merged
atalman merged 3 commits into
pytorch:sitefrom
atalman:preview_drop_unused_cuda
Sep 30, 2026
Merged

atalman merged 3 commits into
pytorch:sitefrom
atalman:preview_drop_unused_cuda

Conversation

@atalman

@atalman atalman commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

After #2139 the page hides CUDA boxes the channel does not ship, but
update_versions only skipped those labels, so preview in
published_versions.json still carried cuda.z with a stale command on every
OS and package.

Add sync_cuda_entries, run before each channel's update:

  • nightly (preview): remove cuda.x/y/z entries the channel has no CUDA
    version for.
  • A new stable is created as a copy of preview, so re-create any label the
    release channel needs from a sibling CUDA entry, in cuda.x/y/z order. The
    existing update then fills in its command. Release entries are never
    dropped.

Test plan: simulated the update-quick-start-module run (getting-started
matrices from pytorch/test-infra main, published_versions.json from site):

  • preview: cuda.z removed for linux/windows/macos, pip and libtorch.
  • 2.14.1 (created from preview in this run): has cuda.x/y/z in order, and
    the whole file is identical to the current generator's output apart from
    the removed preview cuda.z entries.
  • Page logic (Node harness): nightly two boxes, stable three, selection moves
    off the hidden box, as before.
  • sync_cuda_entries edge cases: nightly back to three CUDA versions
    re-adds cuda.z; nightly with one drops cuda.y/cuda.z; release never
    drops entries.

After pytorch#2139 the page hides CUDA boxes the channel does not ship, but
`update_versions` only skipped those labels, so `preview` in
published_versions.json still carried `cuda.z` with a stale command on every
OS and package.

Add `sync_cuda_entries`, run before each channel's update:
- nightly (preview): remove `cuda.x/y/z` entries the channel has no CUDA
  version for.
- A new stable is created as a copy of preview, so re-create any label the
  release channel needs from a sibling CUDA entry, in cuda.x/y/z order. The
  existing update then fills in its command. Release entries are never
  dropped.

Test plan: simulated the update-quick-start-module run (getting-started
matrices from pytorch/test-infra main, published_versions.json from `site`):
- preview: `cuda.z` removed for linux/windows/macos, pip and libtorch.
- 2.14.1 (created from preview in this run): has cuda.x/y/z in order, and
  the whole file is identical to the current generator's output apart from
  the removed preview `cuda.z` entries.
- Page logic (Node harness): nightly two boxes, stable three, selection moves
  off the hidden box, as before.
- `sync_cuda_entries` edge cases: nightly back to three CUDA versions
  re-adds `cuda.z`; nightly with one drops `cuda.y`/`cuda.z`; release never
  drops entries.
@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pytorch-dot-org-preview ready!

Name Link
🔨 Latest commit 38d9544
🔍 Latest deploy log https://app.netlify.com/projects/pytorch-dot-org-preview/deploys/6abd6bddb38a5c0008a2474f
😎 Deploy Preview https://deploy-preview-2140--pytorch-dot-org-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

`sync_cuda_entries` only dropped unused CUDA labels for nightly, so a future
release with two CUDA versions would still have kept a `cuda.z` entry in its
stable version. Drop labels the channel has no CUDA version for on both
channels. The page already hides those boxes for either channel, since
`extract_arch_ver_map` builds `version_map` the same way for nightly and
release.

The number of labels now follows each channel's Linux matrix: three CUDA
versions give cuda.x/y/z, two give cuda.x/y. Only the entry being updated
(preview or the latest stable) changes; older versions keep their labels.

Test plan: simulated the update-quick-start-module run with scratch copies of
pytorch/test-infra:
- Today (nightly 13.2/13.4, release 12.6/13.0/13.2): output identical to the
  previous commit; preview cuda.x/y, 2.14.1 cuda.x/y/z.
- Nightly 2, release 2, new stable 2.15.0: preview and 2.15.0 both cuda.x/y;
  2.14.0 unchanged (cuda.x/y/z).
- Nightly 3, release 2, new stable 2.15.0: preview cuda.x/y/z, 2.15.0 cuda.x/y.
- Release going from 3 to 2 CUDA versions on an existing stable: its
  cuda.z is dropped.
- Page logic (Node harness): with a two-version release, Stable shows two
  boxes at `col-md-3`.
Make `extract_arch_ver_map` follow whatever the getting-started matrices
contain, without silent assumptions:

- Compare versions numerically. As strings, `max("7.2", "7.14")` is "7.2";
  it only worked because test-infra sends one ROCm version per channel.
- If a channel has no ROCm version, drop `rocm5.x` from its map instead of
  crashing on `max()` of an empty list, and publish "Not available for this
  build" rather than a stale command. Existing notes (e.g. "ROCm is not
  available on Windows") are kept, and a stable copied from preview drops
  the generic note once its channel matches a build again.
- The page has three CUDA boxes and test-infra ships at most three CUDA
  versions per channel. Fail with a clear error if that ever changes, instead
  of `zip` silently dropping the newest version.
- Resolve `default` entries (macOS) to CPU before looking up the accelerator,
  so they never depend on which labels a channel has.

Test plan: simulated the update-quick-start-module run.
- Today (nightly 13.2/13.4, release 12.6/13.0/13.2) and the two-version
  release scenarios from the previous commit: output byte-for-byte identical.
- Nightly matrix with the ROCm rows removed: preview linux rocm5.x shows the
  note, Windows/macOS notes unchanged, 2.14.1 identical to today's run.
- Four nightly CUDA versions: fails with "nightly getting-started matrix has
  4 CUDA versions (12.6, 13.0, 13.2, 13.4), but the page has only 3 CUDA
  boxes".
- `extract_arch_ver_map` with CUDA 13.2/13.9/13.10 and ROCm 7.2/7.14: labels
  13.2, 13.9, 13.10 and ROCm 7.14.
@atalman
atalman merged commit b0ac129 into pytorch:site Sep 30, 2026
11 of 13 checks passed

This branch had an error being deployed

1 failed deployment
pytorchbot-env — 38d95446 Deployed Sep 30, 2026 by atalman via update-quick-start #1854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants