Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Detect the Radeon AI PRO R9700 (gfx1201): it carries neither 9070 nor 9080, so name inference found nothing (#8573)
Daniel Han8502cf84c213
diff --git a/.github/workflows/cross-platform-parity-ci.yml b/.github/workflows/cross-platform-parity-ci.ymlindex 77f9d5f3dda..8d9b554508c 100644--- a/.github/workflows/cross-platform-parity-ci.yml+++ b/.github/workflows/cross-platform-parity-ci.yml@@ -71,6 +71,7 @@ on:- 'tests/studio/test_setup_xpu_runtime_prereport.ps1'- 'tests/studio/test_xpu_arm64_torchaudio.ps1'- 'tests/studio/test_amd_venv_repair_loop.ps1'+ - 'tests/studio/test_amd_name_arch_r9700.ps1'- 'tests/sh/test_install_sh_xpu_flavor_probe.sh'- 'tests/sh/test_setup_xpu_fastpath_escape.sh'- 'tests/sh/test_setup_xpu_posix_summary.sh'@@ -120,6 +121,7 @@ on:- 'tests/studio/test_setup_xpu_runtime_prereport.ps1'- 'tests/studio/test_xpu_arm64_torchaudio.ps1'- 'tests/studio/test_amd_venv_repair_loop.ps1'+ - 'tests/studio/test_amd_name_arch_r9700.ps1'- 'tests/sh/test_install_sh_xpu_flavor_probe.sh'- 'tests/sh/test_setup_xpu_fastpath_escape.sh'- 'tests/sh/test_setup_xpu_posix_summary.sh'@@ -227,6 +229,11 @@ jobs:if: runner.os == 'Windows'shell: powershellrun: powershell -NoProfile -File tests\studio\test_amd_venv_repair_loop.ps1+ # Slices the shipped $nameArchTable out of install.ps1 and setup.ps1 and resolves GPU+ # names through PowerShell's own -match, so no venv, no AMD GPU and no Windows needed.+ - name: AMD GPU-name arch table tests+ shell: pwsh+ run: pwsh -NoProfile -File tests/studio/test_amd_name_arch_r9700.ps1- name: POSIX rollback lifecycle testsif: runner.os == 'Linux'run: sh tests/sh/test_install_rollback_lifecycle.shdiff --git a/install.ps1 b/install.ps1index 9edee13fe04..a54bcd579ea 100644--- a/install.ps1+++ b/install.ps1@@ -3344,7 +3344,7 @@ exit 0# (gfx120X/110X/1151/1150/103X); unknown names fall back to CPU.elseif ($ROCmGpuLabel) {$nameArchTable = @(- @{ P = "9070|9080"; A = "gfx1201" } # RDNA 4 (Navi 48: RX 9070 XT / 9070 GRE / 9070 / 9080)+ @{ P = "9070|9080|R9700"; A = "gfx1201" } # RDNA 4 (Navi 48: RX 9070 XT / 9070 GRE / 9070 / 9080, Radeon AI PRO R9700)@{ P = "9060"; A = "gfx1200" } # RDNA 4 (Navi 44: RX 9060 XT / 9060)@{ P = "8065S|8060S|8050S|8040S|Strix Halo|Ryzen AI Max|AI Max"; A = "gfx1151" } # RDNA 3.5 (Strix Halo + Gorgon Halo: Radeon 8065S/8060S/8050S/8040S iGPU, Ryzen AI Max / Max+)@{ P = "890M|880M|Strix Point|HX 37[05]|AI 9 HX|AI 9 36[05]"; A = "gfx1150" } # RDNA 3.5 (Strix Point: Radeon 890M/880M, Ryzen AI 9 HX 370/375)diff --git a/install.sh b/install.shindex 4872bc17360..da6216a4bbb 100755--- a/install.sh+++ b/install.sh@@ -2866,7 +2866,7 @@ _amd_arch_index_family_for_gfx() {# Map a GPU marketing name to gfx arch (kept in sync with install.ps1 nameArchTable)._infer_amd_gfx_arch_from_gpu_name() {case "$1" in- *9070*|*9080*) echo gfx1201 ;;+ *9070*|*9080*|*"R9700"*) echo gfx1201 ;;*9060*) echo gfx1200 ;;*"8065S"*|*"8060S"*|*"8050S"*|*"8040S"*|*"Strix Halo"*|*"Ryzen AI Max"*|*"AI Max"*) echo gfx1151 ;;*"890M"*|*"880M"*|*"Strix Point"*|*"HX 37"*|*"AI 9 HX"*|*"AI 9 36"*) echo gfx1150 ;;@@ -4383,7 +4383,7 @@ elif case "$TORCH_INDEX_URL" in */rocm*|*/gfx*) true ;; *) false ;; esac; then# gfx1102 matched BEFORE gfx1100 so the spaceless "RX 7700S" lands on# gfx1102 (bash case has no negative lookahead like the PS tables).case "$_gpu_disp_mkt" in- *9070*|*9080*) _gpu_disp_gfx="gfx1201" ;; # RDNA 4 (Navi 48)+ *9070*|*9080*|*"R9700"*) _gpu_disp_gfx="gfx1201" ;; # RDNA 4 (Navi 48: RX 9070 / 9080, Radeon AI PRO R9700)*9060*) _gpu_disp_gfx="gfx1200" ;; # RDNA 4 (Navi 44)*"8065S"*|*"8060S"*|*"8050S"*|*"8040S"*|*"Strix Halo"*|*"Ryzen AI Max"*|*"AI Max"*) _gpu_disp_gfx="gfx1151" ;; # RDNA 3.5 (Strix Halo + Gorgon Halo: Radeon 8065S/8060S/8050S/8040S iGPU, Ryzen AI Max / Max+)*"890M"*|*"880M"*|*"Strix Point"*|*"HX 37"*|*"AI 9 HX"*|*"AI 9 36"*) _gpu_disp_gfx="gfx1150" ;; # RDNA 3.5 (Strix Point: Radeon 890M/880M, Ryzen AI 9 HX 370/375)diff --git a/studio/install_python_stack.py b/studio/install_python_stack.pyindex 4a4a890c8e2..a80133c1d9c 100644--- a/studio/install_python_stack.py+++ b/studio/install_python_stack.py@@ -979,7 +979,10 @@ def _detect_windows_gfx_arch() -> str | None:# prebuilts / AMD Windows torch indexes support; unknown names return None# (callers then fall back cleanly to CPU)._WIN_GPU_NAME_ARCH_TABLE: "list[tuple[str, str]]" = [- (r"9070|9080", "gfx1201"), # RDNA 4 (Navi 48: Radeon RX 9070 XT / 9070 GRE / 9070 / 9080)+ # RDNA 4 (Navi 48: Radeon RX 9070 XT / 9070 GRE / 9070 / 9080, Radeon AI PRO R9700).+ # R9700 is listed separately: its name holds neither 9070 nor 9080, so it matched+ # nothing and fell through to CPU torch (#7624, #7307).+ (r"9070|9080|R9700", "gfx1201"),(r"9060", "gfx1200"), # RDNA 4 (Navi 44: Radeon RX 9060 XT / 9060)# RDNA 3.5 (Strix Halo + Gorgon Halo: Radeon 8065S/8060S/8050S/8040S iGPU, Ryzen AI Max / Max+)(r"8065S|8060S|8050S|8040S|Strix Halo|Ryzen AI Max|AI Max", "gfx1151"),diff --git a/studio/setup.ps1 b/studio/setup.ps1index 4cb257830d5..4f399d18085 100644--- a/studio/setup.ps1+++ b/studio/setup.ps1@@ -2420,7 +2420,7 @@ if (-not $HasNvidiaSmi) {# (gfx120X/110X/1151/1150/103X); unknown names fall back cleanly to CPU.elseif ($ROCmGpuLabel) {$nameArchTable = @(- @{ P = "9070|9080"; A = "gfx1201" } # RDNA 4 (Navi 48: Radeon RX 9070 XT / 9070 GRE / 9070 / 9080)+ @{ P = "9070|9080|R9700"; A = "gfx1201" } # RDNA 4 (Navi 48: Radeon RX 9070 XT / 9070 GRE / 9070 / 9080, Radeon AI PRO R9700)@{ P = "9060"; A = "gfx1200" } # RDNA 4 (Navi 44: Radeon RX 9060 XT / 9060)@{ P = "8065S|8060S|8050S|8040S|Strix Halo|Ryzen AI Max|AI Max"; A = "gfx1151" } # RDNA 3.5 (Strix Halo + Gorgon Halo: Radeon 8065S/8060S/8050S/8040S iGPU, Ryzen AI Max / Max+)@{ P = "890M|880M|Strix Point|HX 37[05]|AI 9 HX|AI 9 36[05]"; A = "gfx1150" } # RDNA 3.5 (Strix Point: Radeon 890M/880M, Ryzen AI 9 HX 370/375)diff --git a/studio/setup.sh b/studio/setup.shindex a84e7fa3199..262fca38639 100755--- a/studio/setup.sh+++ b/studio/setup.sh@@ -1842,7 +1842,7 @@ elif [ "$_setup_amd_detected" = true ]; then# gfx1102 matched BEFORE gfx1100 so the spaceless "RX 7700S" lands on# gfx1102 (bash case has no negative lookahead like the PS tables).case "$_setup_mkt" in- *9070*|*9080*) _setup_gfx="gfx1201" ;; # RDNA 4 (Navi 48)+ *9070*|*9080*|*"R9700"*) _setup_gfx="gfx1201" ;; # RDNA 4 (Navi 48: RX 9070 / 9080, Radeon AI PRO R9700)*9060*) _setup_gfx="gfx1200" ;; # RDNA 4 (Navi 44)*"8065S"*|*"8060S"*|*"8050S"*|*"8040S"*|*"Strix Halo"*|*"Ryzen AI Max"*|*"AI Max"*) _setup_gfx="gfx1151" ;; # RDNA 3.5 (Strix Halo + Gorgon Halo: Radeon 8065S/8060S/8050S/8040S iGPU, Ryzen AI Max / Max+)*"890M"*|*"880M"*|*"Strix Point"*|*"HX 37"*|*"AI 9 HX"*|*"AI 9 36"*) _setup_gfx="gfx1150" ;; # RDNA 3.5 (Strix Point: Radeon 890M/880M, Ryzen AI 9 HX 370/375)diff --git a/tests/studio/install/test_rocm_arch_table_parity.py b/tests/studio/install/test_rocm_arch_table_parity.pyindex 9429abe9a23..6bbb3238c9e 100644--- a/tests/studio/install/test_rocm_arch_table_parity.py+++ b/tests/studio/install/test_rocm_arch_table_parity.py@@ -292,6 +292,10 @@ def _match_ps(rows: list[tuple[str, str]], gpu_name: str) -> str | None:_GPU_NAME_LEAF_CASES = [("AMD Radeon RX 9070 XT", "gfx120X-all"),("AMD Radeon RX 9070", "gfx120X-all"),+ # Workstation Navi 48, gfx1201 per rocminfo in #7624 / #7307. Its name holds neither+ # "9070" nor "9080", so every table returned None and a host without the HIP SDK, where+ # name inference is the only path left, got CPU torch ("not detected", PR #8398).+ ("AMD Radeon AI PRO R9700", "gfx120X-all"),("AMD Radeon RX 9060 XT", "gfx120X-all"),("AMD Radeon 8060S Graphics", "gfx1151"),("AMD Ryzen AI Max+ 395 w/ Radeon 8060S Graphics", "gfx1151"),@@ -334,6 +338,9 @@ _AMD_DOCUMENTED_ARCH = {"AMD Radeon RX 9070": "gfx1201","AMD Radeon RX 9060 XT": "gfx1200","AMD Radeon RX 9060": "gfx1200",+ # Navi 48 again, as the R9000 series workstation card. Sourced from the reporters'+ # own rocminfo output (#7624, #7307), not from these tables.+ "AMD Radeon AI PRO R9700": "gfx1201",# RDNA 3 -- Navi 31 / 32 / 33."AMD Radeon RX 7900 XTX": "gfx1100","AMD Radeon PRO W7900": "gfx1100",@@ -470,6 +477,23 @@ class TestGpuNameArchParity:got = _resolve(where, rows, "NVIDIA GeForce RTX 4090")assert got is None, f"{where}: RTX 4090 matched {got!r}"+ @pytest.mark.parametrize(+ "gpu_name",+ [+ "ATI Radeon 9700 PRO",+ "ATI Radeon 9800 PRO",+ "AMD Radeon R9 Fury X",+ "AMD Radeon Pro WX 9100",+ ],+ )+ def test_the_r9700_arm_does_not_swallow_older_cards(self, gpu_name):+ """The arm is spelled "R9700", not a bare "9700": ATI shipped a Radeon 9700 PRO in+ 2002 and the loose token would hand that card RDNA 4 wheels. None of these pre-RDNA+ names may resolve to anything."""+ for where, rows in _name_tables().items():+ got = _resolve(where, rows, gpu_name)+ assert got is None, f"{where}: {gpu_name!r} matched {got!r}"+def test_inferred_arch_always_has_an_index_family(self):"""Every arch a name table can produce must be routable to an AMD wheelindex, else detection succeeds and the install still lands on CPU torch."""diff --git a/tests/studio/install/test_rocm_support.py b/tests/studio/install/test_rocm_support.pyindex 0b9ceeb3a56..4e0f0424244 100644--- a/tests/studio/install/test_rocm_support.py+++ b/tests/studio/install/test_rocm_support.py@@ -3707,6 +3707,10 @@ class TestGfxArchNameFallback:("AMD Ryzen AI 9 HX 370 w/ Radeon 890M", "gfx1150"),("AMD Radeon RX 9070 XT", "gfx1201"),("AMD Radeon RX 9070", "gfx1201"), # Navi 48 like the XT, not Navi 44+ # Navi 48 workstation card, gfx1201 per #7624 / #7307. Its name holds neither+ # "9070" nor "9080", so it matched nothing and the install fell back to CPU.+ ("AMD Radeon AI PRO R9700", "gfx1201"),+ ("ATI Radeon 9700 PRO", None), # a bare "9700" arm would claim this 2002 card("AMD Radeon RX 9060 XT", "gfx1200"), # Navi 44("AMD Radeon RX 7700S", "gfx1102"), # (?!S) lookahead must not hit gfx1101("AMD Radeon RX 7700 XT", "gfx1101"), # Navi 32diff --git a/tests/studio/test_amd_name_arch_r9700.ps1 b/tests/studio/test_amd_name_arch_r9700.ps1new file mode 100644index 00000000000..57899b86c0e--- /dev/null+++ b/tests/studio/test_amd_name_arch_r9700.ps1@@ -0,0 +1,117 @@+#!/usr/bin/env pwsh+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+# Behavioural test for the $nameArchTable GPU-name -> gfx inference in install.ps1 and+# studio/setup.ps1, on the Radeon AI PRO R9700 (Navi 48, gfx1201; issues #7624 and #7307).+# Its name holds neither "9070" nor "9080", so on a host with no HIP SDK the table returned+# nothing and the installer fell back to CPU torch ("GPU not detected").+# The Python parity suite evaluates these rows with Python's re; this runs them through+# PowerShell's own -match, the engine that actually ships.+# Run: pwsh -NoProfile -File tests/studio/test_amd_name_arch_r9700.ps1++$ErrorActionPreference = "Stop"+$root = (Resolve-Path ([System.IO.Path]::Combine($PSScriptRoot, "..", ".."))).Path++$failures = 0+function Check($name, $cond) {+ if ($cond) { Write-Host " PASS $name" }+ else { Write-Host " FAIL $name" -ForegroundColor Red; $script:failures++ }+}++# Returns the shipped `$nameArchTable = @( ... )` literal, sliced on balanced parens so the+# rows under test are the ones in the file rather than a copy pasted into this test.+function Get-NameArchTableSource($path) {+ # CRLF normalised: these installers ship with Windows line endings, else every+ # source-text match below silently misses.+ $src = (Get-Content -Raw $path) -replace "`r`n", "`n"+ $start = $src.IndexOf('$nameArchTable = @(')+ if ($start -lt 0) { throw "$path : `$nameArchTable = @( was not found (renamed or restructured?)" }+ $i = $src.IndexOf("(", $start)+ $depth = 0+ while ($i -lt $src.Length) {+ if ($src[$i] -eq "(") { $depth++ }+ elseif ($src[$i] -eq ")") { $depth--; if ($depth -eq 0) { return $src.Substring($start, $i - $start + 1) } }+ $i+++ }+ throw "$path : unterminated `$nameArchTable"+}++# First-match-wins, exactly as both installers consume the table.+function Resolve-Arch($table, $name) {+ foreach ($row in $table) { if ($name -match $row.P) { return $row.A } }+ return $null+}++# The card as its reporters saw it, plus the spellings WMI and amd-smi vary between.+$r9700Names = @(+ "AMD Radeon AI PRO R9700",+ "AMD Radeon(TM) AI PRO R9700",+ "Radeon AI PRO R9700",+ "AMD Radeon AI PRO R9700 32GB"+)++# Every other name the table already answers for, so the new alternation is shown not to+# steal a neighbour's row, plus names that must keep resolving to nothing. The ATI Radeon+# 9700 PRO is why the pattern is "R9700" and not a bare "9700": that 2002 card would match+# a loose token and be handed RDNA 4 wheels.+$otherNames = @(+ @{ N = "AMD Radeon RX 9070 XT"; A = "gfx1201" },+ @{ N = "AMD Radeon RX 9070 GRE"; A = "gfx1201" },+ @{ N = "AMD Radeon RX 9060 XT"; A = "gfx1200" },+ @{ N = "AMD Radeon 8060S Graphics"; A = "gfx1151" },+ @{ N = "AMD Radeon 890M Graphics"; A = "gfx1150" },+ @{ N = "AMD Radeon 860M Graphics"; A = "gfx1152" },+ @{ N = "AMD Radeon RX 7900 XTX"; A = "gfx1100" },+ @{ N = "AMD Radeon PRO W7900"; A = "gfx1100" },+ @{ N = "AMD Radeon RX 7800 XT"; A = "gfx1101" },+ @{ N = "AMD Radeon PRO V710"; A = "gfx1101" },+ @{ N = "AMD Radeon RX 7700S"; A = "gfx1102" },+ @{ N = "AMD Radeon PRO W7600"; A = "gfx1102" },+ @{ N = "AMD Radeon 780M Graphics"; A = "gfx1103" },+ @{ N = "AMD Radeon RX 6900 XT"; A = "gfx1030" },+ @{ N = "AMD Radeon RX 6600 XT"; A = "gfx1032" },+ @{ N = "AMD Radeon RX 6500 XT"; A = "gfx1034" },+ @{ N = "ATI Radeon 9700 PRO"; A = $null },+ @{ N = "ATI Radeon 9800 PRO"; A = $null },+ @{ N = "AMD Radeon R9 Fury X"; A = $null },+ @{ N = "AMD Radeon RX 5700 XT"; A = $null },+ @{ N = "AMD Radeon Pro WX 9100"; A = $null },+ @{ N = "AMD Instinct MI300X"; A = $null },+ @{ N = "NVIDIA GeForce RTX 4090"; A = $null },+ @{ N = "Microsoft Basic Display Adapter"; A = $null }+)++foreach ($file in @("install.ps1", "studio/setup.ps1")) {+ $path = Join-Path $root $file+ Write-Host ""+ Write-Host "=== $file ==="++ $tableSrc = Get-NameArchTableSource $path+ $nameArchTable = $null+ Invoke-Expression ("`$nameArchTable = " + $tableSrc.Substring($tableSrc.IndexOf("@(")))+ # Guard against a vacuous pass: an empty or truncated slice resolves everything to+ # $null, so every negative case below would "pass".+ Check "the shipped nameArchTable was found and parsed" ($nameArchTable -and $nameArchTable.Count -ge 12)+ Check "every parsed row has a pattern and an arch" (@($nameArchTable | Where-Object { -not $_.P -or -not $_.A }).Count -eq 0)++ foreach ($name in $r9700Names) {+ Check "'$name' -> gfx1201" ((Resolve-Arch $nameArchTable $name) -eq "gfx1201")+ }+ foreach ($row in $otherNames) {+ $got = Resolve-Arch $nameArchTable $row.N+ if ($null -eq $row.A) { Check "'$($row.N)' still matches nothing" ($null -eq $got) }+ else { Check "'$($row.N)' -> $($row.A)" ($got -eq $row.A) }+ }++ # The alternation must live on the gfx1201 arm specifically: an arm added anywhere would+ # also resolve correctly today, but a later one gets shadowed the day another row grows+ # a pattern that matches first.+ $gfx1201Rows = @($nameArchTable | Where-Object { $_.A -eq "gfx1201" })+ Check "exactly one gfx1201 arm" ($gfx1201Rows.Count -eq 1)+ Check "the gfx1201 arm carries R9700" ($gfx1201Rows[0].P -match "R9700")+ Check "no other arm carries R9700" (@($nameArchTable | Where-Object { $_.A -ne "gfx1201" -and $_.P -match "R9700" }).Count -eq 0)+}++Write-Host ""+if ($failures -gt 0) { Write-Host "$failures check(s) FAILED" -ForegroundColor Red; exit 1 }+Write-Host "All checks passed" -ForegroundColor Greendiff --git a/tests/test_windows_amd_gpu_scan_fallback.py b/tests/test_windows_amd_gpu_scan_fallback.pyindex 988a101e8bb..7e29611fb0a 100644--- a/tests/test_windows_amd_gpu_scan_fallback.py+++ b/tests/test_windows_amd_gpu_scan_fallback.py@@ -39,6 +39,7 @@ requires_pwsh = pytest.mark.skipif(shutil.which("pwsh") is None, reason = "Power_RADEON = "AMD Radeon(TM) 8060S Graphics" # Strix Halo iGPU -> gfx1151_RX9070 = "AMD Radeon RX 9070 XT" # RDNA 4 discrete -> gfx1201_R780M = "AMD Radeon 780M Graphics" # Phoenix iGPU -> gfx1103, a shadowing arch+_R9700 = "AMD Radeon AI PRO R9700" # RDNA 4 workstation -> gfx1201 (#7624, #7307)_ARC = "Intel(R) Arc(TM) A770 Graphics"HANDOFF = "_UNSLOTH_ROCM_GFX_ARCH_HANDOFF"@@ -322,6 +323,8 @@ def test_the_adapter_name_reaches_inference_whole(tmp_path):[(_RADEON, "gfx1151"),(_RX9070, "gfx1201"),+ (_R9700, "gfx1201"),+ ("ATI Radeon 9700 PRO", None),("AMD Radeon RX 9060 XT", "gfx1200"),("AMD Radeon 890M Graphics", "gfx1150"),("AMD Radeon 860M Graphics", "gfx1152"),@@ -496,6 +499,15 @@ def test_the_installer_keeps_a_parked_adapter_when_it_is_the_only_one(tmp_path):assert out["arch"] == "gfx1201"+@requires_pwsh+def test_a_lone_r9700_is_detected_by_both_scans(tmp_path):+ """Reported on PR #8398: single R9700 on Windows 11, not detected. One healthy adapter+ and no HIP SDK, so the name is the only evidence left, and it holds neither "9070" nor+ "9080". Both scans must reach gfx1201 (#7624, #7307) or the install lands on CPU torch."""+ assert _run(tmp_path, [(_R9700, 0)])["arch"] == "gfx1201"+ assert _run_installer_scan(tmp_path, [(_R9700, 0)])["arch"] == "gfx1201"++@requires_pwshdef test_the_installer_and_setup_agree_on_which_adapter_is_active(tmp_path):"""The handoff is only sound because both scans start from the same healthy set."""