Repository navigation
feat: register native kimi_linear, kimi_k25, mimo_v2_flash and unlimited_ocr - #73
Merged
Merged
Conversation
…ted_ocr These four native Transformers 5.22 MoE backbones were absent from MODEL_CONFIG, so convert_model() returned False and their fused 3-D expert tensors were never split. GPT-QModel worked around two of them with a 'defuser_generic_experts' fallback that calls update_module() directly, and had no workaround at all for kimi_k25/unlimited_ocr. The generic experts pass already handles all four; only the registry gate was missing. Registering them makes convert_model() authoritative and preserves model output bit-for-bit. Verified: kimi_linear and mimo_v2_flash tiny models defuse into numbered gate/up/down experts with identical logits; kimi_k25 (256x58) and unlimited_ocr (64x11) expose every routed expert on meta.
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
MODEL_CONFIGwas missing four native Transformers 5.22 MoE backbones that GPT-QModel supports.convert_model()gates on that registry, so it returnedFalsefor them and their fused 3-Dgate_up_proj/down_projtensors were never split.GPT-QModel papered over two of them in
main:There was no workaround at all for
kimi_k25orunlimited_ocr.Fix
Pure registry addition — the generic experts pass (
_handle_moe_modules->prepare_model_for_moe_quantization) already defuses all four:kimi_linearmimo_v2_flashkimi_k25(DeepSeek-V3 text backbone)unlimited_ocrNo version bump:
0.0.31is still unreleased (latest tag isv0.0.30), so this lands in the same release as #72.Tests
test_native_moe_model_types_are_registered— registry floor for all four.test_native_moe_defusion_preserves_forward— tinykimi_linear/mimo_v2_flashmodels produce bit-identical logits after defusion, with numberedgate_proj/up_proj/down_projcontainers.META_MODEL_CASESentries keeptest_meta_model_cases_cover_registered_public_modelsexact.The 21 failures are pre-existing on
main(unrelated registry cases under this Transformers build); the same set fails before and after this branch.Follow-up
GPT-QModel can drop
defuser_generic_expertsfromkimi_linear.py/mimo_v2_flash.pyonce0.0.31ships.