{"record":{"id":"b770efe810985431","repo":"sgl-project/sglang","slug":"unsupported-mobius-layer-type-checkpoint-type","errorCode":null,"errorMessage":"Unsupported Mobius layer type: {checkpoint_type}","messagePattern":"Unsupported Mobius layer type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/interns2_mobius.py","lineNumber":747,"sourceCode":"        def get_layer(idx: int, prefix: str):\n            checkpoint_type = config.layer_types[idx]\n            if checkpoint_type == \"full_attention\":\n                return InternS2MobiusAttentionDecoderLayer(\n                    config=config,\n                    layer_id=idx,\n                    quant_config=quant_config,\n                    prefix=add_prefix(\"self_attn\", prefix),\n                    alt_stream=alt_stream,\n                )\n            if checkpoint_type == \"linear_attention\":\n                return InternS2MobiusLinearDecoderLayer(\n                    config=config,\n                    layer_id=idx,\n                    quant_config=quant_config,\n                    prefix=add_prefix(\"linear_attn\", prefix),\n                    alt_stream=alt_stream,\n                )\n            raise ValueError(f\"Unsupported Mobius layer type: {checkpoint_type}\")\n\n        self.layers, self._start_layer, self._end_layer = make_layers(\n            config.num_hidden_layers,\n            get_layer,\n            pp_rank=0,\n            pp_size=1,\n            prefix=f\"{prefix}.layers\",\n        )\n        self.norm = GemmaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)\n        self.layers_to_capture = []\n\n    def get_hidden_dim(self, module_name: str, layer_idx: int):\n        if module_name == \"gate_up_proj\":\n            return (\n                self.config.hidden_size,\n                self.config.shared_expert_intermediate_size * 2,\n            )\n        if module_name == \"down_proj\":","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/interns2_mobius.py#L729-L765","documentation":"The layer factory only recognizes a fixed set of Mobius layer types (the branches above, ending in linear_attn). Any other checkpoint_type string falls through to this generic ValueError.","triggerScenarios":"config/checkpoint layer type strings not matching the supported set (e.g., a new 'mamba2' or renamed 'gated_delta' variant), causing no branch of get_layer to return before the fallthrough.","commonSituations":"Loading checkpoints from a newer/older Intern-S2-Mobius release with renamed layer types, or hand-edited configs.","solutions":["Print checkpoint_type in the factory to see the actual string","Map the new type string to the closest supported layer in your config","Update the model implementation to handle the new layer type"],"exampleFix":"# before\nif checkpoint_type == \"linear_attn\": ...\nraise ValueError(...)\n\n# after\nif checkpoint_type in (\"linear_attn\", \"gated_delta_net\"):\n    return _InternS2MobiusLinearAttn(...)","handlingStrategy":"validation","validationCode":"SUPPORTED = {\"full_attn\", \"linear_attn\"}  # per factory branches\nassert checkpoint_type in SUPPORTED, f\"unsupported layer type {checkpoint_type}\"","typeGuard":"def is_supported_layer(t: str) -> bool:\n    return t in {\"full_attn\", \"linear_attn\"}","tryCatchPattern":"try:\n    layer = get_layer(idx, checkpoint_type)\nexcept ValueError as e:\n    if \"Unsupported Mobius layer type\" in str(e):\n        raise RuntimeError(f\"convert checkpoint: {e}\")\n    raise","preventionTips":["Validate config layer-type strings against the supported set before load","Pin checkpoint format versions to your sglang version"],"tags":["layer-type","checkpoint-compat","model-config"],"backgroundTag":"unsupported-checkpoint-layer-type","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}