Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/mobius/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,13 @@ def _detect_fallback_registration(hf_config) -> ModelRegistration | None:
"qwen2_vl_text": ModelRegistration(Qwen25VLTextModel),
"qwen3_5": ModelRegistration(Qwen35VL3ModelCausalLMModel, task="hybrid-qwen-vl"),
"qwen3_5_moe_vl": ModelRegistration(Qwen35MoEVL3ModelCausalLMModel, task="hybrid-qwen-vl"),
# Text-only sibling of ``qwen3_5_moe_vl`` (Qwen3.6-35B-A3B). The MoE
# backbone ``Qwen35MoECausalLMModel`` already strips ``language_model.``
# and drops ``visual.``/MTP keys, so it consumes the VL checkpoint's text
# weights directly; ``build(..., text_only=True)`` routes here via
# ``_TEXT_ONLY_MODEL_TYPE``. It also matches the VL ``text_config``'s own
# ``model_type=qwen3_5_moe_text`` so that config resolves cleanly.
"qwen3_5_moe_text": ModelRegistration(Qwen35MoECausalLMModel),
"qwen3_5_vl": ModelRegistration(Qwen35VL3ModelCausalLMModel, task="hybrid-qwen-vl"),
"qwen3_5_vl_text": ModelRegistration(Qwen35VLTextModel),
"qwen3_vl": ModelRegistration(Qwen3VL3ModelCausalLMModel, task="qwen-vl"),
Expand Down Expand Up @@ -791,6 +798,12 @@ def _create_default_registry() -> ModelRegistry:
_TEXT_ONLY_MODEL_TYPE: dict[str, str] = {
"gemma4_unified": "gemma4_unified_text",
"gemma4_unified_text": "gemma4_unified_text",
# Qwen3.5-MoE-VL (Qwen3.6-35B-A3B): export just the hybrid MoE text
# backbone as a standalone decoder-only LLM. The builder overrides
# ``qwen3_5_moe`` -> ``qwen3_5_moe_vl`` when a ``vision_config`` is present,
# so the text-only override keys off the VL type here.
"qwen3_5_moe_vl": "qwen3_5_moe_text",
Comment on lines +801 to +805
"qwen3_5_moe_text": "qwen3_5_moe_text",
}


Expand Down Expand Up @@ -894,6 +907,7 @@ def _create_default_registry() -> ModelRegistry:
"qwen2_moe": "Qwen/Qwen1.5-MoE-A2.7B-Chat",
"qwen3_moe": "Qwen/Qwen3-30B-A3B",
"qwen3_5_moe": "Qwen/Qwen3.5-MoE-A3B-128K",
"qwen3_5_moe_text": "Qwen/Qwen3.6-35B-A3B",
"qwen3_next": "Qwen/Qwen3-235B-A22B",
"granitemoe": "ibm-granite/granite-3.0-1b-a400m-instruct",
"olmoe": "allenai/OLMoE-1B-7B-0924",
Expand Down Expand Up @@ -1141,6 +1155,7 @@ def _create_default_registry() -> ModelRegistry:
"qwen3_moe": "qwen",
"qwen3_5_text": "qwen",
"qwen3_5_moe": "qwen",
"qwen3_5_moe_text": "qwen",
"qwen3_next": "qwen",
"qwen2_vl": "qwen",
"qwen2_vl_text": "qwen",
Expand Down
23 changes: 23 additions & 0 deletions tests/_test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,29 @@ def _base_config(config_cls=None, **overrides) -> ArchitectureConfig:
},
True,
),
# Text-only sibling of the Qwen3.5-MoE-VL (Qwen3.6-35B-A3B) checkpoint,
# exported via ``build(..., text_only=True)``. Same hybrid MoE backbone as
# ``qwen3_5_moe`` above; registered separately so the VL ``text_config``'s
# ``model_type=qwen3_5_moe_text`` and the text-only override both resolve.
(
"qwen3_5_moe_text",
{
"hidden_act": "silu",
"layer_types": ["linear_attention", "full_attention"],
"partial_rotary_factor": 0.25,
"mrope_interleaved": True,
"num_local_experts": 4,
"num_experts_per_tok": 2,
"moe_intermediate_size": 32,
"shared_expert_intermediate_size": 32,
"linear_num_value_heads": 4,
"linear_num_key_heads": 2,
"linear_key_head_dim": 16,
"linear_value_head_dim": 16,
"linear_conv_kernel_dim": 4,
},
True,
),
# === Falcon and Bloom ===
# dual_ln=True: Falcon with new_decoder_architecture uses separate ln_attn + ln_mlp.
# hidden_act="gelu": real Falcon uses GELU (HF FalconConfig.activation default);
Expand Down
1 change: 1 addition & 0 deletions tests/build_graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"minimax",
"qwen3_5_text",
"qwen3_5_moe",
"qwen3_5_moe_text",
"qwen3_next",
# Models using LinearAttention / CausalConvWithState custom ops
# prevent full shape/type propagation through com.microsoft domain.
Expand Down
Loading