Repository navigation
Conversation
ajit283
force-pushed
the
kimi-k3-dep16-fused-proj
branch
4 times, most recently
from
September 1, 2026 06:24
bcca1af to
5e4eee3
Compare
ajit283
marked this pull request as ready for review
September 1, 2026 06:25
Collaborator
|
/tag-and-rerun-ci |
ajit283
force-pushed
the
kimi-k3-dep16-fused-proj
branch
from
September 1, 2026 14:50
71d1001 to
0565053
Compare
Collaborator
|
/rerun-failed-ci |
1 similar comment
Collaborator
|
/rerun-failed-ci |
Collaborator
|
/rerun-failed-ci |
Collaborator
|
All NV pipelines have passed |
Collaborator
|
cc @DarkSharpness since this is related to K3 |
kpham-sgl
reviewed
Sep 17, 2026
kpham-sgl
left a comment
Collaborator
There was a problem hiding this comment.
Can you also test with GSM8K and/or AIME26? Thanks!
Collaborator
|
@ajit283 please address the comments. Thanks! |
Author
|
@kpham-sgl I ran the full 1,319-question GSM8K eval three times per variant. Baseline averaged 95.56% and this PR averaged 95.18% (medians 95.51% vs 95.28%). That is a -0.38 pp mean / -0.23 pp median difference, within the run-to-run spread we saw in normal serving. The deterministic full-model A/B is still bit-identical. I added the full numbers to the PR description. |
Collaborator
|
@ajit283 please fix the conflicts. thanks |
…-proj # Conflicts: # python/sglang/srt/models/kimi_k3.py
Collaborator
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
Kimi-K3's full-rank KDA projection fusion was disabled whenever attention TP differed from global TP. That excludes DP-attention deployments such as TP16 + DP-attention16, even though the full-rank merged QKVG projection accepts explicit attention-TP rank/size and can safely use the replicated attention weights.
This enables the existing fusion for that layout. No new GPU kernel is introduced.
Modifications
attn_tp_size != tp_size, including mixed block-FP8 attention projections.attn_tp_size.benchmark/kernels/kimi_k3/.For DEP16, this changes the projection prologue from five logical GEMMs:
to three:
Accuracy Tests
Tested with the real Kimi-K3 checkpoint on 16 GB300 GPUs, TP16 + DP-attention16 + EP16:
630507:7 passed, including five parameterized subtests.M={1,32}.631695:0.0.523990loaded the real checkpoint, captured all CUDA graphs, and served2048/2048requests.pre-commit, Python compilation, andgit diff --checkpass.A preliminary normal-mode comparison produced different outputs, but a baseline-versus-baseline control also diverged despite fixed server seeds and sequential requests. The normal serving configuration is not batch-invariant and therefore is not a valid exact-equality oracle. Enabling SGLang deterministic inference made the baseline/candidate comparison bit-identical as reported above.
GSM8K
Full 1,319-question GSM8K test split, standard 5-shot completion evaluation, greedy decoding, and three independent server starts per variant:
The fused-minus-unfused difference is -0.381 percentage points by mean and -0.228 points by median, within the observed normal-mode run-to-run spread. The deterministic full-model comparison above remains bit-identical.
Speed Tests and Profiling
Measured on NVIDIA GB300 (SM103), TP16 + DP-attention16 + EP16, global concurrency 512 (local decode M=32), ISL/OSL 8192/1024, FP8 KV cache, BF16 SSM state, and CUDA graphs.
Repeated unprofiled serving A/B
Job
630711, three repetitions per variant on the same four-node NVL72 allocation:Per-run output throughput:
Nsight profiling
Summed kernel duration increases from 2190.766 us to 2363.971 us because the side-stream BFA/
f_bwork overlaps QKVG and runs longer under SM contention. Wall time and full-graph latency improve, so those are the relevant end-to-end metrics.The branch was subsequently rebased to current
main; the testedkimi_k3.pyremained byte-identical across that rebase.Checklist
CI States
Latest PR Test (Base): ⏳ Run #35610810492
Latest PR Test (Extra): ❌ Run #35610809019
Latest PR Test (AMD ROCm 10): ⏳ Run #35610809647