{"record":{"id":"c4b3ee962f79c262","repo":"sgl-project/sglang","slug":"unsupported-activation-type-self-glu-act","errorCode":null,"errorMessage":"Unsupported activation type {self.glu_act}","messagePattern":"Unsupported activation type (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/phi4mm_utils.py","lineNumber":222,"sourceCode":"        else:\n            self.ext_pw_conv_1d = nn.Conv1d(\n                input_dim,\n                output_dim * 2,\n                kernel_size,\n                1,\n                padding=(kernel_size - 1) // 2,\n            )\n\n        if glu_type == \"sigmoid\":\n            self.glu_act = nn.Sigmoid()\n        elif glu_type == \"relu\":\n            self.glu_act = nn.ReLU()\n        elif glu_type == \"gelu\":\n            self.glu_act = nn.GELU()\n        elif glu_type == \"swish\":\n            self.glu_act = Swish()\n        else:\n            raise ValueError(f\"Unsupported activation type {self.glu_act}\")\n\n        if bias_in_glu:\n            self.b1 = nn.Parameter(torch.zeros(1, output_dim, 1))\n            self.b2 = nn.Parameter(torch.zeros(1, output_dim, 1))\n\n    def forward(self, x):\n        \"\"\"\n        Args:\n            x: torch.Tensor\n                input tensor\n        \"\"\"\n        # to be consistent with GLULinear, we assume the input always has the\n        # #channel (#dim) in the last dimension of the tensor, so need to\n        # switch the dimension first for 1D-Conv case\n        x = x.permute([0, 2, 1])\n        x = self.ext_pw_conv_1d(x)\n        if self.glu_type == \"bilinear\":\n            if self.bias_in_glu:","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/phi4mm_utils.py#L204-L240","documentation":"A GLU (gated linear unit) block in phi4mm_utils.py only supports relu, gelu, and swish activation types for its gate. Passing any other glu_type string raises ValueError — note the message mistakenly interpolates self.glu_act, so it prints an activation object, but the real problem is the glu_type config value.","triggerScenarios":"Constructing the GLU module (used in the Phi-4-MM audio conformer feed-forward) with glu_type not in {'relu','gelu','swish'} — e.g. 'silu', 'tanh', 'mish', or a typo.","commonSituations":"Porting a conformer config from another codebase (NeMo uses e.g. 'swish'/'gelu' but other libs use 'silu'); typos or case differences in config files.","solutions":["Set glu_type to one of relu, gelu, or swish in the audio/conformer config","If you need silu/mish, map it to swish (they are equivalent) or add the activation as a new branch before the raise"],"exampleFix":"# before\nGLU(output_dim, input_dim, glu_type=\"silu\")  # ValueError\n# after\nGLU(output_dim, input_dim, glu_type=\"swish\")  # swish == silu","handlingStrategy":"validation","validationCode":"assert glu_type in (\"relu\", \"gelu\", \"swish\"), f\"unsupported glu_type: {glu_type}\"","typeGuard":"def is_supported_glu_type(t: str) -> bool:\n    return t in (\"relu\", \"gelu\", \"swish\")","tryCatchPattern":null,"preventionTips":["Map 'silu' to 'swish' when porting configs from other libraries","Keep an allowlist of activation names next to your config loader"],"tags":["phi4","activation","glu","config-validation"],"backgroundTag":"unsupported-activation-function","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}