{"record":{"id":"2cd022b42919e090","repo":"sgl-project/sglang","slug":"unsupported-activation-hidden-act-only-xielu-i","errorCode":null,"errorMessage":"Unsupported activation: {hidden_act}. Only xIELU is supported for now.","messagePattern":"Unsupported activation: (.+?)\\. Only xIELU is supported for now\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/models/apertus.py","lineNumber":89,"sourceCode":"    ) -> None:\n        super().__init__()\n        self.up_proj = ColumnParallelLinear(\n            hidden_size,\n            intermediate_size,\n            bias=bias,\n            quant_config=quant_config,\n            prefix=add_prefix(\"up_proj\", prefix),\n        )\n        self.down_proj = RowParallelLinear(\n            intermediate_size,\n            hidden_size,\n            bias=bias,\n            quant_config=quant_config,\n            prefix=add_prefix(\"down_proj\", prefix),\n            reduce_results=reduce_results,\n        )\n        if hidden_act != \"xielu\":\n            raise ValueError(\n                f\"Unsupported activation: {hidden_act}. \"\n                \"Only xIELU is supported for now.\"\n            )\n        self.act_fn = XIELU()\n\n    def forward(\n        self,\n        x,\n        forward_batch=None,\n    ):\n        # note: with xielu, there's no gate_proj\n        x, _ = self.up_proj(x)\n        x = self.act_fn(x)\n        x, _ = self.down_proj(x)\n        return x\n\n\nclass ApertusAttention(nn.Module):","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/apertus.py#L71-L107","documentation":"The Apertus MLP only implements the xIELU activation; the config's hidden_act must be exactly 'xielu'. Any other activation string raises at model construction.","triggerScenarios":"Loading an Apertus checkpoint whose config.json hidden_act is anything but \"xielu\" (e.g. \"silu\", \"gelu\").","commonSituations":"Fine-tuned Apertus variants that swapped the activation; checkpoint conversion tools writing the default HF activation name.","solutions":["Set \"hidden_act\": \"xielu\" in config.json","Use a checkpoint that actually uses xIELU; do not point Apertus code at a silu-based variant"],"exampleFix":"// before\n\"hidden_act\": \"silu\"\n// after\n\"hidden_act\": \"xielu\"","handlingStrategy":"validation","validationCode":"assert config.hidden_act == \"xielu\", f\"Apertus requires xielu, got {config.hidden_act}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate hidden_act against model-specific allowlists before load"],"tags":["activation","config-validation","apertus"],"backgroundTag":"unsupported-activation-function","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}