From d82c013f382afd4665a871bc87dbea56f696a1ce Mon Sep 17 00:00:00 2001 From: GoldenGrapeGentleman Date: Wed, 18 Mar 2026 10:06:27 -0500 Subject: [PATCH 1/3] feat(ROCm): expand is_rdna() to cover RDNA2, RDNA3.5 and all known gfx targets Add all RDNA2 (gfx103x), RDNA3 (gfx110x), RDNA3.5 (gfx115x) and RDNA4 (gfx120x) gfx codes with GPU model annotations. Previously only the 4 ROCm-officially-supported RDNA3/4 codes were listed (gfx1100/1101/1200/1201). This excludes users on RDNA2 cards (RX 6000), RDNA3 Navi33 (RX 7600/7700), and RDNA3.5 APUs that run ROCm unofficially but can still benefit from the RDNA Triton kernel path. --- unsloth/kernels/utils.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.py index 90f2d5d238..0c86d26ad6 100644 --- a/unsloth/kernels/utils.py +++ b/unsloth/kernels/utils.py @@ -88,12 +88,27 @@ def is_cdna(): @functools.lru_cache(1) def is_rdna(): - """Detect ROCm-supported RDNA consumer/workstation GPUs (RDNA3, RDNA4).""" + """Detect RDNA consumer/workstation GPUs (RDNA2, RDNA3, RDNA3.5, RDNA4).""" return is_hip() and triton.runtime.driver.active.get_current_target().arch in ( - "gfx1100", - "gfx1101", - "gfx1200", - "gfx1201", + # RDNA2 (GFX10.3) — RX 6000 series + "gfx1030", # Navi 21: RX 6900 XT, RX 6800 XT/X + "gfx1031", # Navi 22: RX 6700 XT + "gfx1032", # Navi 23: RX 6600 XT, RX 6600 + "gfx1034", # Navi 24: RX 6400 + "gfx1035", # Rembrandt APU + "gfx1036", # Barcelo-R APU + # RDNA3 (GFX11) — RX 7000 series + "gfx1100", # Navi 31: RX 7900 XTX/XT/GRE, PRO W7900/W7800 + "gfx1101", # Navi 32: RX 7800 XT, RX 7700 XT, PRO W7700 + "gfx1102", # Navi 33: RX 7700, RX 7600 XT, RX 7600 + "gfx1103", # Phoenix APU: Radeon 780M/760M/740M + # RDNA3.5 (GFX11.5) — Strix Point / Strix Halo APU + "gfx1150", # Strix Halo: Radeon 890M + "gfx1151", + "gfx1152", # Strix Point: Radeon 860M + # RDNA4 (GFX12) — RX 9000 series + "gfx1200", # Navi 48: RX 9070 XT, RX 9070 + "gfx1201", # Navi 44: RX 9060 XT ) From e7135594e50fffff7ac0a01601f979b75a030990 Mon Sep 17 00:00:00 2001 From: GoldenGrapeGentleman Date: Wed, 18 Mar 2026 10:32:46 -0500 Subject: [PATCH 2/3] feat(ROCm): expand is_rdna() to cover RDNA2, RDNA3, RDNA3.5, RDNA4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the gfx whitelist beyond the 4 ROCm-officially-supported codes (gfx1100/1101/1200/1201) to include all known discrete and APU variants: RDNA2 — gfx1030/1031/1032 RDNA3 — gfx1100/1101/1102/1103 RDNA3.5 — gfx1150/1151/1152 RDNA4 — gfx1200/1201 Co-authored-by: billishyahao --- unsloth/kernels/utils.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.py index 0c86d26ad6..0905faa458 100644 --- a/unsloth/kernels/utils.py +++ b/unsloth/kernels/utils.py @@ -90,25 +90,22 @@ def is_cdna(): def is_rdna(): """Detect RDNA consumer/workstation GPUs (RDNA2, RDNA3, RDNA3.5, RDNA4).""" return is_hip() and triton.runtime.driver.active.get_current_target().arch in ( - # RDNA2 (GFX10.3) — RX 6000 series - "gfx1030", # Navi 21: RX 6900 XT, RX 6800 XT/X - "gfx1031", # Navi 22: RX 6700 XT - "gfx1032", # Navi 23: RX 6600 XT, RX 6600 - "gfx1034", # Navi 24: RX 6400 - "gfx1035", # Rembrandt APU - "gfx1036", # Barcelo-R APU - # RDNA3 (GFX11) — RX 7000 series - "gfx1100", # Navi 31: RX 7900 XTX/XT/GRE, PRO W7900/W7800 - "gfx1101", # Navi 32: RX 7800 XT, RX 7700 XT, PRO W7700 - "gfx1102", # Navi 33: RX 7700, RX 7600 XT, RX 7600 - "gfx1103", # Phoenix APU: Radeon 780M/760M/740M - # RDNA3.5 (GFX11.5) — Strix Point / Strix Halo APU - "gfx1150", # Strix Halo: Radeon 890M + # RDNA2 + "gfx1030", + "gfx1031", + "gfx1032", + # RDNA3 + "gfx1100", + "gfx1101", + "gfx1102", + "gfx1103", + # RDNA3.5 + "gfx1150", "gfx1151", - "gfx1152", # Strix Point: Radeon 860M - # RDNA4 (GFX12) — RX 9000 series - "gfx1200", # Navi 48: RX 9070 XT, RX 9070 - "gfx1201", # Navi 44: RX 9060 XT + "gfx1152", + # RDNA4 + "gfx1200", + "gfx1201", ) From a27154a127c983f85179eae5274016a47774e776 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:32:57 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/kernels/utils.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.py index 0905faa458..5c499d69a6 100644 --- a/unsloth/kernels/utils.py +++ b/unsloth/kernels/utils.py @@ -90,22 +90,22 @@ def is_cdna(): def is_rdna(): """Detect RDNA consumer/workstation GPUs (RDNA2, RDNA3, RDNA3.5, RDNA4).""" return is_hip() and triton.runtime.driver.active.get_current_target().arch in ( - # RDNA2 - "gfx1030", - "gfx1031", - "gfx1032", - # RDNA3 - "gfx1100", - "gfx1101", - "gfx1102", - "gfx1103", - # RDNA3.5 - "gfx1150", + # RDNA2 + "gfx1030", + "gfx1031", + "gfx1032", + # RDNA3 + "gfx1100", + "gfx1101", + "gfx1102", + "gfx1103", + # RDNA3.5 + "gfx1150", "gfx1151", - "gfx1152", - # RDNA4 - "gfx1200", - "gfx1201", + "gfx1152", + # RDNA4 + "gfx1200", + "gfx1201", )