From e64b39ea7114d7294db1da9766f5f9a88ef4ed25 Mon Sep 17 00:00:00 2001 From: Andrew Barnes Date: Tue, 14 Apr 2026 13:36:26 -0400 Subject: [PATCH] [ROCm] Align AiterFlashAttentionImpl attn_type check with backend (#39119) Signed-off-by: Bortlesboat --- vllm/v1/attention/backends/rocm_aiter_fa.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vllm/v1/attention/backends/rocm_aiter_fa.py b/vllm/v1/attention/backends/rocm_aiter_fa.py index a4cdce3f5d..14c473a70a 100644 --- a/vllm/v1/attention/backends/rocm_aiter_fa.py +++ b/vllm/v1/attention/backends/rocm_aiter_fa.py @@ -844,9 +844,13 @@ class AiterFlashAttentionImpl(AttentionImpl): assert self.num_heads % self.num_kv_heads == 0 self.num_queries_per_kv = self.num_heads // self.num_kv_heads - if attn_type not in [AttentionType.DECODER, AttentionType.ENCODER_DECODER]: + if attn_type != AttentionType.DECODER: raise NotImplementedError( - "Encoder self-attention is not implemented for AiterFlashAttentionImpl" + "Only decoder self-attention is supported for " + "AiterFlashAttentionImpl. ENCODER_DECODER is not supported " + "because the prefill path uses cu_seqlens_k set to decoder " + "query_start_loc with causal=True, which is incorrect for " + "cross-attention." ) def extend_for_sliding_window(