Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
Author
|
/tag-and-rerun-ci |
HydraQYH
reviewed
Mar 27, 2026
HydraQYH
approved these changes
Mar 27, 2026
DarkSharpness
approved these changes
Mar 27, 2026
1 task
satyamk7054
pushed a commit
to satyamk7054/sglang
that referenced
this pull request
Apr 3, 2026
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
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.
Motivation
Follow #18073
The old kernel handled both
qandkinside one CTA, which kept too muchstate live at the same time:
qkq_weightk_weightThe new kernel still performs the work in a single launch, but splits the work
with
grid.y = 2:blockIdx.y == 0: normalizeqblockIdx.y == 1: normalizekThis reduces per-thread live state and shrinks the shared reduction buffer from
two lanes to one lane.
On H200 with shape
(batch_size=2048, hidden_dim=8192):48 -> 26256 B -> 128 B50% -> 100%45.25% -> 88.17%28.96 -> 56.43Microbench results
H200, bf16:
(256, 1024)0.0207 ms0.0194 ms1.0711x(1024, 4096)0.0688 ms0.0598 ms1.1506x(2048, 8192)0.1786 ms0.1592 ms1.1218xModifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci