{"record":{"id":"ae2cd2bf8b74cad3","repo":"sgl-project/sglang","slug":"intern-s2-mobius-requires-at-least-one-physical-ro","errorCode":null,"errorMessage":"Intern-S2-Mobius requires at least one physical routed-expert bank","messagePattern":"Intern-S2-Mobius requires at least one physical routed-expert bank","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/models/interns2_mobius.py","lineNumber":386,"sourceCode":"            router_logits, _ = self.gate(hidden_states)\n            topk_output = self.topk(hidden_states, router_logits)\n\n        output = self.experts(hidden_states, topk_output)\n        return output.reshape(original_shape)\n\n\ndef _mobius_reduce_combined_output(combined: torch.Tensor) -> torch.Tensor:\n    \"\"\"Apply the one ordinary TP reduction unless the scoped runtime owns it.\"\"\"\n    if get_parallel().tp_size > 1 and not should_skip_post_experts_all_reduce(\n        is_tp_path=True\n    ):\n        return tensor_model_parallel_all_reduce(combined)\n    return combined\n\n\ndef _get_mobius_routed_bank(meta_mlp: nn.ModuleList, layer_id: int) -> nn.Module:\n    if not meta_mlp:\n        raise ValueError(\n            \"Intern-S2-Mobius requires at least one physical routed-expert bank\"\n        )\n    return meta_mlp[layer_id % len(meta_mlp)]\n\n\nclass _InternS2MobiusDecoderMixin:\n    def _init_mobius_mlp(\n        self,\n        config: InternS2MobiusTextConfig,\n        quant_config: QuantizationConfig | None,\n        layer_prefix: str,\n    ) -> None:\n        self.mlp = InternS2MobiusLayerMlp(\n            config=config,\n            quant_config=quant_config,\n            prefix=add_prefix(\"mlp\", layer_prefix),\n        )\n","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/interns2_mobius.py#L368-L404","documentation":"Raised when _get_mobius_routed_bank is called with an empty meta_mlp ModuleList. The routed-expert bank selection requires at least one physical bank to route to. This is an internal model-configuration invariant violation.","triggerScenarios":"_forward_mobius_mlp calls _get_mobius_routed_bank(meta_mlp, layer_id) where meta_mlp is an empty nn.ModuleList — typically when the checkpoint/config declares routed experts but the module list was constructed empty (e.g., num_experts=0 or layer filter excluded all banks).","commonSituations":"Loading a converted Intern-S2-Mobius checkpoint with a mismatched config (moe settings stripped), editing the layer-building code and skipping bank creation, or a partially downloaded/quantized checkpoint.","solutions":["Check the config used to build the model: ensure the routed-expert (MoE) fields produce at least one bank in meta_mlp","Verify the checkpoint was converted for this model implementation (config key names may differ)","Inspect where meta_mlp is populated in the model __init__ to confirm the gating condition"],"exampleFix":"// before\nmeta_mlp = nn.ModuleList(\n    [build_bank(i) for i in range(config.num_banks) if keep(i)]  # keep() never true\n)\n\n// after\nmeta_mlp = nn.ModuleList(\n    [build_bank(i) for i in range(max(1, config.num_banks))]\n)","handlingStrategy":"validation","validationCode":"assert len(meta_mlp) >= 1, \"routed-expert bank list is empty; check config.mooe fields\"","typeGuard":"def has_routed_bank(meta_mlp: nn.ModuleList) -> bool:\n    return len(meta_mlp) > 0","tryCatchPattern":null,"preventionTips":["Validate moe/bank counts in config before building the model","Use official conversion scripts for Intern-S2-Mobius checkpoints"],"tags":["model-config","moe","interns2-mobius"],"backgroundTag":"invalid-model-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}