From 25bb18f70964d6a319e6705d6453f5fb0961d0e2 Mon Sep 17 00:00:00 2001 From: Thien Tran Date: Wed, 14 Oct 2026 05:13:30 +0000 Subject: [PATCH] [Perf] Skip FLA chunk metadata when FlashInfer GDN prefill is active FlashInfer's GDN prefill kernel consumes cu_seqlens directly and never reads chunk_indices/chunk_offsets, but the metadata builder still ran prepare_chunk_indices/prepare_chunk_offsets (CPU compute plus H2D copies) for every prefill batch. Skip building them for the flashinfer backend, matching the existing aiter_flydsl exemption. Co-authored-by: Kimi Code Signed-off-by: Thien Tran --- vllm/v1/attention/backends/gdn_attn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/v1/attention/backends/gdn_attn.py b/vllm/v1/attention/backends/gdn_attn.py index 08369adcb1a3..6a5e2a819caf 100644 --- a/vllm/v1/attention/backends/gdn_attn.py +++ b/vllm/v1/attention/backends/gdn_attn.py @@ -495,7 +495,10 @@ def build( # type: ignore[override] cu_seqlens=prefill_query_start_loc, ) ) - else: + elif self.gdn_prefill_backend != "flashinfer": + # FlashInfer's chunk kernel consumes cu_seqlens directly and + # never reads chunk_indices/chunk_offsets, so skip the FLA + # metadata (CPU compute + H2D copies) entirely. chunk_indices, chunk_offsets = self._build_chunk_metadata( prefill_query_start_loc, prefill_query_start_loc_cpu,