Skip to content

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.

Studio (AMD, Windows): pin the multi-arch ROCm torch to rocm7.14.0, whose fused attention works (#12670)

Daniel Hane54e4fa81e5f
diff --git a/install.ps1 b/install.ps1
index 9b96ede9ac8..b122f1073af 100644
--- a/install.ps1
+++ b/install.ps1
@@ -10003,7 +10003,8 @@ main()
"gfx1200", "gfx1201" # RDNA 4
)
$MultiArchIndexBase = if ($env:UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR) { $env:UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR.TrimEnd('/') } else { "https://repo.amd.com/rocm/whl-multi-arch" }
- $MultiArchTag = "rocm7.14.1"
+ # Not rocm7.14.1: its Windows wheels ship a mismatched AOTriton runtime, so fused SDPA fails (ROCm/TheRock#7992).
+ $MultiArchTag = "rocm7.14.0"
$MultiArchTorchVersion = "2.11.0"
$MultiArchTorchvisionVersion = "0.26.0"
$MultiArchTorchaudioVersion = "2.11.0"
diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py
index f68169b8bb5..80db869e25f 100644
--- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -307,13 +307,15 @@ _WINDOWS_ROCM_TORCH_PKG_SPECS: dict[str, tuple[str, str, str]] = {
"gfx1103": _ROCM_TORCH_PKG_SPECS["rocm7.2"],
}
# Windows RDNA arches install from AMD's multi-arch index (#11815, #11614): one URL, card picked by the
-# torch[device-gfxNNNN] extra, pinned to the newest tag inside <2.12.0 so nothing is kept (#11814).
-# The family map stays for family-layout mirrors and the stale / mismatch classifiers. Linux unchanged.
+# torch[device-gfxNNNN] extra, pinned to one exact tag inside <2.12.0 so nothing is kept (#11814).
+# Not rocm7.14.1: its Windows wheels pair an AOTriton 0.12 runtime with 0.13 kernels, so fused SDPA fails
+# (ROCm/TheRock#7992). The family map stays for family-layout mirrors and the classifiers. Linux unchanged.
_ROCM_WINDOWS_MULTIARCH_INDEX_BASE = (
os.environ.get("UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR")
or "https://repo.amd.com/rocm/whl-multi-arch"
)
-_ROCM_MULTIARCH_TAG = "rocm7.14.1"
+_ROCM_MULTIARCH_TAG = "rocm7.14.0"
+_ROCM_MULTIARCH_BROKEN_TAGS = frozenset({"rocm7.14.1"})
_ROCM_MULTIARCH_TORCH_VERSION = "2.11.0"
_ROCM_MULTIARCH_TORCHVISION_VERSION = "0.26.0"
_ROCM_MULTIARCH_TORCHAUDIO_VERSION = "2.11.0"
@@ -6086,6 +6088,17 @@ def _ensure_rocm_torch() -> "bool | None":
"AMD's multi-arch index"
)
_torch_already_rocm = False
+ if (
+ _torch_already_rocm
+ and _win_rocm_pin is None
+ and _windows_routes_multiarch(gfx_arch)
+ and (_version or "").lower().rpartition("+")[2] in _ROCM_MULTIARCH_BROKEN_TAGS
+ ):
+ _safe_print(
+ f" installed ROCm torch {_version} cannot run fused attention -- reinstalling "
+ f"{_ROCM_MULTIARCH_TORCH_VERSION}+{_ROCM_MULTIARCH_TAG}"
+ )
+ _torch_already_rocm = False
# A multi-arch route is judged by its packs alone: a migrated venv keeps the orphaned family runtime.
if (
_torch_already_rocm
diff --git a/studio/setup.ps1 b/studio/setup.ps1
index a412c9c2fa4..cf63e07ef1f 100644
--- a/studio/setup.ps1
+++ b/studio/setup.ps1
@@ -4198,7 +4198,8 @@ $multiArchGfx = @(
"gfx1200", "gfx1201" # RDNA 4
)
$MultiArchIndexBase = if ($env:UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR) { $env:UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR.TrimEnd('/') } else { "https://repo.amd.com/rocm/whl-multi-arch" }
-$MultiArchTag = "rocm7.14.1"
+# Not rocm7.14.1: its Windows wheels ship a mismatched AOTriton runtime, so fused SDPA fails (ROCm/TheRock#7992).
+$MultiArchTag = "rocm7.14.0"
$MultiArchTorchVersion = "2.11.0"
$MultiArchTorchvisionVersion = "0.26.0"
$MultiArchTorchaudioVersion = "2.11.0"
diff --git a/tests/studio/install/test_rdna1_multiarch_windows_route_11614.py b/tests/studio/install/test_rdna1_multiarch_windows_route_11614.py
index e4608f38f05..2a4432d8e18 100644
--- a/tests/studio/install/test_rdna1_multiarch_windows_route_11614.py
+++ b/tests/studio/install/test_rdna1_multiarch_windows_route_11614.py
@@ -57,6 +57,11 @@ class TestPackageSpecs:
"""A nightly tag (rocmX.Y.ZaYYYYMMDD) moves under users."""
assert re.fullmatch(r"rocm\d+\.\d+\.\d+", stack_mod._ROCM_MULTIARCH_TAG)
+ def test_the_pin_avoids_the_windows_build_with_broken_fused_attention(self):
+ """rocm7.14.1 Windows wheels ship an AOTriton 0.12 runtime with 0.13 kernel images, so every
+ flash / memory-efficient SDPA call fails with hipErrorInvalidValue (ROCm/TheRock#7992, #7315)."""
+ assert stack_mod._ROCM_MULTIARCH_TAG != "rocm7.14.1"
+
def test_the_pin_sits_inside_the_windows_torch_window(self):
"""install.ps1 applies torch<2.12.0 everywhere else on Windows."""
major, minor, _ = (int(x) for x in stack_mod._ROCM_MULTIARCH_TORCH_VERSION.split("."))
@@ -307,6 +312,43 @@ class TestTheWindowsRepairSiteRunsForRdna1:
if installs:
assert "torch[device-gfx1010]" in " ".join(str(a) for a in pip_try.call_args.args)
+ @pytest.mark.parametrize(
+ "installed,installs",
+ [("2.11.0+rocm7.14.1", 1), ("2.11.0+rocm7.14.0", 0), ("2.11.0+ROCm7.14.1", 1)],
+ )
+ def test_a_build_with_broken_fused_attention_is_replaced(
+ self, installed, installs, monkeypatch
+ ):
+ # Standalone `studio update` on a venv from the old rocm7.14.1 pin: the device packs are
+ # there, so only the build tag says it must move to the current pin.
+ from unittest.mock import MagicMock, patch
+
+ _mark = stack_mod._TORCH_PROBE_MARKER
+ probe = MagicMock(returncode = 0, stdout = _mark + installed + "|7.14.60850|" + chr(10))
+ pip_try = MagicMock(return_value = True)
+ monkeypatch.setattr(stack_mod, "_TORCH_RUNTIME_PROBE", None)
+ monkeypatch.delenv("UNSLOTH_ROCM_TORCH_INSTALLED", raising = False)
+ monkeypatch.delenv("UNSLOTH_ROCM_WINDOWS_MULTIARCH_MIRROR", raising = False)
+ with (
+ patch.object(stack_mod, "IS_WINDOWS", True),
+ patch.object(stack_mod, "IS_MACOS", False),
+ patch.object(stack_mod, "_TORCH_BACKEND", ""),
+ patch.object(stack_mod, "_explicit_rocm_torch_index_url", return_value = None),
+ patch.object(stack_mod, "_explicit_unknown_family_torch_index_url", return_value = None),
+ patch.object(stack_mod, "_has_usable_nvidia_gpu", return_value = False),
+ patch.object(stack_mod, "_detect_windows_gfx_arch", return_value = "gfx1151"),
+ patch.object(stack_mod, "_multiarch_device_pack_installed", return_value = True),
+ patch.object(stack_mod, "_install_bnb_windows_rocm", return_value = True),
+ patch.object(stack_mod, "pip_install_try", pip_try),
+ patch("subprocess.run", return_value = probe),
+ ):
+ stack_mod._ensure_rocm_torch()
+ assert pip_try.call_count == installs
+ if installs:
+ assert f"torch[device-gfx1151]==2.11.0+{stack_mod._ROCM_MULTIARCH_TAG}" in " ".join(
+ str(a) for a in pip_try.call_args.args
+ )
+
def test_the_device_pack_check_needs_torch_and_torchvision_packs(self, monkeypatch):
from importlib import metadata