Repository navigation
perf(kda): fuse prefill convolution, Q/K norm and history update - #1705
Merged
Merged
Conversation
shihaobai
marked this pull request as ready for review
November 12, 2026 09:39
shihaobai
force-pushed
the
bsh/glm-prefill-kda-fused-prepare
branch
from
November 12, 2026 09:42
6f34e12 to
6270da0
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.
Fuse GLM-5.3 Flash prefill convolution, SiLU, Q/K norm and history updates into one standard Triton kernel. Use batch-first tiling for regular batches and compact tiles for skewed lengths.
Validation: 73 tests and 12 H200 bitwise output/state cases pass. A final five-run check found head-first and batch-first total KDA within 0.15%. With 64 heads, dim 128 and FP32 SSM state, convolution + preparation + KDA takes 1.16/4.52 ms at 2048/8192 tokens, versus 1.85/7.20 ms for SGL (sglang-kernel 0.4.5). Black/Flake8 pass.