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 00:12
Open
2 tasks
3 tasks
Contributor
Author
|
Refiled as #38213 against |
This was referenced Sep 6, 2026
Merged
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, stacked on #36507. No isolated end-to-end speedup has been measured.
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
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 check eligibility and require the original recompute path when source metadata is stale or destination buffers are incompatible.
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 #34000701731
Latest PR Test (Extra): ❌ Run #34000701594
Latest PR Test (AMD ROCm 7.2): ❌ Run #34000701683