Repository navigation
[Perf] Enable native small-head kernels in SM90 sparse FlashMLA - #64510
Merged
Merged
Conversation
chaunceyjiang
force-pushed
the
glm_small_decode
branch
from
November 4, 2026 06:52
30af6ae to
6a734b8
Compare
chaunceyjiang
marked this pull request as ready for review
November 4, 2026 07:05
zyongye
approved these changes
Nov 5, 2026
Contributor
Author
|
/ci run |
chaunceyjiang
enabled auto-merge (squash)
November 5, 2026 03:06
|
✅ Triggered Buildkite CI #100101 for commit |
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
chaunceyjiang
force-pushed
the
glm_small_decode
branch
from
November 5, 2026 06:26
729f28a to
0b39be0
Compare
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #100167 for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Enable existing native 8/16/32-head kernels in SM90 BF16 sparse FlashMLA for sufficiently large query batches, avoiding unnecessary computation from padding heads to 64.
#61615
Claims
Validation
Serving benchmark: GLM-5.3-Flash, TP4 with EP, BF16 KV cache, 16,384 input tokens, 512 output tokens, 128 requests, concurrency 32.
main
this pr
Details
Native heads are used on SM90 when the actual head count is 8/16/32 and the query-token count exceeds:
These are empirical performance thresholds. Each query launches one CTA, and small query batches can favor the padded kernel despite its extra head computation.
The implementation uses the actual head count, including heads gathered by DCP, and slices both queries and optional output buffers before calling FlashMLA. Existing padded workspaces remain available for fallback.
Related work and duplicate check: Reviewed open PRs matching FlashMLA small heads and SM90 sparse. #59418 (#59418) adds a Triton decoder that directly reads packed FP8 KV caches, while #57673 (#57673) adds an opt-in Triton backend. This PR integrates existing native BF16 kernels into the current FlashMLA sparse backend.
AI assistance was used for implementation, validation, and preparation of this description.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (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.