[ROCm] Enable fp8 query for Triton attention (#60296)
Signed-off-by: xawang <xawang@amd.com> Co-authored-by: JartX <sagformas@epdcenter.es>
This commit is contained in:
@@ -250,16 +250,17 @@ def test_attention_sink_layerwise_reload(monkeypatch, tp_rank, padding):
|
||||
def _fp8_reload_unsupported() -> bool:
|
||||
"""Whether the FP8 reload/online-quantize tests should be skipped.
|
||||
|
||||
``supports_fp8()`` returns True on MI250 (gfx90a) because the general
|
||||
quantization paths upcast FP8 weights, but gfx90a has no native FP8 and
|
||||
cannot run these reload models, so treat it as unsupported here.
|
||||
``supports_fp8()`` returns True on MI250 (gfx90a) and RDNA3 (gfx11)
|
||||
because the general quantization paths upcast FP8 weights, but neither has
|
||||
native FP8 and cannot run these reload models, so treat them as
|
||||
unsupported here.
|
||||
"""
|
||||
if not current_platform.supports_fp8():
|
||||
return True
|
||||
if current_platform.is_rocm():
|
||||
from vllm.platforms.rocm import on_gfx90a
|
||||
from vllm.platforms.rocm import on_gfx11, on_gfx90a
|
||||
|
||||
return on_gfx90a()
|
||||
return on_gfx90a() or on_gfx11()
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -1191,7 +1191,7 @@ class RocmPlatform(Platform):
|
||||
|
||||
@classmethod
|
||||
def supports_fp8(cls) -> bool:
|
||||
return on_cdna() or on_rdna4()
|
||||
return on_cdna() or on_rdna()
|
||||
|
||||
@classmethod
|
||||
def is_fp8_fnuz(cls) -> bool:
|
||||
|
||||
@@ -549,6 +549,11 @@ class TritonAttentionImpl(AttentionImpl):
|
||||
self.use_alibi_sqrt = use_alibi_sqrt
|
||||
self.chunk_lookback = chunk_lookback
|
||||
self.supports_quant_query_input = current_platform.is_cuda()
|
||||
if current_platform.is_rocm():
|
||||
# Enable GPUs with fp8 MMA support
|
||||
from vllm.platforms.rocm import on_gfx11, on_gfx90a
|
||||
|
||||
self.supports_quant_query_input = not (on_gfx90a() or on_gfx11())
|
||||
|
||||
self._kv_quant_mode = get_kv_quant_mode(kv_cache_dtype)
|
||||
self._is_per_token_head_quant = self._kv_quant_mode.is_per_token_head
|
||||
|
||||
Reference in New Issue
Block a user