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
Unsloth Studio (AMD): floor torch at 2.11 on the gfx103X-all and gfx110X-all families too (#11834)
Leo Borcherding4ff930acbd33
diff --git a/install.ps1 b/install.ps1index 5b955ac2648..c90a1deab54 100644--- a/install.ps1+++ b/install.ps1@@ -9590,17 +9590,35 @@ exit 0"gfx1201" = "torch>=2.11.0,<2.12.0"; "gfx1200" = "torch>=2.11.0,<2.12.0""gfx1151" = "torch>=2.11.0,<2.12.0"; "gfx1150" = "torch>=2.11.0,<2.12.0""gfx1152" = "torch>=2.11.0,<2.12.0"+ "gfx1030" = "torch>=2.11.0,<2.12.0"; "gfx1031" = "torch>=2.11.0,<2.12.0"+ "gfx1032" = "torch>=2.11.0,<2.12.0"; "gfx1033" = "torch>=2.11.0,<2.12.0"+ "gfx1034" = "torch>=2.11.0,<2.12.0"; "gfx1035" = "torch>=2.11.0,<2.12.0"+ "gfx1036" = "torch>=2.11.0,<2.12.0"; "gfx1100" = "torch>=2.11.0,<2.12.0"+ "gfx1101" = "torch>=2.11.0,<2.12.0"; "gfx1102" = "torch>=2.11.0,<2.12.0"+ "gfx1103" = "torch>=2.11.0,<2.12.0"}# Companions track the torch ceiling for a consistent trio on AMD's per-arch index.$torchvisionFloorMap = @{"gfx1201" = "torchvision>=0.26.0,<0.27.0"; "gfx1200" = "torchvision>=0.26.0,<0.27.0""gfx1151" = "torchvision>=0.26.0,<0.27.0"; "gfx1150" = "torchvision>=0.26.0,<0.27.0""gfx1152" = "torchvision>=0.26.0,<0.27.0"+ "gfx1030" = "torchvision>=0.26.0,<0.27.0"; "gfx1031" = "torchvision>=0.26.0,<0.27.0"+ "gfx1032" = "torchvision>=0.26.0,<0.27.0"; "gfx1033" = "torchvision>=0.26.0,<0.27.0"+ "gfx1034" = "torchvision>=0.26.0,<0.27.0"; "gfx1035" = "torchvision>=0.26.0,<0.27.0"+ "gfx1036" = "torchvision>=0.26.0,<0.27.0"; "gfx1100" = "torchvision>=0.26.0,<0.27.0"+ "gfx1101" = "torchvision>=0.26.0,<0.27.0"; "gfx1102" = "torchvision>=0.26.0,<0.27.0"+ "gfx1103" = "torchvision>=0.26.0,<0.27.0"}$torchaudioFloorMap = @{"gfx1201" = "torchaudio>=2.11.0,<2.12.0"; "gfx1200" = "torchaudio>=2.11.0,<2.12.0""gfx1151" = "torchaudio>=2.11.0,<2.12.0"; "gfx1150" = "torchaudio>=2.11.0,<2.12.0""gfx1152" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1030" = "torchaudio>=2.11.0,<2.12.0"; "gfx1031" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1032" = "torchaudio>=2.11.0,<2.12.0"; "gfx1033" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1034" = "torchaudio>=2.11.0,<2.12.0"; "gfx1035" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1036" = "torchaudio>=2.11.0,<2.12.0"; "gfx1100" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1101" = "torchaudio>=2.11.0,<2.12.0"; "gfx1102" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1103" = "torchaudio>=2.11.0,<2.12.0"}$archFamily = if ($ROCmGfxArch -and $archFamilyMap.ContainsKey($ROCmGfxArch)) { $archFamilyMap[$ROCmGfxArch] } else { $null }if ($archFamily) {@@ -9629,8 +9647,8 @@ exit 0# Only KNOWN-2.11 rocm (rocm7.2) gets the floor. Matches Test-RocmKnown211Version.$_pinRocm211 = ([int]$Matches[1] -eq 7 -and [int]$Matches[2] -eq 2)}- # Only the 2.11-allowlist gfx arches need the floor; others publish <2.11 and stay bare.- $_pinGfx211 = @('gfx120x-all', 'gfx1151', 'gfx1150', 'gfx1152') -contains $_pinLeaf+ # Only the 2.11-allowlist gfx arches need the floor (gfx908 / gfx90a stay bare).+ $_pinGfx211 = @('gfx120x-all', 'gfx1151', 'gfx1150', 'gfx1152', 'gfx103x-all', 'gfx110x-all') -contains $_pinLeafif ($_pinGfx211 -or $_pinRocm211) {$ROCmIndexUrl = $TorchIndexUrl$ROCmTorchFloor = "torch>=2.11.0,<2.12.0"diff --git a/install.sh b/install.shindex 21c40637034..fab0e9bf5ca 100755--- a/install.sh+++ b/install.sh@@ -5921,7 +5921,7 @@ if [ "$_torch_index_pinned" = false ] && [ "$SKIP_TORCH" = false ] && \fi# Off the family, not the arch: no family straddles this boundary.case "$_amd_family" in- gfx120X-all|gfx1151|gfx1150|gfx1152)+ gfx120X-all|gfx1151|gfx1150|gfx1152|gfx103X-all|gfx110X-all)TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0"TORCHVISION_CONSTRAINT="torchvision>=0.26.0,<0.27.0"TORCHAUDIO_CONSTRAINT="torchaudio>=2.11.0,<2.12.0"@@ -6008,7 +6008,7 @@ fi# rocm7.2 and per-gfx indexes ship torch 2.11.0: raise the floor, matching the FINAL leaf only.case "$_torch_index_leaf" in- rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152)+ rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152|gfx103x-all|gfx110x-all)TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0"TORCHVISION_CONSTRAINT="torchvision>=0.26.0,<0.27.0"TORCHAUDIO_CONSTRAINT="torchaudio>=2.11.0,<2.12.0"diff --git a/studio/backend/tests/test_rocm_torch_explicit_request.py b/studio/backend/tests/test_rocm_torch_explicit_request.pyindex db413444d12..60b290fc092 100644--- a/studio/backend/tests/test_rocm_torch_explicit_request.py+++ b/studio/backend/tests/test_rocm_torch_explicit_request.py@@ -2538,11 +2538,12 @@ def test_the_suffixed_arch_reaches_that_branch_at_all(stack, monkeypatch):assert _inferred_install_args(stack, monkeypatch, "gfx1151:xnack-")[email protected]("arch", ["gfx1102:xnack-", "gfx1030:sramecc-"])[email protected]("arch", ["gfx90a:sramecc+:xnack-", "gfx908:xnack-"])def test_an_arch_outside_the_pin_table_is_still_bounded(stack, monkeypatch, arch):"""The suffix strip opens this branch for archs the pin table does not name, and the fallbackwas three bare package names: those hosts reached an arch-index install with no companion- bound at all, where every other arch-index install carries one."""+ bound at all, where every other arch-index install carries one. gfx103X / gfx110X joined the+ pin table with unslothai/unsloth#11814, so CDNA is what is left outside it."""assert _inferred_install_args(stack, monkeypatch, arch) == list(stack._ROCM_ARCH_INDEX_TORCH_PKG_SPEC)diff --git a/studio/install_python_stack.py b/studio/install_python_stack.pyindex 169fc1800ba..f29d8e0c27f 100644--- a/studio/install_python_stack.py+++ b/studio/install_python_stack.py@@ -249,9 +249,10 @@ def _torch_below_211(installed_ver: str) -> bool:# AMD per-arch leaves needing the torch 2.11 floor (the _grouped_mm <2.11 bug).-# Mirrors *FloorMap in install.ps1 / setup.ps1; other arches ship <2.11 and stay bare.+# Mirrors *FloorMap in install.ps1 / setup.ps1 (unslothai/unsloth#11814).+# gfx908 / gfx90a stay bare on purpose: no Windows wheels; Linux floors them via the rocm7.2 index._ROCM_GFX_TORCH211_LEAVES: frozenset[str] = frozenset(- {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152"}+ {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152", "gfx103x-all", "gfx110x-all"})# rocmX.Y indexes KNOWN to ship torch 2.11; never floor an unknown newer rocm.@@ -285,6 +286,17 @@ _WINDOWS_ROCM_TORCH_PKG_SPECS: dict[str, tuple[str, str, str]] = {"gfx1151": _ROCM_TORCH_PKG_SPECS["rocm7.2"],"gfx1150": _ROCM_TORCH_PKG_SPECS["rocm7.2"],"gfx1152": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1030": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1031": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1032": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1033": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1034": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1035": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1036": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1100": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1101": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1102": _ROCM_TORCH_PKG_SPECS["rocm7.2"],+ "gfx1103": _ROCM_TORCH_PKG_SPECS["rocm7.2"],}# Bound companion versions for ABI compatibility while retaining older per-arch mirror builds._ROCM_ARCH_INDEX_TORCH_PKG_SPEC: tuple[str, str, str] = (@@ -3995,7 +4007,7 @@ def _rocm_pin_family_mismatch(pin_url: str, installed_ver: str) -> bool:# Decisive the other way too, on leaves with no floor. The heuristic below reads any# 2.11 build as a mismatch, since that is what a build from some OTHER index looks# like -- but these leaves serve 2.11 as well, and the family says this one came from- # the pinned index. Without it a correctly pinned gfx110X host force-reinstalls under+ # the pinned index. Without it a correctly pinned gfx90a host force-reinstalls under# the legacy torch<2.11 cap on every update.if _family is not None and _inst_is_perarch:return Falsediff --git a/studio/setup.ps1 b/studio/setup.ps1index 705a25e46f4..e02316a3382 100644--- a/studio/setup.ps1+++ b/studio/setup.ps1@@ -1484,7 +1484,7 @@ function Get-IndexIdentity {# _grouped_mm bug: these leaves need the torch 2.11 floor. Must match the other installers.function Test-RocmGfx211Leaf {param([string]$Leaf)- return @('gfx120x-all', 'gfx1151', 'gfx1150', 'gfx1152') -contains $Leaf+ return @('gfx120x-all', 'gfx1151', 'gfx1150', 'gfx1152', 'gfx103x-all', 'gfx110x-all') -contains $Leaf}# rocm7.2 only; never floor an unknown newer rocm. Matches _ROCM_KNOWN_TORCH211_VERSIONS.@@ -7590,24 +7590,42 @@ $ROCmIndexUrl = $null# Also on a name-inferred gfx: the wheels bundle the runtime, so no HIP SDK is needed.if (-not $TorchIndexPinned -and ($HasROCm -or $ROCmGfxArch) -and $CuTag -eq "cpu") {$amdIndexBase = if ($env:UNSLOTH_ROCM_WINDOWS_MIRROR) { $env:UNSLOTH_ROCM_WINDOWS_MIRROR.TrimEnd('/') } else { "https://repo.amd.com/rocm/whl" }- # gfx120X and Strix have a null _grouped_mm kernel on torch <2.11.0.+ # gfx120X, Strix, gfx103X, gfx110X: null _grouped_mm kernel on torch <2.11.0 (unslothai/unsloth#11814).# Mirrors the $torchFloorMap in install.ps1 so both installers enforce# the same floor and ceiling when pulling from AMD's per-arch index.$torchFloorMap = @{"gfx1201" = "torch>=2.11.0,<2.12.0"; "gfx1200" = "torch>=2.11.0,<2.12.0""gfx1151" = "torch>=2.11.0,<2.12.0"; "gfx1150" = "torch>=2.11.0,<2.12.0""gfx1152" = "torch>=2.11.0,<2.12.0"+ "gfx1030" = "torch>=2.11.0,<2.12.0"; "gfx1031" = "torch>=2.11.0,<2.12.0"+ "gfx1032" = "torch>=2.11.0,<2.12.0"; "gfx1033" = "torch>=2.11.0,<2.12.0"+ "gfx1034" = "torch>=2.11.0,<2.12.0"; "gfx1035" = "torch>=2.11.0,<2.12.0"+ "gfx1036" = "torch>=2.11.0,<2.12.0"; "gfx1100" = "torch>=2.11.0,<2.12.0"+ "gfx1101" = "torch>=2.11.0,<2.12.0"; "gfx1102" = "torch>=2.11.0,<2.12.0"+ "gfx1103" = "torch>=2.11.0,<2.12.0"}# Companions bounded to the torch ceiling for a consistent trio (AMD publishes each alone).$torchvisionFloorMap = @{"gfx1201" = "torchvision>=0.26.0,<0.27.0"; "gfx1200" = "torchvision>=0.26.0,<0.27.0""gfx1151" = "torchvision>=0.26.0,<0.27.0"; "gfx1150" = "torchvision>=0.26.0,<0.27.0""gfx1152" = "torchvision>=0.26.0,<0.27.0"+ "gfx1030" = "torchvision>=0.26.0,<0.27.0"; "gfx1031" = "torchvision>=0.26.0,<0.27.0"+ "gfx1032" = "torchvision>=0.26.0,<0.27.0"; "gfx1033" = "torchvision>=0.26.0,<0.27.0"+ "gfx1034" = "torchvision>=0.26.0,<0.27.0"; "gfx1035" = "torchvision>=0.26.0,<0.27.0"+ "gfx1036" = "torchvision>=0.26.0,<0.27.0"; "gfx1100" = "torchvision>=0.26.0,<0.27.0"+ "gfx1101" = "torchvision>=0.26.0,<0.27.0"; "gfx1102" = "torchvision>=0.26.0,<0.27.0"+ "gfx1103" = "torchvision>=0.26.0,<0.27.0"}$torchaudioFloorMap = @{"gfx1201" = "torchaudio>=2.11.0,<2.12.0"; "gfx1200" = "torchaudio>=2.11.0,<2.12.0""gfx1151" = "torchaudio>=2.11.0,<2.12.0"; "gfx1150" = "torchaudio>=2.11.0,<2.12.0""gfx1152" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1030" = "torchaudio>=2.11.0,<2.12.0"; "gfx1031" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1032" = "torchaudio>=2.11.0,<2.12.0"; "gfx1033" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1034" = "torchaudio>=2.11.0,<2.12.0"; "gfx1035" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1036" = "torchaudio>=2.11.0,<2.12.0"; "gfx1100" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1101" = "torchaudio>=2.11.0,<2.12.0"; "gfx1102" = "torchaudio>=2.11.0,<2.12.0"+ "gfx1103" = "torchaudio>=2.11.0,<2.12.0"}$archFamily = if ($ROCmGfxArch -and $archFamilyMap.ContainsKey($ROCmGfxArch)) { $archFamilyMap[$ROCmGfxArch] } else { $null }$ROCmTorchSpec = if ($ROCmGfxArch -and $torchFloorMap.ContainsKey($ROCmGfxArch)) { $torchFloorMap[$ROCmGfxArch] } else { "torch" }diff --git a/tests/python/test_cross_platform_parity.py b/tests/python/test_cross_platform_parity.pyindex 7bb1b4dac62..abef3e82485 100644--- a/tests/python/test_cross_platform_parity.py+++ b/tests/python/test_cross_platform_parity.py@@ -348,7 +348,7 @@ class TestGfx211AllowlistParity:gfx1152 (Krackan Point) turned this class red without any installeractually disagreeing with another."""- EXPECTED = {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152"}+ EXPECTED = {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152", "gfx103x-all", "gfx110x-all"}@staticmethoddef _leaves(blob: str) -> set[str]:diff --git a/tests/sh/test_rocm_no_version_arch_route.sh b/tests/sh/test_rocm_no_version_arch_route.shindex e1e87d94625..33e9bc1dc2e 100644--- a/tests/sh/test_rocm_no_version_arch_route.sh+++ b/tests/sh/test_rocm_no_version_arch_route.sh@@ -309,7 +309,7 @@ assert_contains "same-family pair still announces the per-arch route" "routiassert_contains "same-family pair names the family, not a card" "gfx120X-all" "$_w"assert_eq "the export is guarded on a single named card" "yes" "$(grep -q 'export UNSLOTH_ROCM_GFX_ARCH="\$_linux_inferred_gfx"' "$INSTALL_SH" && grep -c 'if \[ -n "\$_linux_inferred_gfx" \]; then' "$INSTALL_SH" >/dev/null && echo yes || echo no)"-assert_eq "the torch constraint is chosen off the family" "yes" "$(grep -q 'gfx120X-all|gfx1151|gfx1150|gfx1152)' "$INSTALL_SH" && echo yes || echo no)"+assert_eq "the torch constraint is chosen off the family" "yes" "$(grep -q 'gfx120X-all|gfx1151|gfx1150|gfx1152|gfx103X-all|gfx110X-all)' "$INSTALL_SH" && echo yes || echo no)"# HIP reports gfx1201:sramecc+:xnack-, which no arm of the index case table matches; get_torch_index_url strips the suffix# and then promises per-arch wheels, so anything downstream that does not strip it strands the host on CPU.diff --git a/tests/studio/install/test_amd_fastpath_probe.py b/tests/studio/install/test_amd_fastpath_probe.pyindex 6adb124b83d..d2b92f1a5a9 100644--- a/tests/studio/install/test_amd_fastpath_probe.py+++ b/tests/studio/install/test_amd_fastpath_probe.py@@ -622,8 +622,9 @@ def test_a_matching_family_below_its_torch_floor_forces_the_pass(monkeypatch):def test_a_leaf_with_no_torch_floor_keeps_the_fast_path_below_211(monkeypatch):"""Only the leaves in _ROCM_GFX_TORCH211_LEAVES have that bug; the rest ship <2.11 builds- and are correct as they are, so the floor must not be applied to them."""- _rocm_torch(monkeypatch, family = "gfx110x-all", gfx = ("gfx1103",))+ and are correct as they are, so the floor must not be applied to them. gfx110X-all joined+ the allowlist with unslothai/unsloth#11814, so gfx90a is the leaf left without a floor."""+ _rocm_torch(monkeypatch, family = "gfx90a", gfx = ("gfx90a",))monkeypatch.setattr(stack, "_probe_torch_runtime", lambda: (True, True, "2.10.0+rocm7.13.0", "7.13", ""))diff --git a/tests/studio/install/test_installed_family_hermeticity.py b/tests/studio/install/test_installed_family_hermeticity.pyindex a5c8f198e7a..96be50b7f6d 100644--- a/tests/studio/install/test_installed_family_hermeticity.py+++ b/tests/studio/install/test_installed_family_hermeticity.py@@ -202,9 +202,10 @@ def test_pinning_the_pair_makes_this_machine_irrelevant(host):def test_the_installed_family_decides_the_skip(family, torch_owns_rocm, expect_reinstall):"""The other half: without this, pinning both to None would satisfy the test above whilethe feature they gate quietly stopped working."""+ # 2.11.0: gfx110X-all is floored, so a 2.10 build would reinstall for the floor.with ambient("bare"):calls = _route(- "gfx1103", "2.10.0+rocm7.13.0|7.13|", family = family, torch_owns_rocm = torch_owns_rocm+ "gfx1103", "2.11.0+rocm7.13.0|7.13|", family = family, torch_owns_rocm = torch_owns_rocm)rerouted = "repo.amd.com/rocm/whl/gfx110X-all/" in callsassert rerouted is expect_reinstall, (diff --git a/tests/studio/install/test_missing_kernel_arch_routing_9396.py b/tests/studio/install/test_missing_kernel_arch_routing_9396.pyindex 670e67be9d2..125de6a95fc 100644--- a/tests/studio/install/test_missing_kernel_arch_routing_9396.py+++ b/tests/studio/install/test_missing_kernel_arch_routing_9396.py@@ -195,13 +195,16 @@ def test_the_reroute_is_not_gated_on_the_rocm_version_floor():assert f"{_AMD}/gfx110X-all/" in calls, calls-def test_the_companion_pins_are_bounded_but_not_floored_at_211():- """Bound companion versions without excluding older per-arch mirror builds."""+def test_the_companion_pins_carry_the_211_floor_on_a_grouped_mm_leaf():+ """gfx110X-all joined the torch 2.11 allowlist with unslothai/unsloth#11814 (its 2.10 build+ access-violates in _grouped_mm), so the reroute installs the floored trio; every companion+ stays bounded above, so none can drift to a different torch major."""calls = _run_install(gfx_devices = ("gfx1103",))- for spec in stack_mod._ROCM_ARCH_INDEX_TORCH_PKG_SPEC:+ for spec in stack_mod._ROCM_TORCH_PKG_SPECS["rocm7.2"]:assert spec in calls, (spec, calls)- assert "torch>=2.11.0" not in calls, calls- # Every companion is bounded above, so none can drift to a different torch major.+ assert "torch>=2.11.0" in calls, calls+ assert all("<" in spec for spec in stack_mod._ROCM_TORCH_PKG_SPECS["rocm7.2"])+ # The bounded-but-unfloored spec is still what a leaf outside the allowlist would get.assert all("<" in spec for spec in stack_mod._ROCM_ARCH_INDEX_TORCH_PKG_SPEC)diff --git a/tests/studio/install/test_rocm_arch_table_parity.py b/tests/studio/install/test_rocm_arch_table_parity.pyindex 541e3d73eb8..b5cf86861b6 100644--- a/tests/studio/install/test_rocm_arch_table_parity.py+++ b/tests/studio/install/test_rocm_arch_table_parity.py@@ -678,11 +678,11 @@ class TestNoUnregisteredArchTable:class TestTorch211PinAllowlistParity:- """gfx120X-all / gfx1151 / gfx1150 / gfx1152 (and rocm7.2) ship the null+ """gfx120X-all / gfx1151 / gfx1150 / gfx1152 / gfx103X-all / gfx110X-all (and rocm7.2) ship the null_grouped_mm kernel below torch 2.11, so all three installers must raise thesame floor. A leaf missing from one copy reintroduces the crash there."""- _EXPECTED = {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152"}+ _EXPECTED = {"gfx120x-all", "gfx1151", "gfx1150", "gfx1152", "gfx103x-all", "gfx110x-all"}def test_install_sh_pins_the_same_leaves(self):source = _INSTALL_SH.read_text(encoding = "utf-8")diff --git a/tests/studio/install/test_rocm_support.py b/tests/studio/install/test_rocm_support.pyindex a1dab177fa9..4c06112434e 100644--- a/tests/studio/install/test_rocm_support.py+++ b/tests/studio/install/test_rocm_support.py@@ -1395,15 +1395,19 @@ GPU: 2# (no reinstall loop once the correct gfx wheel is present).assert f(f"{amd}/gfx120X-all", "2.11.0+rocm7.13.0") is Falseassert f(f"{amd}/gfx1150", "2.11.0+rocm7.13.0") is False- # A NON-2.11 gfx pin (gfx110X-all/gfx90a/gfx908) tracks the default <2.11 spec: a+ # A NON-2.11 gfx pin (gfx90a/gfx908) tracks the default <2.11 spec: a# correct 2.10+rocm wheel is NOT a mismatch, a 2.11 build is.- assert f(f"{amd}/gfx110X-all", "2.10.0+rocm6.4") is Falseassert f(f"{amd}/gfx90a", "2.10.0+rocm6.3") is Falseassert f(f"{amd}/gfx908", "2.10.0+rocm7.0") is False- assert f(f"{amd}/gfx110X-all", "2.11.0+rocm7.2") is True+ assert f(f"{amd}/gfx90a", "2.11.0+rocm7.2") is True+ # gfx103X-all / gfx110X-all are floored: a 2.10 per-arch build IS a mismatch.+ assert f(f"{amd}/gfx103X-all", "2.10.0+rocm7.13.0") is True+ assert f(f"{amd}/gfx110X-all", "2.10.0+rocm6.4") is True+ assert f(f"{amd}/gfx103X-all", "2.11.0+rocm7.13.0") is False+ assert f(f"{amd}/gfx110X-all", "2.11.0+rocm7.13.0") is False# A non-2.11 gfx pin over an untagged (no +rocm) wheel is a mismatch even# when torch is already <2.11: a CPU/CUDA build never satisfies the ROCm pin.- assert f(f"{amd}/gfx110X-all", "2.10.0") is True+ assert f(f"{amd}/gfx908", "2.10.0") is Trueassert f(f"{amd}/gfx90a", "2.10.0") is True# A major-only rocm pin (rocm7) compares on the major alone: rocm6.x mismatches,# any rocm7.x satisfies it, an untagged wheel never does, a bare +rocm is lenient.@@ -1509,13 +1513,13 @@ GPU: 2def test_non211_gfx_pin_over_210_rocm_no_reinstall(self, mock_ver, mock_gpu, mock_nvidia, mock_pip, mock_pip_try):- """A gfx110X-all pin (NOT in the 2.11 allowlist) over a correct 2.10+rocm+ """A gfx90a pin (NOT in the 2.11 allowlist) over a correct 2.10+rocmwheel must NOT be flagged stale -- the install path uses the default <2.11specs for that arch, so re-flagging would reinstall-loop on every update."""mock_probe = MagicMock()mock_probe.returncode = 0mock_probe.stdout = _MARK + "2.10.0+rocm6.4|6.4.12345|\n"- env = {"UNSLOTH_TORCH_INDEX_URL": "https://repo.amd.com/rocm/whl/gfx110X-all"}+ env = {"UNSLOTH_TORCH_INDEX_URL": "https://repo.amd.com/rocm/whl/gfx90a"}with patch.dict(stack_mod.os.environ, env, clear = False):stack_mod.os.environ.pop("UNSLOTH_TORCH_INDEX_FAMILY", None)with patch("os.path.isdir", return_value = True):@@ -6931,14 +6935,15 @@ class TestStrixRocm71Override:source = _INSTALL_SH_PATH.read_text(encoding = "utf-8")# The 2.11 constraint block must switch on $_torch_index_leaf, not the full# $TORCH_INDEX_URL (a */gfx* match false-positives on a mirror base path). Only the- # _grouped_mm-bug gfx families (gfx120X-all / gfx1151 / gfx1150 / gfx1152) go to 2.11;- # a bare gfx* would also floor gfx110X-all/gfx90a/gfx908, left bare on purpose.+ # _grouped_mm-bug gfx families (gfx120X-all / gfx1151 / gfx1150 / gfx1152 /+ # gfx103X-all / gfx110X-all) go to 2.11; a bare gfx* would also floor+ # gfx90a/gfx908, left bare on purpose.assert (- 'case "$_torch_index_leaf" in\n rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152)'+ 'case "$_torch_index_leaf" in\n rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152|gfx103x-all|gfx110x-all)'in source), ("the torch>=2.11 constraint must match the specific gfx leaves that need "- "it (rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152), not a bare gfx* or the URL"+ "it (rocm7.2|gfx120x-all|gfx1151|gfx1150|gfx1152|gfx103x-all|gfx110x-all), not a bare gfx* or the URL")def test_amd_rocm_mirror_env_var_respected(self):diff --git a/tests/studio/install/test_windows_amd_torch_floor_11814.py b/tests/studio/install/test_windows_amd_torch_floor_11814.pynew file mode 100644index 00000000000..330f5ff149a--- /dev/null+++ b/tests/studio/install/test_windows_amd_torch_floor_11814.py@@ -0,0 +1,106 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+"""unslothai/unsloth#11814: every Windows AMD family gets the torch 2.11 floor.++install.ps1 keeps a venv's existing torch release on reinstall (Get-PreviousTorchPin)+unless the arch has a ROCm floor to veto it. With the floor on five arches only, a+gfx103X-all venv from an earlier install stayed on 2.10.0+rocm7.13.0, whose _grouped_mm+access-violates on an RX 6500 XT and takes `import unsloth` down with it. What this file+pins: the Windows-routed RDNA arches all carry the 2.11 trio in the python repair map, the+two PowerShell installers carry the same keys with the same specs, and the 2.11-allowlist+leaves agree with the family map for those arches.+"""++import importlib.util+import re+import sys+from pathlib import Path++import pytest++PACKAGE_ROOT = Path(__file__).resolve().parents[3]+_STACK_PY = PACKAGE_ROOT / "studio" / "install_python_stack.py"+_INSTALL_PS1 = PACKAGE_ROOT / "install.ps1"+_SETUP_PS1 = PACKAGE_ROOT / "studio" / "setup.ps1"+++def _load_stack_module():+ spec = importlib.util.spec_from_file_location(+ "studio_install_python_stack_floor_11814", _STACK_PY+ )+ assert spec is not None and spec.loader is not None+ mod = importlib.util.module_from_spec(spec)+ sys.modules[spec.name] = mod+ spec.loader.exec_module(mod)+ return mod+++stack_mod = _load_stack_module()++# The families whose per-arch index has Windows wheels and a sub-2.11 build with the bug.+_FLOORED_FAMILIES = {"gfx103X-all", "gfx110X-all", "gfx1150", "gfx1151", "gfx1152", "gfx120X-all"}+_RDNA_WINDOWS_ARCHES = sorted(+ gfx for gfx, fam in stack_mod._GFX_TO_AMD_INDEX_ARCH.items() if fam in _FLOORED_FAMILIES+)+_TRIO = stack_mod._ROCM_TORCH_PKG_SPECS["rocm7.2"]+++def _ps_map(path, name):+ src = path.read_text(encoding = "utf-8")+ m = re.search(r"\$" + name + r"\s*=\s*@\{(.*?)\n\s*\}", src, re.DOTALL)+ assert m, f"{path.name}: ${name} not found"+ return dict(re.findall(r'"(gfx[0-9a-z]+)"\s*=\s*"([^"]+)"', m.group(1)))+++class TestPythonRepairMap:+ def test_the_arches_under_test_are_real(self):+ assert "gfx1034" in _RDNA_WINDOWS_ARCHES and "gfx1103" in _RDNA_WINDOWS_ARCHES++ @pytest.mark.parametrize("gfx", _RDNA_WINDOWS_ARCHES)+ def test_every_windows_rdna_arch_pins_the_211_trio(self, gfx):+ assert stack_mod._WINDOWS_ROCM_TORCH_PKG_SPECS.get(gfx) == _TRIO, f"{gfx} has no 2.11 floor"++ def test_the_trio_is_the_211_floor(self):+ torch_spec, vision_spec, audio_spec = _TRIO+ assert torch_spec.startswith("torch>=2.11.0,<2.12.0")+ assert vision_spec.startswith("torchvision>=0.26.0,<0.27.0")+ assert audio_spec.startswith("torchaudio>=2.11.0,<2.12.0")++ @pytest.mark.parametrize("gfx", _RDNA_WINDOWS_ARCHES)+ def test_the_family_leaf_is_in_the_211_allowlist(self, gfx):+ """The stale/mismatch checks key on the family leaf, the install on the arch: a+ floor in one and not the other reinstalls every update or never repairs."""+ leaf = stack_mod._GFX_TO_AMD_INDEX_ARCH[gfx].lower()+ assert (+ leaf in stack_mod._ROCM_GFX_TORCH211_LEAVES+ ), f"{gfx} -> {leaf} not in the 2.11 allowlist"++ def test_cdna_stays_bare(self):+ """gfx908 / gfx90a: no Windows wheels, unmeasured; Linux reaches them via the+ floored rocm7.2 index. Deliberately not in the allowlist."""+ assert "gfx908" not in stack_mod._ROCM_GFX_TORCH211_LEAVES+ assert "gfx90a" not in stack_mod._ROCM_GFX_TORCH211_LEAVES+ assert "gfx908" not in stack_mod._WINDOWS_ROCM_TORCH_PKG_SPECS+++class TestPowerShellMirrorsTheFloor:+ @pytest.mark.parametrize("path", [_INSTALL_PS1, _SETUP_PS1], ids = lambda p: p.name)+ def test_same_keys_and_specs_in_all_three_maps(self, path):+ torch_map = _ps_map(path, "torchFloorMap")+ vision_map = _ps_map(path, "torchvisionFloorMap")+ audio_map = _ps_map(path, "torchaudioFloorMap")+ expected = set(stack_mod._WINDOWS_ROCM_TORCH_PKG_SPECS)+ assert (+ set(torch_map) == expected+ ), f"{path.name}: torchFloorMap keys {sorted(set(torch_map) ^ expected)}"+ assert set(vision_map) == expected and set(audio_map) == expected+ for gfx in expected:+ assert (torch_map[gfx], vision_map[gfx], audio_map[gfx]) == _TRIO, f"{path.name}: {gfx}"++ @pytest.mark.parametrize("path", [_INSTALL_PS1, _SETUP_PS1], ids = lambda p: p.name)+ def test_the_211_allowlist_names_the_same_leaves(self, path):+ src = path.read_text(encoding = "utf-8")+ m = re.search(r"@\('gfx120x-all'[^)]*\)", src)+ assert m, f"{path.name}: 2.11 allowlist literal not found"+ leaves = set(re.findall(r"'([^']+)'", m.group(0)))+ assert leaves == set(stack_mod._ROCM_GFX_TORCH211_LEAVES), f"{path.name}: {sorted(leaves)}"diff --git a/tests/studio/test_setup_pin_stale.ps1 b/tests/studio/test_setup_pin_stale.ps1index 2c92ae317f6..626e9506e74 100644--- a/tests/studio/test_setup_pin_stale.ps1+++ b/tests/studio/test_setup_pin_stale.ps1@@ -41,7 +41,8 @@ Write-Host "Test-RocmGfx211Leaf (the 2.11 gfx allowlist)"Check "gfx1151 -> true" (Test-RocmGfx211Leaf "gfx1151")Check "gfx1150 -> true" (Test-RocmGfx211Leaf "gfx1150")Check "gfx120x-all -> true" (Test-RocmGfx211Leaf "gfx120x-all")-Check "gfx110x-all -> false" (-not (Test-RocmGfx211Leaf "gfx110x-all"))+Check "gfx103x-all -> true" (Test-RocmGfx211Leaf "gfx103x-all")+Check "gfx110x-all -> true" (Test-RocmGfx211Leaf "gfx110x-all")Check "gfx90a -> false" (-not (Test-RocmGfx211Leaf "gfx90a"))Check "gfx908 -> false" (-not (Test-RocmGfx211Leaf "gfx908"))@@ -77,14 +78,18 @@ Check "gfx1150 pin + 2.11.0+rocm7.13.0 -> not stale" (-not (IsStale "gfx1150"Check "gfx120x-all pin + 2.11.0+rocm7.13.0 -> not stale" (-not (IsStale "gfx120x-all" "2.11.0+rocm7.13.0"))Check "gfx1151 pin + 2.11.0+rocm7.2 (generic) -> stale" (IsStale "gfx1151" "2.11.0+rocm7.2")Check "gfx1151 pin + 2.10.0+rocm6.4 -> stale" (IsStale "gfx1151" "2.10.0+rocm6.4")-# Non-2.11 gfx pin (gfx110X-all/gfx90a/gfx908): a valid <2.11 wheel is NOT stale.-Check "gfx110x-all pin + 2.10.0+rocm6.4 -> not stale" (-not (IsStale "gfx110x-all" "2.10.0+rocm6.4"))+# Non-2.11 gfx pin (gfx90a/gfx908): a valid <2.11 wheel is NOT stale.Check "gfx90a pin + 2.10.0+rocm6.3 -> not stale" (-not (IsStale "gfx90a" "2.10.0+rocm6.3"))Check "gfx908 pin + 2.10.0+rocm7.0 -> not stale" (-not (IsStale "gfx908" "2.10.0+rocm7.0"))-Check "gfx110x-all pin + 2.11.0+rocm7.2 -> stale" (IsStale "gfx110x-all" "2.11.0+rocm7.2")+Check "gfx90a pin + 2.11.0+rocm7.2 -> stale" (IsStale "gfx90a" "2.11.0+rocm7.2")+# gfx103X-all / gfx110X-all are floored: a 2.10 per-arch build IS stale.+Check "gfx103x-all pin + 2.10.0+rocm7.13.0 -> stale" (IsStale "gfx103x-all" "2.10.0+rocm7.13.0")+Check "gfx110x-all pin + 2.10.0+rocm6.4 -> stale" (IsStale "gfx110x-all" "2.10.0+rocm6.4")+Check "gfx103x-all pin + 2.11.0+rocm7.13.0 -> not stale" (-not (IsStale "gfx103x-all" "2.11.0+rocm7.13.0"))+Check "gfx110x-all pin + 2.11.0+rocm7.13.0 -> not stale" (-not (IsStale "gfx110x-all" "2.11.0+rocm7.13.0"))# Non-2.11 gfx pin over an untagged wheel: never satisfies the pin -> stale, so the# explicit ROCm index is applied even when torch is already <2.11.-Check "gfx110x-all pin + 2.10.0 (untagged) -> stale" (IsStale "gfx110x-all" "2.10.0")+Check "gfx908 pin + 2.10.0 (untagged) -> stale" (IsStale "gfx908" "2.10.0")Check "gfx90a pin + 2.10.0 (untagged) -> stale" (IsStale "gfx90a" "2.10.0")# Capital gfx120X-all is lowercased by Get-TorchIndexLeaf before this helper, so the# 2.11-allowlist branch fires and a generic/untagged wheel is stale.