Repository navigation
fix: opt Kimi Linear out of chunked prefill - #2293
Merged
Merged
Conversation
Kimi Linear resets model-owned Delta and MLA state when a multi-token forward carries no sequence ID. Advertise the conservative single-pass policy so cache-less trait callers cannot silently discard earlier prompt pieces while preserving the independent-prompt reset contract. Add a tiny model loaded through `KimiLinearModel::from_weights` and assert the capability through `LanguageModel`. The focused CUDA test, formatting, and diff checks pass. Real checkpoint runs remain degenerate with token ID 0 and are tracked separately in #2292. Refs #1749
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
KimiLinearModel::from_weightsregression that checks the capability throughLanguageModel.Validation
mlxcelandmlxcel-surgeryCUDA test graph builds successfully.MLXCEL_PREFILL_CHUNK=0, plus a 21-token chunk-disabled prompt. Baseline and candidate both emitted token ID 0, so these runs do not establish accuracy or numerical parity. The separate runtime defect is tracked in fix(kimi_linear): diagnose CUDA token-zero degeneration #2292 with exact build and checkpoint revisions.This conservative policy can increase long-prompt transient memory by using one prefill graph. Current DirectEngine carries a stable sequence ID across pieces, while legacy cache-less callers remain protected from silently resetting earlier no-ID pieces.
Closes #1749