{"record":{"id":"9531026f1a9c00a4","repo":"sgl-project/sglang","slug":"unsupported-activation-hidden-act-only-silu-is-953102","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/internlm2.py","lineNumber":72,"sourceCode":"        prefix: str = \"\",\n    ) -> None:\n        super().__init__()\n        self.gate_up_proj = MergedColumnParallelLinear(\n            hidden_size,\n            [intermediate_size] * 2,\n            bias=False,\n            quant_config=quant_config,\n            prefix=add_prefix(\"gate_up_proj\", prefix),\n        )\n        self.w2 = RowParallelLinear(\n            intermediate_size,\n            hidden_size,\n            bias=False,\n            quant_config=quant_config,\n            prefix=add_prefix(\"w2\", prefix),\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(self, x):\n        gate_up, _ = self.gate_up_proj(x)\n        x = self.act_fn(gate_up)\n        x, _ = self.w2(x)\n        return x\n\n\nclass InternLM2Attention(nn.Module):\n    def __init__(\n        self,\n        hidden_size: int,\n        num_heads: int,\n        num_kv_heads: int,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/internlm2.py#L54-L90","documentation":"InternLM2 MLP rejects any hidden_act other than 'silu' because its forward path hard-codes SiluAndMul. The check runs in __init__ right before constructing the activation.","triggerScenarios":"Loading an InternLM2 config whose hidden_act is e.g. 'gelu', 'gelu_new', or misspelled.","commonSituations":"Custom/finetuned InternLM2 checkpoint edited to a different activation; config typo in hidden_act.","solutions":["Set hidden_act='silu' in the model config (correct for stock InternLM2)","If the checkpoint truly uses another activation, patch the model class to support it before using it"],"exampleFix":"# before\nconfig.hidden_act = \"gelu\"\n# after\nconfig.hidden_act = \"silu\"","handlingStrategy":"validation","validationCode":"assert config.hidden_act == 'silu', config.hidden_act","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate required config fields against model requirements in a preflight check"],"tags":["activation","config-mismatch","internlm2","weight-loading"],"backgroundTag":"unsupported-enum-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}