Skip to content

Unsloth Studio installer (AMD/Linux): explain why a newer ROCm gets ROCm 7.2 PyTorch - #11651

Merged
danielhanchen merged 14 commits into
unslothai:mainfrom
LeoBorcherding:fix/amd-rocm-newer-than-validated-messaging
Sep 27, 2026
Merged

danielhanchen merged 14 commits into
unslothai:mainfrom
LeoBorcherding:fix/amd-rocm-newer-than-validated-messaging

Conversation

@LeoBorcherding

@LeoBorcherding LeoBorcherding commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

a host on ROCm 7.3 or newer gets the newest wheel index we have validated, rocm7.2, and the
installer never said so. it prints the host's real ROCm version a few lines earlier, so the
next line reads as a failed detection: #7264, #10657 and cminnoy's comment on #9932 all open
by quoting that number back at us.

messaging only. no version, ceiling, index or install behaviour change.

--- main ---                      mocked ROCm 7.14 host, gfx1201
index : https://download.pytorch.org/whl/rocm7.2
said  : (nothing)

--- this branch ---
index : https://download.pytorch.org/whl/rocm7.2
said  : [INFO] No PyTorch build is validated for ROCm rocm7.14; installing the closest validated build, rocm7.2.
        [INFO] Those wheels carry their own ROCm runtime and run on a newer host ROCm, so this is expected and needs no fix.
  1. get_torch_index_url names the cap when the table moves a host off its own version.
    phrased on what is validated rather than what is newer, because the 6.x arm clips
    rocm6.5 to rocm6.4 and rocm6.5 is not newer than rocm7.2. silent when the host already
    matches a published leaf. it deliberately does not offer UNSLOTH_TORCH_INDEX_FAMILY as
    a way out: a newer leaf holds nothing inside _TORCH_CEILING, so pinning one fails to
    resolve rather than upgrading.
  2. _radeon_fetch_listing keeps curl's exit code (22, or wget's 8), so "AMD never published
    this release" stops printing as "Radeon repo unavailable", and the message names the
    release that is missing. AMD has nothing past rocm-rel-7.2.4, so on a newer host that
    miss is the normal case, not an outage.

table arms untouched on purpose: test_rocm_bad_arch_gate.sh:480 and
test_rocm_support.py:3087 pin them verbatim, so the case is wrapped rather than rewritten.

not a fix for #10657. that report is half wheel selection (working as designed, now
explained) and half "fine tuning always fails" on 2x R9700, which has no log yet. moving off
torch 2.11 is #9932's scope.

tests

at 354a86a, base f394701, one Windows box through WSL2 Debian.

base head
tests/sh/test_get_torch_index_url.sh 74 passed 83 passed (9 new)
tests/sh/test_radeon_repo_fallback.sh n/a 9 passed (new file)
tests/studio/install/test_rocm_support.py 599 pass / 17 fail same, identical ids
rest of tests/sh (50 suites) — green

mutation-checked, so the new tests bite: dropping the INFO lines fails 5 of the new
assertions, and clearing _RADEON_HOST_ANSWERED on every call fails the stickiness one.

pre-existing on main here and unchanged by this PR: test_rocm_support.py's 17 failures,
test_install_rollback_lifecycle.sh's 6, and test_linux_deps_gate.sh hanging (it wants
apt), which was skipped rather than run.

not run: no AMD Linux host, so the installer never ran end to end and neither message has
been seen in a real install log. the fetch helper was exercised at function level with stubs
only: curl returning 22, 7 and 28, and wget 8 and 4 on a PATH with no curl. index contents
checked live 2026-09-22: repo.radeon.com tops out at rocm-rel-7.2.4 (both 7.14 paths 404),
pytorch.org rocm7.2 serves 2.12.1 / 2.13.0 / 2.14.0, rocm7.14 serves 2.14.0 only. no
hardware matrix: this is version-string and HTTP-status logic with no device dependency.

A host on ROCm 7.3 or newer is capped to the newest wheel index we have
validated, and said nothing about it. The installer printed the host's real
version a few lines earlier, so the next line reads as a failed detection:
unslothai#7264, unslothai#9932 and unslothai#10657 all open by quoting it back at us.

Two messages, no behaviour change:

- get_torch_index_url names the cap when the table moves the host off its own
  version, and says the wheels carry their own ROCm runtime. Phrased on what is
  validated, not on what is newer, because the 6.x arm clips rocm6.5 to rocm6.4
  and rocm6.5 is not newer than rocm7.2. Silent when the host already matches a
  published leaf.

