{"record":{"id":"90b2a130e4f4224f","repo":"sgl-project/sglang","slug":"unsupported-activation-config-hidden-act-only-90b2a1","errorCode":null,"errorMessage":"Unsupported activation: {config.hidden_act}. Only silu is supported for now.","messagePattern":"Unsupported activation: (.+?)\\. Only silu is supported for now\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/mimo_v2.py","lineNumber":397,"sourceCode":"        layer_id: int,\n        quant_config: Optional[QuantizationConfig] = None,\n        prefix: str = \"\",\n        is_nextn: bool = False,\n    ):\n        super().__init__()\n        self.tp_size = get_parallel().tp_size\n\n        self.config = config\n        self.layer_id = layer_id\n\n        if self.tp_size > config.n_routed_experts:\n            raise ValueError(\n                f\"Tensor parallel size {self.tp_size} is greater than \"\n                f\"the number of experts {config.n_routed_experts}.\"\n            )\n\n        if config.hidden_act != \"silu\":\n            raise ValueError(\n                f\"Unsupported activation: {config.hidden_act}. \"\n                \"Only silu is supported for now.\"\n            )\n\n        self.gate = MoEGate(\n            config=config,\n            quant_config=quant_config,\n            prefix=add_prefix(\"gate\", prefix),\n            is_nextn=is_nextn,\n        )\n\n        experts_type = get_moe_impl_class(quant_config)\n        self.experts = experts_type(\n            num_experts=config.n_routed_experts\n            + get_exec().moe.ep_num_redundant_experts,\n            top_k=config.num_experts_per_tok,\n            hidden_size=config.hidden_size,\n            intermediate_size=config.moe_intermediate_size,","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/mimo_v2.py#L379-L415","documentation":"The MoE block, like the dense MLP, only supports SiluAndMul and rejects any config.hidden_act other than 'silu' at init.","triggerScenarios":"Constructing the MiMo-v2 MoE layer with a config whose hidden_act != 'silu'.","commonSituations":"Modified config.json on fine-tuned MoE variants; derivative models reusing the mimo_v2 architecture with a different expert activation.","solutions":["Set \"hidden_act\": \"silu\" in config.json","Extend the MoE block to support the needed activation if the checkpoint truly uses it","Use the model class matching the checkpoint architecture"],"exampleFix":"// before\n\"hidden_act\": \"gelu\"\n// after\n\"hidden_act\": \"silu\"","handlingStrategy":"validation","validationCode":"if config.hidden_act != 'silu':\n    raise SystemExit('MiMo-v2 MoE requires hidden_act=silu')","typeGuard":"def moe_act_supported(cfg) -> bool:\n    return getattr(cfg, 'hidden_act', None) == 'silu'","tryCatchPattern":null,"preventionTips":["Validate config.json activation field before model init","Don't reuse mimo_v2 classes for models with different MoE activations"],"tags":["config-validation","activation","moe","mimo"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}