Skip to content

feat: register native kimi_linear, kimi_k25, mimo_v2_flash and unlimited_ocr - #73

Merged
Qubitium merged 1 commit into
mainfrom
feat/register-native-moe-types
Nov 14, 2026
Merged

Qubitium merged 1 commit into
mainfrom
feat/register-native-moe-types

Conversation

@Qubitium

Copy link
Copy Markdown
Contributor

Summary

MODEL_CONFIG was missing four native Transformers 5.22 MoE backbones that GPT-QModel supports. convert_model() gates on that registry, so it returned False for them and their fused 3-D gate_up_proj/down_proj tensors were never split.

GPT-QModel papered over two of them in main:

# gptqmodel/models/definitions/kimi_linear.py  (and mimo_v2_flash.py)
# Transformers 5.22 fuses the checkpoint's per-expert projections into 3-D
# parameters; Defuser has no registry entry for this model type, so the
# loader runs its generic experts pass explicitly.
defuser_generic_experts = True

There was no workaround at all for kimi_k25 or unlimited_ocr.

Fix

Pure registry addition — the generic experts pass (_handle_moe_modules -> prepare_model_for_moe_quantization) already defuses all four:

model_type experts layers
kimi_linear 4 2 (tiny)
mimo_v2_flash 4 2 (tiny)
kimi_k25 (DeepSeek-V3 text backbone) 256 58
unlimited_ocr 64 11

No version bump: 0.0.31 is still unreleased (latest tag is v0.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 — tiny kimi_linear / mimo_v2_flash models produce bit-identical logits after defusion, with numbered gate_proj/up_proj/down_proj containers.
  • Four new META_MODEL_CASES entries keep test_meta_model_cases_cover_registered_public_models exact.
$ python -m pytest tests -q
161 passed, 21 failed

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_experts from kimi_linear.py / mimo_v2_flash.py once 0.0.31 ships.

…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.
@Qubitium Qubitium changed the title feat: register native kimi_linear, kimi_k25, mimo_v2_flash and unlimeted_ocr feat: register native kimi_linear, kimi_k25, mimo_v2_flash and unlimited_ocr Nov 14, 2026
@Qubitium
Qubitium merged commit 3c43f27 into main Nov 14, 2026
2 checks passed
@Qubitium
Qubitium deleted the feat/register-native-moe-types branch November 14, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant