Repository navigation
[Performance] Route Qwen4Exp short prefill through Union GBSA - #23373
Conversation
Plan Union batches from the first query row of each prefill request. Remove the selected-token FIA adapter and mask kernels and cover short and mixed requests in the dispatch tests. Signed-off-by: Dean11879 <81577875+Dean11879@users.noreply.github.com>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required |
There was a problem hiding this comment.
Code Review
This pull request removes the Fused Infer Attention (FIA) prefill path and its associated Triton kernels, workspace management, and tests for the Qwen4Exp model. Prefill requests are now consolidated to always use Union GBSA (Group-Block Sparse Attention), which simplifies the dispatch logic and removes the need for tracking CPU sequence lengths for FIA routing. Standard GBSA continues to be used for the decode path. I have no additional feedback to provide as there are no review comments.
|
Last updated: 2026-11-26 17:30 UTC+8 for commit
|
Coverage
More info see: Summary |
Signed-off-by: Dean11879 <81577875+Dean11879@users.noreply.github.com>
ShyRa1n
left a comment
There was a problem hiding this comment.
LGTM, by the way ,check if this deleted op is called by other caller other than your model or scope.
Checked all in-repo callers. The three deleted Triton kernels were used only by the Qwen4Exp QSA prefill path. No other model or backend references them, and the shared FIA operator used by other attention backends is unaffected. |
What this PR does
Use Union GBSA for Qwen3.8-Flash-Next prefill chunks that previously used FIA. The dispatcher introduced in #20304 selected FIA when a chunk started with less than 24K cached KV tokens. With the Union GBSA path from #21627, these chunks can use the same attention implementation as later prefill chunks.
This removes the 24K threshold, the per-request FIA execution loop, and the Qwen-specific FIA mask and output kernels. Decode continues to use standard GBSA.
Performance results
A3 end-to-end TTFT — 24K input / 1-token output
Both versions used the same Qwen3.8-Flash-Next W4A8 weights and A3 B050 operator package on 8 A3 NPUs (TP2×PP4, DP1). Each request had 24,576 input tokens, processed in six 4,096-token chunks at concurrency 1. Prefix caching was disabled, EP was enabled, and MTP was disabled.
TTFT was averaged over seven requests per version after two warm-up requests. All 14 measured requests completed and produced the same first token.
A3 single-module performance — first six prefill chunks
The benchmark measured
dispatch_qsa_attention()on one A3 NPU with 4,096 query tokens per chunk, 12 local query heads, one KV head, and head dimension 256. Each value is the median of five device measurements using synthetic inputs and candidate indices. The timed region covers attention input preparation and execution. Q/K/V projection, Lightning Indexer, and inter-rank communication are outside that region.The performance comparison used
vllm-ascendmain7124690ceand the same baseline with the FIA removal applied (68dd0683f), with vLLM62d4bc3c7. The tested change has the same Git patch ID as branch commit4a8f4a190.A5 single-module performance — 16K prefill in two 8K chunks
We compared
dispatch_qsa_attention()at the PR base (5e4e3a22f, FIA + mask) and PR head (14ee596a9, Union GBSA) on one Ascend 950 NPU. Both paths used the same inputs for each chunk, with query shape[8192, 12, 256]. Runs alternated in the same environment, with 6 warm-up rounds and 30 measured rounds using NPU events.The second chunk replayed captured inputs and showed the larger reduction, from 8.14 ms to 3.47 ms. The first chunk reused captured Q/K/V with candidate indices constructed for its 0–8K causal range. Both chunks matched the FIA output within
atol=0.01andrtol=0.03.Timing covers single-layer FIA mask construction or Union input preparation, followed by attention execution. Shared per-step Union metadata was prepared before timing. Q/K/V projection, Lightning Indexer, inter-rank communication, and end-to-end TTFT are outside the measured scope.
A3 GPQA Diamond accuracy
We evaluated PR commit
14ee596a9on 8 A3 NPUs (TP2×PP4, concurrency 32) with Thinking enabled and the model’s recommended sampling parameters.All 198 requests completed successfully. Both truncated responses counted toward the 19 incorrect answers. AISBench extracted an incorrect choice from one and found no answer choice in the other.