@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 084a9dae80
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 14, 05:30 UTC

[Bugfix] Disable FlexAttention direct block mask building for encoder-only models (#27344)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Oct 23, 2025 at 00:39 UTC 084a9dae801c6756cb50c03daa313bca96fa660b
1 file changed +4 -1
vllm/v1/attention/backends/flex_attention.py
+4 -1
@@ -658,7 +658,10 @@ class FlexAttentionMetadataBuilder(AttentionMetadataBuilder[FlexAttentionMetadat
658 total_cache_tokens=total_cache_tokens,
659 decode_offset=offset_tensor,
660 num_blocks_per_seq=num_blocks_per_seq,
661 - direct_build=self.direct_build,
661 + # FIXME(Isotr0py): direct build has issue to build bidirectional
662 + # attention block mask for encoder-only models, disable it temporarily.
663 + # see: https://github.com/vllm-project/vllm/pull/27329#issuecomment-3431484053
664 + direct_build=(self.direct_build and common_attn_metadata.causal),
665 q_block_size=self.q_block_size,
666 kv_block_size=self.kv_block_size,
667 )