Skip to content

perf(kda): fuse prefill convolution, Q/K norm and history update - #1705

Merged
shihaobai merged 1 commit into
mainfrom
bsh/glm-prefill-kda-fused-prepare
Nov 12, 2026
Merged

shihaobai merged 1 commit into
mainfrom
bsh/glm-prefill-kda-fused-prepare

Conversation

@shihaobai

@shihaobai shihaobai commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@shihaobai shihaobai changed the title perf(kda): fuse QKV preparation for GLM Prefill perf(kda): fuse prefill convolution and Q/K norm Nov 12, 2026
@shihaobai shihaobai changed the title perf(kda): fuse prefill convolution and Q/K norm perf(kda): fuse prefill convolution, Q/K norm and history update Nov 12, 2026
@shihaobai
shihaobai marked this pull request as ready for review November 12, 2026 09:39
@shihaobai
shihaobai force-pushed the bsh/glm-prefill-kda-fused-prepare branch from 6f34e12 to 6270da0 Compare November 12, 2026 09:42
@shihaobai
shihaobai merged commit dc53088 into main Nov 12, 2026
1 check passed
@shihaobai
shihaobai deleted the bsh/glm-prefill-kda-fused-prepare branch November 12, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant