Skip to content

[Perf][GDN] Skip FLA chunk metadata when FlashInfer GDN prefill is active - #61569

Merged
khluu merged 3 commits into
vllm-project:mainfrom
gau-nernst:gdn-fi-skip-fla-metadata
Oct 14, 2026
Merged

khluu merged 3 commits into
vllm-project:mainfrom
gau-nernst:gdn-fi-skip-fla-metadata

Conversation

@gau-nernst

@gau-nernst gau-nernst commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Skip building FLA chunk metadata (prepare_chunk_indices/prepare_chunk_offsets + two H2D copies per prefill-containing step) when the FlashInfer GDN prefill backend is active — the FlashInfer wrapper consumes only cu_seqlens and never reads them. Same exemption as the existing aiter_flydsl path. 4-line change, no behavioral difference.

Claims

  • Removes ~5 µs of CPU work and 2 H2D copies per prefill-containing scheduler step under gdn_prefill_backend=flashinfer (auto default on SM90, and SM100/SM120 with head_k_dim=128). With MTP this covers mixed steps too (non-spec 1-token decodes are reclassified into the chunk-kernel path).
  • Output-neutral by construction: fi_chunk_gated_delta_rule has no chunk_indices/chunk_offsets parameters.

Validation

  • pytest tests/v1/attention/test_gdn_metadata_builder.py -q: 61 passed.
  • Removed work, timed on the exact skipped calls (FLA_CHUNK_SIZE=64): 3.5-5.4 µs CPU + 1.0-64.5 KiB H2D per step for 1-64 seqs x 8k tokens.
  • E2E A/B (no-regression): Qwen3.8-Flash-Next-FP8, TEP4 on 4x GB300, 8k-in/1-out, auto backend. Worker logs confirm FlashInfer GDN prefill engaged on both branches.
Concurrency P50 TTFT main (ms) P50 TTFT PR (ms) req/s main req/s PR
1 148.95 147.98 6.62 6.73
4 466.15 467.02 8.38 8.23
16 1594.59 1592.79 9.94 9.96
64 6385.33 6376.24 9.97 9.98

Flat within noise, as expected for ~5 µs/step of host work against ~150 ms TTFT.

Details

Duplicate-work check: nearest open PRs inspected by diff — #60050, #61034, #60105, #57039; none skip the chunk-metadata build. Verified compatible with #60050 (FlashInfer prefill checkpoints) in either landing order: its checkpoint path calls fi_chunk_gated_delta_rule directly without chunk indices, and its fallback branch only passes them through the dispatch wrapper, which the FlashInfer backend ignores.

No accuracy eval: nothing in the change can affect outputs (see Claims); the e2e run above exercised the modified path at c1-64.

AI assistance was used in the creation of this PR.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

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 <noreply@moonshot.cn>
Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@gau-nernst

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #94686 for commit b99a5cbe609b.

@gau-nernst

Copy link
Copy Markdown
Contributor Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #94708 for commit f5a71b278e0a, running 2 failed step(s) from Buildkite CI #94686.

@ZJY0516
ZJY0516 enabled auto-merge (squash) October 14, 2026 08:19
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 14, 2026
@khluu
khluu disabled auto-merge October 14, 2026 08:46
@khluu
khluu merged commit 937d6c1 into vllm-project:main Oct 14, 2026
13 of 15 checks passed
@gau-nernst
gau-nernst deleted the gdn-fi-skip-fla-metadata branch October 14, 2026 14:26
AndreasKaratzas pushed a commit to AndreasKaratzas/vllm that referenced this pull request Oct 16, 2026
…tive (vllm-project#61569)

Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>
Co-authored-by: Kimi Code <noreply@moonshot.cn>

Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
…tive (vllm-project#61569)

Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>
Co-authored-by: Kimi Code <noreply@moonshot.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants