{"record":{"id":"4c996509baed7517","repo":"sgl-project/sglang","slug":"unsupported-activation-hidden-act-only-silu-is-4c9965","errorCode":null,"errorMessage":"Unsupported activation: {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":320,"sourceCode":"            [intermediate_size] * 2,\n            bias=False,\n            quant_config=quant_config,\n            prefix=add_prefix(\"gate_up_proj\", prefix),\n            tp_rank=tp_rank,\n            tp_size=tp_size,\n        )\n        self.down_proj = RowParallelLinear(\n            intermediate_size,\n            hidden_size,\n            bias=False,\n            quant_config=quant_config,\n            reduce_results=reduce_results,\n            prefix=add_prefix(\"down_proj\", prefix),\n            tp_rank=tp_rank,\n            tp_size=tp_size,\n        )\n        if hidden_act != \"silu\":\n            raise ValueError(\n                f\"Unsupported activation: {hidden_act}. \"\n                \"Only silu is supported for now.\"\n            )\n        self.act_fn = SiluAndMul()\n\n    def forward(\n        self,\n        x,\n        forward_batch: ForwardBatch = None,\n    ):\n        if (self.tp_size == 1) and x.shape[0] == 0:\n            return x\n\n        gate_up, _ = self.gate_up_proj(x)\n        x = self.act_fn(gate_up)\n        x, _ = self.down_proj(x)\n        return x\n","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/mimo_v2.py#L302-L338","documentation":"The MiMo-v2 MLP verifies hidden_act is 'silu' because it hardcodes SiluAndMul. Any other activation string in the config is rejected at module construction time.","triggerScenarios":"Constructing the MLP with config.hidden_act set to anything other than 'silu' (e.g. 'gelu', 'gelu_new') for a MiMo-v2 model.","commonSituations":"Fine-tuned or re-exported checkpoints with a modified config.json activation field; using the mimo_v2 model class for a derivative model with a different activation.","solutions":["Set \"hidden_act\": \"silu\" in the model's config.json","If the model genuinely uses another activation, add support in the MLP class instead of SiluAndMul","Use the correct model class matching the checkpoint's architecture"],"exampleFix":"// before\n\"hidden_act\": \"gelu_new\"\n// after\n\"hidden_act\": \"silu\"","handlingStrategy":"validation","validationCode":"if config.hidden_act != 'silu':\n    raise SystemExit('this model class requires hidden_act=silu')","typeGuard":"def is_silu(cfg) -> bool:\n    return getattr(cfg, 'hidden_act', None) == 'silu'","tryCatchPattern":null,"preventionTips":["Check hidden_act in config.json before instantiating mimo_v2 classes","Keep config.json unmodified from the official release"],"tags":["config-validation","activation","mimo"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}