fix(ROCm): restrict is_rdna() to ROCm-officially-supported RDNA GPUs (#4136)

Current arch.startswith("gfx1") incorrectly matches:
  - RDNA1 (gfx10xx) and RDNA2 (gfx103x): not ROCm supported
  - gfx1102 (RX 7600), gfx1103 (Phoenix APU): not in ROCm support matrix
  - gfx1150/1151/1152 (RDNA3.5 APUs): not in ROCm support matrix

Replace with explicit whitelist aligned to the ROCm Linux support matrix:
  https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html

  gfx1100 - RDNA3 discrete (RX 7900 series, PRO W7900/W7800)
  gfx1101 - RDNA3 discrete (RX 7800/7700 series, PRO W7700)
  gfx1200 - RDNA4 discrete (RX 9060 series)
  gfx1201 - RDNA4 discrete (RX 9070 series, AI PRO R9700)

Mirrors the existing is_cdna() pattern. Avoids silently applying
unverified Triton kernel tuning to unsupported hardware.
This commit is contained in:
金黄色葡萄球君君 2026-03-03 19:05:38 +08:00 committed by GitHub
commit 1ebf994da1

View file

@ -88,11 +88,13 @@ def is_cdna():
@functools.lru_cache(1)
def is_rdna():
"""Detect RDNA consumer/workstation GPUs (RDNA3, RDNA3.5, RDNA4)."""
if not is_hip():
return False
arch = triton.runtime.driver.active.get_current_target().arch
return arch.startswith("gfx1") and not is_cdna()
"""Detect ROCm-supported RDNA consumer/workstation GPUs (RDNA3, RDNA4)."""
return is_hip() and triton.runtime.driver.active.get_current_target().arch in (
"gfx1100",
"gfx1101",
"gfx1200",
"gfx1201",
)
def calculate_settings(