[Bugfix][Kimi K3] Enable deferred MoE finalization before weight loading - #53327
Merged
zyongye merged 1 commit intoAug 22, 2026
Merged
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
zyongye
marked this pull request as ready for review
August 21, 2026 22:10
zyongye
requested review from
AndreasKaratzas,
DarkLight1337 and
ywang96
as code owners
August 21, 2026 22:10
Member
Author
|
/ci run |
zyongye
enabled auto-merge (squash)
August 21, 2026 22:16
|
✅ Triggered Buildkite CI #85122 for commit |
jeejeelee
approved these changes
Aug 22, 2026
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.
Summary
Root cause
#53152 checked
quant_method.moe_kernelinLatentMoERunner.__init__.Mxfp4MoEMethodinitializes that field toNoneand only creates the kernel later inprocess_weights_after_loading, so the deferred path was always disabled during runner construction even when the supported FlashInfer TRTLLM MXFP4 expert class had already been selected.The tail operator must know whether it consumes an
UnfinalizedMoEOutputduring construction so its CuTeDSL warmup units are registered with the correct top-k shape. This change therefore uses the already-selected expert class at that lifecycle point.Duplicate-work check
53152,50587,K3 latent MoE deferred finalize, andlatent moe tail fusion.UnfinalizedMoEOutputproto following up for #53152 #53310 also follows [K3 Perf] Fuse MXFP4 top-k finalization into latent-tail, ~5% E2E latency reduction #53152, but it changesUnfinalizedMoEOutputtyping in other runners and does not touch this initialization-order bug.Tests
Result:
2 passedon 8x NVIDIA B300. The second test compares deferred and finalized outputs across TP8.Result: both passed.
Serving validation: Kimi-K3 TP8 selected the FlashInfer TRTLLM MXFP4/MXFP8 backend, reported deferred top-k finalization enabled, and completed 40/40 requests with no failures.
AI assistance
OpenAI Codex was used to diagnose the initialization-order issue, draft the code and test, run validation, and prepare this PR. The human submitter must review every changed line and understand and defend the change end-to-end.