[codex] Optimize hidden-size 512 RMSNorm dispatch#24710
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! |
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
|
/tag-and-rerun-ci |
yuan-luo
approved these changes
May 9, 2026
yuan-luo
left a comment
Collaborator
There was a problem hiding this comment.
== 512 is a single-warp sweet spot. LGTM.
Collaborator
Author
|
/tag-and-rerun-ci |
Collaborator
Author
4 tasks
Shunkangz
pushed a commit
to Shunkangz/sglang
that referenced
this pull request
May 27, 2026
Co-authored-by: Codex <codex@example.com>
alphabetc1
pushed a commit
to alphabetc1/sglang
that referenced
this pull request
Jun 4, 2026
Co-authored-by: Codex <codex@example.com>
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.
Summary
RMSNormHalfKernel; 1024/1536 stay on the generic CTA path.rmsnorm_cta_double/rmsnorm_cta_widethat bypasses the CTA shared-memory reduction whenkNumWarps == 1.H200 Correctness
Environment:
ion8-h200,sglang_bbufCUDA_VISIBLE_DEVICES=4for unit tests andCUDA_VISIBLE_DEVICES=2/3for same-shape main/PR benchmarkingorigin/main(3b3af13d2)Validation passed:
Result: 63 tests passed. Additional BF16 benchmark correctness checks against a PyTorch reference produced matching errors on main and PR: max_abs_error was
0.0,0.00390625, or0.0078125depending on shape.H200 Benchmark
CUDA event median, current
origin/main-> this PR:9.824 us9.568 us+2.61%9.856 us9.664 us+1.95%9.824 us9.632 us+1.95%9.856 us9.696 us+1.62%9.888 us9.600 us+2.91%9.984 us9.664 us+3.21%9.888 us9.600 us+2.91%9.856 us9.696 us+1.62%10.176 us9.984 us+1.89%10.208 us10.080 us+1.25%The target 512 shape dispatches to
RMSNormHalfKerneland preserves correctness. Other rows are included as guard shapes.Validation
python -m compileall -q python/sglang/jit_kernel/norm.py python/sglang/jit_kernel/tests/test_rmsnorm.py python/sglang/jit_kernel/csrc/elementwise/rmsnorm.cuhgit diff --check origin/main...HEADCI States
Latest PR Test (Base): ❌ Run #25919276112⚠️ Not enabled -- add
Latest PR Test (Extra):
run-ci-extralabel to opt in.