[AMD] Use tilelang as default NSA attention backend dispatch on AMD Instinct (#18319)

This commit is contained in:
fxmarty-amd
2026-02-27 10:43:34 +01:00
committed by GitHub
parent 9b2fbf7e6a
commit 9496bbd7b1
2 changed files with 7 additions and 2 deletions

View File

@@ -1477,7 +1477,9 @@ class NativeSparseAttnBackend(
page_size=1,
)
else:
raise ValueError(f"Unsupported {nsa_impl = }")
raise ValueError(
f"Unsupported {nsa_impl = } for forward_extend. Consider using an other attention backend."
)
def forward_decode(
self,

View File

@@ -1150,7 +1150,10 @@ class ServerArgs:
user_set_prefill = self.nsa_prefill_backend is not None
user_set_decode = self.nsa_decode_backend is not None
if kv_cache_dtype == "fp8_e4m3":
if not user_set_prefill and not user_set_decode and is_hip():
self.nsa_prefill_backend = "tilelang"
self.nsa_decode_backend = "tilelang"
elif kv_cache_dtype == "fp8_e4m3":
# flashmla_auto dispatches to flashmla_sparse/flashmla_kv based on hardware and heuristics
if not user_set_prefill:
self.nsa_prefill_backend = "flashmla_auto"