Skip to content

perf(kimi3): fuse KDA decode core - #1086

Open
qedawkins wants to merge 1 commit into
lightseekorg:mainfrom
qedawkins:users/qedawkins/kimi-k3-kda-fused-decode
Open

perf(kimi3): fuse KDA decode core#1086
qedawkins wants to merge 1 commit into
lightseekorg:mainfrom
qedawkins:users/qedawkins/kimi-k3-kda-fused-decode

Conversation

@qedawkins

Copy link
Copy Markdown
Contributor

Summary

Fuse the single-token causal convolution and state update, KDA recurrent update, and gated RMSNorm in one GFX950 Gluon kernel. Keep the existing split implementation as the fallback for unsupported shapes and backends.

Testing Plan

  • Extend KDA recurrent tests with independent convolution, paged-state, padding, and gated-RMSNorm references.
  • Preserve coverage for the existing prefill, split decode, and NVIDIA dispatch paths.

Benchamark results from extracting and replaying the affected subgraph median per layer, fused vs unfused:
B2: 11.19 us vs 24.95 us
B4: 11.78 us vs 28.08 us
B8: 13.30 us vs 30.57 us
B16: 15.25 us vs 34.23 us
B32: 22.14 us vs 39.27 us

4K-input/1K-output wall throughput, fused vs main: B2: 71.75 vs 70.45 tok/s (+1.85%)
B4: 137.80 vs 132.52 tok/s (+3.98%)
B8: 203.06 vs 204.01 tok/s (-0.47%)
B16: 312.63 vs 308.39 tok/s (+1.38%)
B32: 499.72 vs 491.75 tok/s (+1.62%)

@qedawkins
qedawkins requested a review from Yu-Zhewen August 13, 2026 18:26
@qedawkins
qedawkins requested review from a team as code owners August 13, 2026 18:26
@lightseek-bot

Copy link
Copy Markdown
Contributor

Hi @qedawkins please fix the conflicts thanks

Fuse the single-token causal convolution and state update, KDA recurrent update, and gated RMSNorm in one GFX950 Gluon kernel. Keep the existing split implementation as the fallback for unsupported shapes and backends.

Testing Plan:
- Extend KDA recurrent tests with independent convolution, paged-state, padding, and gated-RMSNorm references.
- Preserve coverage for the existing prefill, split decode, and NVIDIA dispatch paths.

Graph replay median per layer, fused vs unfused:
B2: 11.19 us vs 24.95 us
B4: 11.78 us vs 28.08 us
B8: 13.30 us vs 30.57 us
B16: 15.25 us vs 34.23 us
B32: 22.14 us vs 39.27 us

4K-input/1K-output wall throughput, fused vs main:
B2: 71.75 vs 70.45 tok/s (+1.85%)
B4: 137.80 vs 132.52 tok/s (+3.98%)
B8: 203.06 vs 204.01 tok/s (-0.47%)
B16: 312.63 vs 308.39 tok/s (+1.38%)
B32: 499.72 vs 491.75 tok/s (+1.62%)

Signed-off-by: Quinn Dawkins <quinn.dawkins@gmail.com>
Yu-Zhewen
Yu-Zhewen previously approved these changes Aug 14, 2026

@Yu-Zhewen Yu-Zhewen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks!

@qedawkins
qedawkins force-pushed the users/qedawkins/kimi-k3-kda-fused-decode branch from cee21f1 to 2e7b38a Compare August 14, 2026 15:53
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.

3 participants