- The Radeon repo fallback separates "AMD never published this release" from
  "the repo is down". _radeon_fetch_listing keeps curl's exit code (22, or
  wget's 8) so a host that answered is not reported as unavailable; AMD
  publishes nothing past rocm-rel-7.2.4 today, so on a newer host the miss is
  the normal case.

The index table's arms are untouched on purpose: test_rocm_bad_arch_gate.sh and
test_rocm_support.py both pin those lines verbatim.
curl is probed first, so the wget arm is only reachable on a host without
curl: PATH holds the stub and bash is called by absolute path.
@LeoBorcherding LeoBorcherding changed the title Say why a newer ROCm host gets rocm7.2 wheels Unsloth Studio installer (AMD/Linux): explain why a newer ROCm gets ROCm 7.2 PyTorch Sep 25, 2026

@LeoBorcherding LeoBorcherding left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex findings, via a mirror

Codex does not answer on this repository, so it ran against a copy of this pull request's commits at LeoBorcherding/unsloth-staging-review#21. It looked at 4f83dc9c6f there, which is this PR's c483d2de3 replayed onto main 1ecc01a30. Nothing was reviewed or resolved on the copy: the findings are here, in Codex's words, to be worked through on this pull request.

1 finding, inline below where the line is on this diff.

Comment thread install.sh Outdated
# curl 22 (-f, HTTP >= 400) and wget 8 (server error response) both mean the host answered
# and refused. Nothing else does: a DNS, TLS or timeout failure exits elsewhere.
case "$_radeon_fetch_rc" in
22|8) _RADEON_HOST_ANSWERED=true ;;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Separate downloader failures before declaring wheels absent

On a curl-equipped host, this treats failures unrelated to a missing release as proof that AMD never published it: curl --manual defines exit 8 as “Weird server reply” and exit 22 as any HTTP error code 400 or above, so responses such as 403, 429, or 503 also set _RADEON_HOST_ANSWERED=true. The later branch then reports repo.radeon.com publishes no ... wheels instead of warning about a malformed response, access failure, rate limit, or outage. Track which downloader ran and inspect the actual HTTP status (in particular, distinguish 404 from other errors) before selecting the not-published message.

Codex's original comment: https://github.com/LeoBorcherding/unsloth-staging-review/pull/21#discussion_r4100017861

@danielhanchen danielhanchen self-assigned this Sep 26, 2026
…$(...)

