Fix FA4 dynamic_causal for full attention layers (#46659)

Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>

Matthew Bonanni committed Jun 29, 2026 at 17:23 UTC 8fc1b2d046f4a991b5c24bb5470bf45efcfe9d01
1 file changed +4 -1
vllm/v1/attention/backends/flash_attn.py
+4 -1
@@ -906,7 +906,10 @@ class FlashAttentionImpl(AttentionImpl):
906 f"FA{self.vllm_flash_attn_version}"
907 )
908 dynamic_causal = causal
909 - causal = False
909 + has_window = (
910 + sliding_window_size is not None and sliding_window_size[1] >= 0
911 + )
912 + causal = not has_window
913
914 flash_attn_varlen_func(
915 q=query[:num_actual_tokens],