Skip to content

Commit 311c823

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4b636db commit 311c823

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

studio/install_python_stack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,9 +1926,9 @@ def _ensure_rocm_torch() -> None:
19261926
# MI50 / Radeon VII path; it must win over the Strix probe-order detection
19271927
# below (a mixed Strix + MI50 host could otherwise route to gfx1151), so the
19281928
# Strix override is skipped when it is set.
1929-
_gfx906_arch_override = (
1930-
os.environ.get("UNSLOTH_ROCM_GFX_ARCH") or ""
1931-
).strip().lower().split(":")[0] == "gfx906"
1929+
_gfx906_arch_override = (os.environ.get("UNSLOTH_ROCM_GFX_ARCH") or "").strip().lower().split(
1930+
":"
1931+
)[0] == "gfx906"
19321932

19331933
# Strix Halo / Point (gfx1151 / gfx1150) need torch from AMD's per-gfx index
19341934
# (2.11+rocm7.13); any generic pytorch.org rocm index lacks the fixes (ROCm 7.1

tests/studio/install/test_rocm_support.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,7 @@ def test_explicit_gfx_index_honored_and_skips_strix_reroute(
838838
stack_mod.os.environ.pop("UNSLOTH_TORCH_INDEX_FAMILY", None)
839839
with patch("os.path.isdir", return_value = True):
840840
with patch("subprocess.run", return_value = mock_probe):
841-
with patch.object(
842-
stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]
843-
):
841+
with patch.object(stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]):
844842
_ensure_rocm_torch()
845843
assert mock_pip.call_count == 1
846844
torch_call = str(mock_pip.call_args_list[0])
@@ -942,9 +940,7 @@ def test_gfx_pin_over_installed_pre211_rocm_reinstalls(
942940
stack_mod.os.environ.pop("UNSLOTH_TORCH_INDEX_FAMILY", None)
943941
with patch("os.path.isdir", return_value = True):
944942
with patch("subprocess.run", return_value = mock_probe):
945-
with patch.object(
946-
stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]
947-
):
943+
with patch.object(stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]):
948944
_ensure_rocm_torch()
949945
torch_call = str(mock_pip.call_args_list[0])
950946
assert "gfx1151" in torch_call
@@ -1031,9 +1027,7 @@ def test_gfx_pin_over_generic_rocm211_reinstalls(
10311027
with patch("subprocess.run", return_value = mock_probe):
10321028
# The gfx probe may run for the bnb-skip flag; returning a Strix
10331029
# arch must not reroute the pinned torch index.
1034-
with patch.object(
1035-
stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]
1036-
):
1030+
with patch.object(stack_mod, "_detect_amd_gfx_codes", return_value = ["gfx1151"]):
10371031
_ensure_rocm_torch()
10381032
torch_call = str(mock_pip.call_args_list[0])
10391033
assert "gfx1151" in torch_call

0 commit comments

Comments
 (0)