Enable gfx1250 ROCm architecture (#46516)
Signed-off-by: Douglas Lehr <Doug.Lehr@amd.com> Signed-off-by: jpvillam <juan.villamizar@amd.com> Signed-off-by: Daniel <danichan@amd.com> Signed-off-by: Jaden Mathias <jaden.mathias@amd.com> Signed-off-by: jpvillam <jpvillam@amd.com> Signed-off-by: Juan Villamizar <100237675+jpvillam-amd@users.noreply.github.com> Signed-off-by: Douglas Lehr <91553416+dllehr-amd@users.noreply.github.com> Signed-off-by: Jaden Mathias <Jaden.Mathias@amd.com> Co-authored-by: Douglas Lehr <Doug.Lehr@amd.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Daniel <danichan@amd.com> Co-authored-by: Jaden Mathias <jaden.mathias@amd.com> Co-authored-by: jpvillam <jpvillam@amd.com> Co-authored-by: root <root@ctheliosr-1b114-f01-2.mnb.dcgpu> Co-authored-by: Douglas Lehr <91553416+dllehr-amd@users.noreply.github.com> Co-authored-by: dllehr <douglehr@amd.com> Co-authored-by: Daniel Chan <Daniel.Chan@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Douglas Lehr
Claude Opus 4.7
Daniel
Jaden Mathias
jpvillam
root
Douglas Lehr
dllehr
Daniel Chan
Andreas Karatzas
parent
553fcb82d5
commit
4f1da84eb5
+37
-13
@@ -194,11 +194,6 @@ def _get_gcn_arch() -> str:
|
||||
return _query_gcn_arch_from_amdsmi()
|
||||
except Exception as e:
|
||||
logger.debug("Failed to get GCN arch via amdsmi: %s", e)
|
||||
logger.warning_once(
|
||||
"Failed to get GCN arch via amdsmi, falling back to torch.cuda. "
|
||||
"This will initialize CUDA and may cause "
|
||||
"issues if CUDA_VISIBLE_DEVICES is not set yet."
|
||||
)
|
||||
# Ultimate fallback: use torch.cuda (will initialize CUDA)
|
||||
return torch.cuda.get_device_properties("cuda").gcnArchName
|
||||
|
||||
@@ -218,6 +213,11 @@ _ON_GFX9 = any(arch in _GCN_ARCH for arch in ["gfx90a", "gfx942", "gfx950"])
|
||||
_ON_GFX90A = "gfx90a" in _GCN_ARCH
|
||||
_ON_GFX942 = "gfx942" in _GCN_ARCH
|
||||
_ON_GFX950 = "gfx950" in _GCN_ARCH
|
||||
_ON_GFX1250 = "gfx1250" in _GCN_ARCH
|
||||
|
||||
_ON_CDNA = any(arch in _GCN_ARCH for arch in ["gfx9", "gfx1250"])
|
||||
# RDNA = gfx11/gfx12 minus the CDNA-classified gfx1250.
|
||||
_ON_RDNA = _ON_GFX1X and not _ON_CDNA
|
||||
|
||||
|
||||
def _capability_from_gcn_arch(gcn_arch: str) -> tuple[int, int] | None:
|
||||
@@ -292,7 +292,7 @@ def _capability_from_gcn_arch(gcn_arch: str) -> tuple[int, int] | None:
|
||||
|
||||
|
||||
def on_gfx1x() -> bool:
|
||||
return _ON_GFX1X
|
||||
return _ON_GFX1X and not _ON_CDNA
|
||||
|
||||
|
||||
def on_gfx11() -> bool:
|
||||
@@ -308,7 +308,11 @@ def on_gfx1151() -> bool:
|
||||
|
||||
|
||||
def on_gfx12x() -> bool:
|
||||
return _ON_GFX12X
|
||||
return _ON_GFX12X and not _ON_CDNA
|
||||
|
||||
|
||||
def on_gfx1250() -> bool:
|
||||
return _ON_GFX1250
|
||||
|
||||
|
||||
def on_mi3xx() -> bool:
|
||||
@@ -331,13 +335,33 @@ def on_gfx950() -> bool:
|
||||
return _ON_GFX950
|
||||
|
||||
|
||||
def on_cdna() -> bool:
|
||||
return _ON_CDNA
|
||||
|
||||
|
||||
def on_rdna() -> bool:
|
||||
return _ON_RDNA
|
||||
|
||||
|
||||
def get_cdna_version() -> int:
|
||||
if on_gfx90a():
|
||||
return 2
|
||||
if on_gfx942():
|
||||
return 3
|
||||
if on_gfx950():
|
||||
return 4
|
||||
if on_gfx1250():
|
||||
return 5
|
||||
return 0
|
||||
|
||||
|
||||
# Enable HIP online tuning early, before hipBLASLt initializes.
|
||||
# Turn on hipBLASLt online tuning if use AITER hipBLASLt GEMM.
|
||||
if (
|
||||
envs.VLLM_ROCM_USE_AITER
|
||||
and envs.VLLM_ROCM_USE_AITER_LINEAR
|
||||
and envs.VLLM_ROCM_USE_AITER_LINEAR_HIPBMM
|
||||
and on_mi3xx()
|
||||
and get_cdna_version() > 2
|
||||
):
|
||||
os.environ["HIP_ONLINE_TUNING"] = "1"
|
||||
|
||||
@@ -356,7 +380,7 @@ def use_rocm_custom_paged_attention(
|
||||
) -> bool:
|
||||
# custom paged attn always supported on V0. On V1, requires sliding window
|
||||
# disabled due to observed numerical discrepancy.
|
||||
if _ON_GFX9:
|
||||
if on_cdna():
|
||||
return (
|
||||
(sliding_window == 0 or sliding_window == (-1, -1))
|
||||
and (qtype == torch.half or qtype == torch.bfloat16)
|
||||
@@ -657,12 +681,12 @@ class RocmPlatform(Platform):
|
||||
|
||||
from vllm._aiter_ops import rocm_aiter_ops
|
||||
|
||||
if rocm_aiter_ops.is_mha_enabled() and on_gfx9():
|
||||
if rocm_aiter_ops.is_mha_enabled() and on_cdna():
|
||||
logger.info_once("Using AITER Flash Attention backend for ViT model.")
|
||||
return AttentionBackendEnum.ROCM_AITER_FA
|
||||
|
||||
if (
|
||||
on_gfx9()
|
||||
on_cdna()
|
||||
and find_spec("flash_attn") is not None
|
||||
and (dtype == torch.float16 or dtype == torch.bfloat16)
|
||||
):
|
||||
@@ -878,11 +902,11 @@ class RocmPlatform(Platform):
|
||||
|
||||
@classmethod
|
||||
def supports_mx(cls) -> bool:
|
||||
return any(gfx in _GCN_ARCH for gfx in ["gfx95"])
|
||||
return any(gfx in _GCN_ARCH for gfx in ["gfx95", "gfx1250"])
|
||||
|
||||
@classmethod
|
||||
def supports_fp8(cls) -> bool:
|
||||
return on_gfx9() or on_gfx12x()
|
||||
return on_cdna() or on_gfx12x()
|
||||
|
||||
@classmethod
|
||||
def is_fp8_fnuz(cls) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user