{"record":{"id":"faccfb8425abd6bc","repo":"sgl-project/sglang","slug":"unsupported-activation-hidden-act","errorCode":null,"errorMessage":"Unsupported activation: {hidden_act}","messagePattern":"Unsupported activation: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/kimi_k3.py","lineNumber":336,"sourceCode":"        self.down_proj = RowParallelLinear(\n            intermediate_size,\n            hidden_size,\n            bias=False,\n            quant_config=quant_config,\n            reduce_results=reduce_results,\n            use_dp_attention_reduce=self._dense_attn_tp,\n            prefix=f\"{prefix}.down_proj\",\n            **_tp_kwargs,\n        )\n        if hidden_act == \"silu\":\n            self.act_fn = SiluAndMul()\n        elif hidden_act == \"situ\":\n            self.act_fn = SituAndMul(\n                beta=activation_situ_beta or 1.0,\n                linear_beta=activation_situ_linear_beta,\n            )\n        else:\n            raise ValueError(f\"Unsupported activation: {hidden_act}\")\n        self._dp_attention = is_dp_attention_enabled()\n\n    def forward(\n        self,\n        hidden_states: torch.Tensor,\n        *,\n        prefix_sum: Optional[torch.Tensor] = None,\n        forward_batch: Optional[ForwardBatch] = None,\n    ) -> torch.Tensor:\n        # DP attention only when driven from the decoder layer (forward_batch\n        # given); the shared-experts instance inside KimiK3MoE passes None and\n        # runs on the already-gathered buffer.\n        use_dp = (\n            self._dp_attention and forward_batch is not None and not self._dense_attn_tp\n        )\n        if use_dp:\n            local_hidden_states = hidden_states\n            hidden_states = get_global_dp_buffer(get_tp_group())","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/kimi_k3.py#L318-L354","documentation":"KimiK3MLP.__init__ maps config.hidden_act (with activation_situ_beta variants) to a concrete activation module and only supports the enumerated set (which includes 'situ'). Any other string falls through to ValueError('Unsupported activation: {hidden_act}'), protecting the MLP from constructing with an unimplemented kernel.","triggerScenarios":"Loading a Kimi K3 model whose config.json hidden_act is not in the supported list (e.g. 'silu' variants not handled here, 'gelu_new', a typo, or a new activation introduced in a newer checkpoint) — raised during model construction, before any forward.","commonSituations":"Newer Kimi K3 checkpoint revisions with a renamed/added activation; hand-edited configs; passing a non-Kimi config to the K3 architecture; sglang version older than the checkpoint format.","solutions":["Check the checkpoint's config.json hidden_act value and set it to a supported activation ('situ' for Kimi K3).","Upgrade sglang to a release that supports the new activation name if the checkpoint uses a recently added one.","If you control the checkpoint, re-export with the supported activation or add the new activation branch in KimiK3MLP.__init__ upstream."],"exampleFix":"// before (config.json)\n{\"hidden_act\": \"situ_v2\"}\n\n// after\n{\"hidden_act\": \"situ\"}","handlingStrategy":"validation","validationCode":"supported = {\"situ\"}  # per KimiK3MLP enumeration\nact = json.load(open(model_config_path))[\"hidden_act\"]\nassert act in supported, f\"hidden_act {act} unsupported by KimiK3MLP\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate config.json against the target architecture before launch.","Pin sglang version matched to the checkpoint release."],"tags":["activation","config-validation","model-loading","kimi"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}