@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 4d5c89295b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 4, 10:00 UTC

(bugfix): block_size check for flex attn (#41363)

Co-authored-by: Matthew Bonanni <mbonanni@redhat.com>

Soyaazz committed May 1, 2026 at 09:59 UTC 4d5c89295b763e642129fcf598580ec63dc1d45f
2 files changed +6 -1
docs/design/attention_backends.md
+1 -1
@@ -174,7 +174,7 @@ Priority is **1 = highest** (tried first).
174 | `FLASH_ATTN` | FA3* | fp16, bf16 | `auto`, `float16`, `bfloat16`, `fp8`, `fp8_e4m3`, `fp8_e5m2` | %16 | Any | ✅ | ❌ | ✅ | All | 9.x |
175 | `FLASH_ATTN` | FA4* | fp16, bf16 | `auto`, `float16`, `bfloat16` | %16 | Any | ✅ | ❌ | ✅ | All | ≥10.0 |
176 | `FLASH_ATTN_DIFFKV` | | fp16, bf16 | `auto` | Any | Any | ❌ | ❌ | ✅ | Decoder | Any |
177 -| `FLEX_ATTENTION` | | fp16, bf16, fp32 | `auto`, `float16`, `bfloat16` | Any | Any | ❌ | ✅ | ❌ | Decoder, Encoder Only | Any |
177 +| `FLEX_ATTENTION` | | fp16, bf16, fp32 | `auto`, `float16`, `bfloat16` | %16 | Any | ❌ | ✅ | ❌ | Decoder, Encoder Only | Any |
178 | `ROCM_AITER_FA` | | fp16, bf16 | `auto`, `float16`, `bfloat16`, `fp8`, `fp8_e4m3`, `fp8_e5m2` | 16, 32 | 64, 128, 256 | ❌ | ❌ | ❌ | Decoder | N/A |
179 | `ROCM_AITER_UNIFIED_ATTN` | | fp16, bf16 | `auto` | %16 | Any | ✅ | ✅ | ❌ | All | N/A |
180 | `ROCM_ATTN` | | fp16, bf16, fp32 | `auto`, `float16`, `bfloat16`, `fp8`, `fp8_e4m3`, `fp8_e5m2` | %16 | 32, 64, 80, 96, 128, 160, 192, 224, 256 | ❌ | ✅ | ❌ | Decoder, Encoder, Encoder Only | N/A |
vllm/v1/attention/backends/flex_attention.py
+5
@@ -35,6 +35,7 @@ from vllm.v1.attention.backend import (
35 AttentionMetadataBuilder,
36 AttentionType,
37 CommonAttentionMetadata,
38 + MultipleOf,
39 )
40 from vllm.v1.kv_cache_interface import AttentionSpec, EncoderOnlyAttentionSpec
41
@@ -134,6 +135,10 @@ class FlexAttentionBackend(AttentionBackend):
135 def get_supported_head_sizes(cls) -> list[int]:
136 return []
137
138 + @staticmethod
139 + def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
140 + return [MultipleOf(16)]
141 +
142
143 # @torch.compile(fullgraph=True, mode="reduce-overhead")
144 def physical_to_logical_mapping(