macOS /bin/sh is bash 3.2, which ends a command substitution at the first bare
pattern) and aborts the script with a syntax error near ';;'. The leading ( is
POSIX and balances the parens.
curl -f exits 22 and wget 8 for any HTTP error, so a 429/5xx outage was
reported as a missing release. Read curl's %{http_code} instead; wget keeps
the unreachable warning.
A 404 on the X.Y.Z path followed by a 503 or transport failure on X.Y left
X.Y unchecked but still reported the release as unpublished. Any inconclusive
attempt now pins the state, so the unreachable warning is kept.
Strix and gfx906 hosts are rerouted after the cap, so 'using rocm7.2 wheels'
was not always true.
@shimmyshimmer

shimmyshimmer commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Review record for #11651, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#163.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror 6e89dd2e3 (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] on install.sh (on the mirror)

@@ -6103,18 +6110,32 @@ get_radeon_wheel_url() {
 _RADEON_LISTING=""
 _RADEON_PYTAG=""
 _RADEON_BASE_URL=""
+# true only while every attempt (X.Y.Z, then X.Y) returned 404/410; any transient failure pins "inconclusive".
+_RADEON_HOST_ANSWERED=false
 
 _radeon_fetch_listing() {
     _RADEON_BASE_URL="$1"
     _RADEON_PYTAG=$("$_VENV_PY" -c "
 import sys
 print('cp{}{}'.format(sys.version_info.major, sys.version_info.minor))
 " 2>/dev/null) || return 1
+    _radeon_http=""
     if command -v curl >/dev/null 2>&1; then
-        _RADEON_LISTING=$(curl -fsSL --max-time 20 "$_RADEON_BASE_URL" 2>/dev/null)
+        _RADEON_LISTING=$(curl -fsSL --max-time 20 -w '\n%{http_code}' "$_RADEON_BASE_URL" 2>/dev/null) || true

P2 Badge Preserve curl failures when parsing HTTP status

When repo.radeon.com times out or resets after sending any HTML, this || true discards curl's nonzero transfer status and the later nonempty-body check makes _radeon_fetch_listing report success. I reproduced this with a 200 response that sent one link and then exceeded --max-time: curl exited 28, yet the helper accepted the truncated listing; this can select an incomplete or older wheel set instead of taking the intended ROCm-index fallback. This matches the locally inspected curl help (--max-time: “Maximum time allowed for transfer”; --write-out: “Use output FORMAT after completion”), so retain the curl exit code and accept the listing only when the transfer completed successfully while separately using the emitted HTTP code for 404/410 classification.

Useful? React with 👍 / 👎.

Accepted on the mirror

Reply from danielhanchen:

Fixed in 63f4152 on the source PR: the curl and wget exit codes are kept and a nonzero transfer drops the listing, so a timeout or reset mid-body now falls through to the inconclusive path. The HTTP code is still used for the 404/410 classification. Covered by three new cases in tests/sh/test_radeon_repo_fallback.sh.

Round 2: reviewed mirror 6e89dd2e3 (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 6e89dd2e34

No triage reaction was recorded on the mirror

Round 3: reviewed mirror 2bcf03a120 (this PR's 63f415242)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2bcf03a120

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 2bcf03a120 (this PR's 63f415242).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Sep 26, 2026
…de suffix

Appending \n%{http_code} stopped command substitution from trimming the
body's trailing newlines, so a newline-only 200 counted as a listing and
skipped the X.Y retry. Restore the base trimming and pin it in a test.
-w still prints the HTTP code after a timeout or reset, so the nonempty
check accepted a truncated listing and could pick an older wheel set.
Keep the transfer exit code and drop the listing when it is nonzero.
@danielhanchen
danielhanchen merged commit 84e97f1 into unslothai:main Sep 27, 2026
60 of 65 checks passed
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…OCm 7.2 PyTorch (unslothai#11651)

* Say why a newer ROCm host gets rocm7.2 wheels

A host on ROCm 7.3 or newer is capped to the newest wheel index we have
validated, and said nothing about it. The installer printed the host's real
version a few lines earlier, so the next line reads as a failed detection:
unslothai#7264, unslothai#9932 and unslothai#10657 all open by quoting it back at us.

Two messages, no behaviour change:

- get_torch_index_url names the cap when the table moves the host off its own
  version, and says the wheels carry their own ROCm runtime. Phrased on what is
  validated, not on what is newer, because the 6.x arm clips rocm6.5 to rocm6.4
  and rocm6.5 is not newer than rocm7.2. Silent when the host already matches a
  published leaf.

- The Radeon repo fallback separates "AMD never published this release" from
  "the repo is down". _radeon_fetch_listing keeps curl's exit code (22, or
  wget's 8) so a host that answered is not reported as unavailable; AMD
  publishes nothing past rocm-rel-7.2.4 today, so on a newer host the miss is
  the normal case.

The index table's arms are untouched on purpose: test_rocm_bad_arch_gate.sh and
test_rocm_support.py both pin those lines verbatim.

* Cover the wget half of the Radeon listing fetch

curl is probed first, so the wget arm is only reachable on a host without
curl: PATH holds the stub and bash is called by absolute path.

* Trim comments on the ROCm cap note and Radeon fallback

* Keep install.sh parseable by bash 3.2: parenthesise case arms inside $(...)

macOS /bin/sh is bash 3.2, which ends a command substitution at the first bare
pattern) and aborts the script with a syntax error near ';;'. The leading ( is
POSIX and balances the parens.

* Shorten the ROCm cap note to one line and the Radeon fallback message

* Radeon fallback: only HTTP 404/410 mean the release is unpublished

curl -f exits 22 and wget 8 for any HTTP error, so a 429/5xx outage was
reported as a missing release. Read curl's %{http_code} instead; wget keeps
the unreachable warning.

* Radeon fallback: unpublished only when every attempt returned 404/410

A 404 on the X.Y.Z path followed by a 503 or transport failure on X.Y left
X.Y unchecked but still reported the release as unpublished. Any inconclusive
attempt now pins the state, so the unreachable warning is kept.

* Cap note: name the capped index, not the wheels finally installed

Strix and gfx906 hosts are rerouted after the cap, so 'using rocm7.2 wheels'
was not always true.

* Trim comments after review

* Drop two comments that restate the code

* Radeon listing: re-strip trailing newlines after removing the http_code suffix

Appending \n%{http_code} stopped command substitution from trimming the
body's trailing newlines, so a newline-only 200 counted as a listing and
skipped the X.Y retry. Restore the base trimming and pin it in a test.

* Radeon listing: reject a body cut off by a curl or wget failure

-w still prints the HTTP code after a timeout or reset, so the nonempty
check accepted a truncated listing and could pick an older wheel set.
Keep the transfer exit code and drop the listing when it is nonzero.

* Drop two test comments that repeat their assertion labels

---------

Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants