Conversation
ormandj
requested review from
1am9trash,
BBuf,
DarkSharpness,
Fridge003,
HaiShaw,
HydraQYH,
Qiaolin-Yu,
YAMY1234,
celve,
hebiao064,
hubertlu-tw,
ispobock,
kkHuang-amd,
merrymercy,
rainj-me and
yuan-luo
as code owners
September 6, 2026 11:20
This was referenced Sep 6, 2026
Open
Merged
ormandj
force-pushed
the
pr/kpool-metadata-fusion-main
branch
from
September 8, 2026 02:45
1c16dd8 to
85a23ef
Compare
ormandj
force-pushed
the
pr/kpool-metadata-fusion-main
branch
from
September 8, 2026 21:44
85a23ef to
342fba8
Compare
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
GLM-5.3-Flash's compressed sparse attention repeatedly prepares sequence lengths, page tables and attention schedules during generation. The existing path performs separate GPU operations for this bookkeeping, and draft backends can rebuild metadata already produced for the same step. This PR combines those updates and reuses compatible fresh metadata, reducing repeated setup work around model forwards without changing the attention inputs.
This is an opt-in optimization, not a fix for incorrect model answers. It restores the active metadata-fusion option removed by #38071 as a separate change against
main. No isolated end-to-end speedup has been measured.Replaces #38162, which was closed when the base branch for #36507 was deleted after its merge as
97c6978369.Modifications
SGLANG_EXPERIMENTAL_DSA_KPOOL_METADATA_FUSION=1only for supported CUDA/page geometry. The option defaults off; removed in-graph and preallocated-plan experiments remain excluded.Accuracy Tests
Author CPU validation at
2b7ca22a8b: 3 tests and 6 subtests passed, with CUDA hidden. Its Python runtime and test trees are unchanged at refreshed head342fba81d1on mainafe90a8bc9. Earlier GPU and serving results retain their stated source scope.The GPU tests feed the same sequence lengths and page mappings to the fused kernels and eager references, then compare their output tensors at pool, page and top-k boundaries, including partially filled live tails. This checks that combining the setup operations preserves the metadata consumed by attention. CPU tests cover the CUDA and page-geometry eligibility checks and verify that non-CUDA inputs decline the fused path.
Author run at
efd2a02d03on RTX PRO 6000 Blackwell (SM120), Transformers 5.12.1 / Tokenizers 0.22.2:9 passed, 6 subtests passed; Compute Sanitizer reportedERROR SUMMARY: 0 errors. The CPU contract tests passed three tests and six subtests.Speed Tests and Profiling
No isolated fusion-on/off benchmark. Full-integration results do not measure this option's contribution.
Checklist
Developed with AI assistance.
CI States
Latest PR Test (Base): ❌ Run #34282249711
Latest PR Test (Extra): ❌ Run #34282249510
Latest PR Test (AMD ROCm 7.2): ❌ Run #34282249790