Skip to content

fix(install): route Strix to AMD gfx index on ROCm 7.14#7300

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/7280-rocm714-strix-routing
Jul 22, 2026
Merged

fix(install): route Strix to AMD gfx index on ROCm 7.14#7300
danielhanchen merged 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/7280-rocm714-strix-routing

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #7280

Problem

On gfx1150/gfx1151 (Strix Point/Halo) with ROCm 7.14, unsloth studio update still used the old ver < (7, 2) gate in studio/install_python_stack.py. That only rerouted Strix on ROCm 7.1, so ROCm 7.14 hosts stayed on the generic download.pytorch.org/whl/rocm7.2 index instead of AMD's arch-specific wheels (repo.amd.com/rocm/whl/gfx1150/, torch 2.11.0+rocm7.13.0) that carry the real gfx fixes.

The matching install.sh reroute already landed on main via #7293 / #7264.

Fix

  • studio/install_python_stack.py: Replace the ver < (7, 2) gate with _strix_needs_amd_arch_index() / _generic_pytorch_rocm_tag(), which reroute gfx1150/gfx1151 off any generic pytorch.org rocm index below the 7.13 AMD arch floor (mirrors install.sh _rocm_leaf_below). Fixes ROCm 7.14 and stays correct if pytorch.org later ships a generic rocm7.3+ index.
  • tests/studio/install/test_rocm_support.py: Keep the Python-side coverage (test_rocm_714_strix_routes_to_amd_arch_index, helper floor checks).

Verification

pytest tests/studio/install/test_rocm_support.py::TestEnsureRocmTorch::test_rocm_714_strix_routes_to_amd_arch_index -v
pytest tests/studio/install/test_rocm_support.py::TestStrixRocm71Override -v

Compatibility

  • Non-Strix arches on generic rocm7.2 are unchanged (inner gfx detection still gates the reroute).
  • Explicit UNSLOTH_TORCH_INDEX_URL pins remain authoritative and skip auto-reroute.
  • install.sh path is unchanged in this PR (already on main).

When ROCm 7.3+ caps to the generic pytorch.org rocm7.2 index (or the
Radeon repo is unavailable), gfx1150/gfx1151 hosts were left on
torch 2.11+rocm7.2 instead of AMD's arch-specific wheels. Broaden the
Strix reroute in install.sh and studio/install_python_stack.py so
`studio update` repairs the same path as fresh installs (unslothai#7280).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the installation scripts (install.sh and install_python_stack.py) to improve support for AMD Strix Halo and Strix Point GPUs (gfx1151/gfx1150). Specifically, it extends the routing logic to AMD's arch-specific PyTorch index to cover both ROCm 7.1 and ROCm 7.2 environments, rather than just ROCm 7.1. It also introduces a PCI bus check (_amd_gpu_present_via_pci) to detect when an AMD GPU is physically present but ROCm is unable to see it, providing helpful troubleshooting guidance. Corresponding unit tests have been added and updated to verify these changes. There are no review comments to address, so no additional feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 839ba04034

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

_strix_override_pkgs: "tuple[str, str, str] | None" = None
# An explicit ROCm pin is authoritative: never auto-reroute it.
if ver < (7, 2) and _explicit_rocm_torch_index_url() is None:
if _strix_needs_amd_arch_index(ver) and _explicit_rocm_torch_index_url() is None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip Strix override when already on the gfx wheel

On ROCm 7.2+ Strix hosts after this repair has already succeeded, _installed_torch_ver will be a per-arch build such as 2.11.0+rocm7.13.0, but this broadened condition ignores the installed tag and always enters the force-reinstall branch. Since _ensure_rocm_torch() is called in both the check and final phases, every unsloth studio update redownloads/reinstalls the large torch trio and can now fail on a transient repo.amd.com issue instead of no-oping once the AMD gfx wheel is present.

Useful? React with 👍 / 👎.

install.sh and test_previous_torch_pin.sh Strix changes already landed via unslothai#7293/unslothai#7264, so drop them (main is a superset). The remaining fix is studio/install_python_stack.py: replace the ver < (7, 2) gate with _strix_needs_amd_arch_index, which reroutes gfx1150/gfx1151 off any generic pytorch.org rocm index below the 7.13 AMD arch floor. This fixes ROCm 7.14 (unslothai#7280) and stays correct if pytorch.org later adds rocm7.3+. Keep the two Python-side tests; main's install.sh-scoped tests replace the old text-match one.
@danielhanchen

Copy link
Copy Markdown
Member

Rebased on main and trimmed to the part that is still needed.

The install.sh reroute, _amd_gpu_present_via_pci, the PCI-bus hint, and the test_previous_torch_pin.sh grep all already landed in main via #7293 / #7264, so I dropped those (main is a superset there).

What remains is the Studio updater: studio/install_python_stack.py still had the old ver < (7, 2) gate, so unsloth studio update did not reroute Strix on ROCm 7.14 (#7280). I replaced it with _strix_needs_amd_arch_index, which reroutes gfx1150/gfx1151 off any generic pytorch.org rocm index below the 7.13 AMD arch floor. This mirrors install.sh _rocm_leaf_below, fixes 7.14, and stays correct if pytorch.org later ships a generic rocm7.3+ index (the old {rocm7.1, rocm7.2} set would have silently stopped rerouting then).

Kept both Python-side tests; the old install.sh text-match test is superseded by main's test_strix_override_scoped_below_arch_floor. Green and mergeable now.

@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Thanks a lot for cleaning this up and rebasing — really appreciate you taking the time. Glad the studio update path was still useful after the install.sh bits landed elsewhere. Happy for you to merge whenever.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: f1df51c0d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 84b7622 into unslothai:main Jul 22, 2026
37 checks passed
danielhanchen added a commit to Souravrajvi0/unsloth that referenced this pull request Jul 22, 2026
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.

[Bug] Pytorch and BnB versions out of date on latest Studio with RoCM 7.14 official release.

2 participants