Skip to content

Ship a single ROCm version to the nightly getting-started matrix - #8503

Merged
atalman merged 1 commit into
pytorch:mainfrom
atalman:atalman/getting-started-single-rocm
Aug 11, 2026
Merged

Ship a single ROCm version to the nightly getting-started matrix#8503
atalman merged 1 commit into
pytorch:mainfrom
atalman:atalman/getting-started-single-rocm

Conversation

@atalman

@atalman atalman commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

pytorch.org/get-started/locally/ advertises ROCm 7.2 as the nightly ROCm, even though 7.14 is current.

Why

The getting-started page renders exactly one ROCm choice. pytorch.github.io's gen_quick_start_module.py picks which one with a plain max() over version strings:

acc_arch_ver_map[chan]["rocm5.x"] = ("rocm", max(rocm_ver_list.values()))
>>> "7.14" > "7.2"
False                      # '1' < '2' at the third character
>>> max({"7.2", "7.14"})
'7.2'

So once ROCM_ARCHES_DICT["nightly"] became ["7.2", "7.14"], the page started showing the older one. This never bit before because ROCm minors were single-digit; 7.14 is the first two-digit minor.

That is also why pytorch.github.io#2130 landed touching only releases.json and not published_versions.json — the generator recomputed the same rocm7.2 command it already had, so there was no diff. Re-running or re-deploying it would not help.

Fix

Send the page one ROCm version instead of two, chosen with a version-aware key:

if getting_started and channel == NIGHTLY:
    ROCM_ARCHES = [max(ROCM_ARCHES, key=parse_version)]

Fixing it here rather than in the website's max() means the page cannot pick wrong, because it is only ever offered one option.

Scope

Deliberately narrow — getting_started and nightly:

rocm arches
nightly, getting-started ['7.14']
nightly, normal build matrix ['7.2', '7.14'] unchanged
release, getting-started ['7.1', '7.2'] unchanged
test, getting-started ['7.2', '7.14'] unchanged

The binary build matrix is untouched — nightly still builds every ROCm in ROCM_ARCHES_DICT. None of the tools/tests/assets/*.json snapshots use --getting-started, and all are byte-identical.

Verified end to end by replaying the website's own logic against the new matrix:

getting-started=false  rocm_ver_list={'rocm7.2': '7.2', 'rocm7.14': '7.14'}
                       website max() picks -> '7.2'
getting-started=true   rocm_ver_list={'rocm7.14': '7.14'}
                       website max() picks -> '7.14'

Still latent, not addressed here

The release channel getting-started matrix still ships two ROCm versions (7.1, 7.2). It happens to be correct today because "7.2" > "7.1" as strings too — but it will break the same way the moment a double-digit minor reaches release. Same one-line treatment applies whenever you want it; left out to keep this scoped to the reported problem.

Test plan

$ python -m tools.tests.test_generate_binary_build_matrix
Ran 14 tests in 0.005s
OK

Three new tests: parse_version orders 7.14 above 7.2; nightly getting-started yields exactly one ROCm and it is the newest; nightly normal builds still yield every ROCm (guards against this leaking into the build matrix).

mypy, ruff format and usort clean.

The getting-started page renders one ROCm choice. gen_quick_start_module.py
picks it with max() over version strings, and "7.14" < "7.2" lexicographically,
so sending both made pytorch.org advertise ROCm 7.2 as the nightly ROCm after
7.14 landed.

Send only the newest, chosen with a version-aware key. Scoped to
getting-started + nightly: the binary build matrix is untouched, so nightly
still builds every ROCm in ROCM_ARCHES_DICT.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 11, 2026
@atalman
atalman merged commit 434a25d into pytorch:main Aug 11, 2026
38 of 58 checks passed
atalman added a commit that referenced this pull request Aug 18, 2026
#8503 made the nightly (preview) getting-started page advertise a single
ROCm version, chosen as the newest in the channel — which is now
**7.14**. This rolls that back to **7.2** by naming the advertised
version explicitly instead of deriving it from `max()`.

```python
GETTING_STARTED_ROCM_ARCH = "7.2"
...
if getting_started and channel == NIGHTLY:
    ROCM_ARCHES = [
        GETTING_STARTED_ROCM_ARCH
        if GETTING_STARTED_ROCM_ARCH in ROCM_ARCHES
        else max(ROCM_ARCHES, key=parse_version)
    ]
```

Explicit rather than `min()` so the advertised version is a deliberate
choice: bumping the preview page to 7.14 later is a one-line change, and
it does not silently move when the ROCm set rolls forward. The `max()`
fallback keeps the page working if `7.2` is ever dropped from the
nightly arches, so we can't end up advertising an index that doesn't
exist.

## Effect

| matrix | before | after |
|---|---|---|
| nightly getting-started (preview page) | `rocm7.14` | **`rocm7.2`** |
| nightly builds | `rocm7.2`, `rocm7.14` | unchanged |
| test / release channels | unchanged | unchanged |

Only the getting-started matrix is affected — ROCm 7.14 nightlies are
still built, tested and published, just not the version the preview tab
hands to users.

Verified `https://download.pytorch.org/whl/nightly/rocm7.2/torch/`
returns 200, so the advertised command resolves.

## Tests

- `test_getting_started_nightly_ships_one_rocm` now asserts the pinned
version, plus that it is actually present in the nightly arches.
- New `test_getting_started_falls_back_to_newest_rocm` patches the
nightly arches to `["7.14", "8.0"]` and asserts the fallback yields
`8.0`, so the guard branch is covered rather than assumed.

15 passed.

---------

Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants