model-saver : emit kda_gate_lower_bound for Kimi K3 - #22
Merged
fairydreaming merged 1 commit intoAug 6, 2026
Merged
Conversation
Quick fix. The Kimi K3 loader reads kda_gate_lower_bound and gates a graph branch on it (it scales the KDA gate when the bound is above -INFINITY), but the model saver never wrote the key, so a save->load roundtrip silently dropped it back to the -INFINITY default and changed the model's output. The real K3 config sets gate_lower_bound = -5.0. I propose to emit it from the saver, and set it to -5.0 in the test-llama-archs K3 case so the roundtrip check exercises it (the roundtrip fails without the saver line).
SolshineCode
force-pushed
the
kimi-k3-saver-kda-gate
branch
from
August 5, 2026 21:38
9502233 to
d5ab207
Compare
|
@SolshineCode Thanks! Piotr is currently on vacation, so I'm going to merge this directly to his kimi-k3-text branch. |
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.
This is a simple follow-up to the Kimi K3 arch-test work (now merged into kimi-k3-text).
While the saver roundtrips the other K3 hyperparameters, it never emitted
kda_gate_lower_bound. The K3 loader reads that key and gates a graph branch on it. So in this way it scales the KDA gate when the bound is above -INFINITY (kimi-k3.cpp).
The saver dropped the key, thus a save->load roundtrip silently reset it to
the -INFINITY default and changed the model's output. The real K3 config sets
gate_lower_bound = -5.0.
Changes includes:
actually exercises the key.
Verified with the test value in place, the save->load roundtrip FAILS without
the saver line and PASSES with it. The full test-llama-archs sweep shows no
regressions on the other arches.