{"record":{"id":"60aa143ff990b0ab","repo":"sgl-project/sglang","slug":"not-support-norm-type-norm-type","errorCode":null,"errorMessage":"Not support norm_type: {norm_type}","messagePattern":"Not support norm_type: (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/kimi_k3_vl.py","lineNumber":410,"sourceCode":"\nclass MLP2(nn.Module):\n    def __init__(self, dims: List[int], activation, bias: bool = True):\n        super().__init__()\n        assert len(dims) == 3\n        self.fc0 = nn.Linear(dims[0], dims[1], bias=bias)\n        self.fc1 = nn.Linear(dims[1], dims[2], bias=bias)\n        self.activation = activation\n\n    def forward(self, x: torch.Tensor) -> torch.Tensor:\n        return self.fc1(self.activation(self.fc0(x)))\n\n\ndef _make_norm(norm_type: str, dim: int) -> nn.Module:\n    if norm_type == \"layernorm\":\n        return nn.LayerNorm(dim)\n    if norm_type == \"rmsnorm\":\n        return nn.RMSNorm(dim)\n    raise NotImplementedError(f\"Not support norm_type: {norm_type}\")\n\n\nclass MoonViTEncoderLayer(nn.Module):\n    def __init__(\n        self,\n        num_heads: int,\n        hidden_dim: int,\n        mlp_dim: int,\n        qkv_hidden_size: Optional[int] = None,\n        norm_type: str = \"layernorm\",\n        *,\n        activation=F.gelu,\n        attn_bias: bool = False,\n        linear_bias: bool = True,\n        attention_backend: str = \"sdpa\",\n        attention_workspace: Optional[torch.Tensor] = None,\n    ):\n        super().__init__()","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/kimi_k3_vl.py#L392-L428","documentation":"_make_norm (kimi_k3_vl.py:410) builds the LayerNorm/RMSNorm used by Kimi-K3 vision encoder blocks and only supports norm_type values \"layernorm\" and \"rmsnorm\". Any other string raises NotImplementedError at encoder construction. It exists to fail fast on unsupported checkpoint normalization schemes.","triggerScenarios":"Loading a Kimi-K3-VL checkpoint whose block config specifies a norm_type other than layernorm/rmsnorm (e.g. \"dnorm\", \"groupnorm\").","commonSituations":"Finetuned or experimental checkpoints that swap normalization; config drift between model revisions; hand-merged configs.","solutions":["Inspect the checkpoint config's norm_type fields; align with an official Kimi-K3 revision","Extend _make_norm with the needed norm module if the checkpoint genuinely uses it","Re-download the checkpoint in case of corrupted/partial config files"],"exampleFix":"// before\nraise NotImplementedError(f\"Not support norm_type: {norm_type}\")\n// after (if extending)\nif norm_type == \"groupnorm\":\n    return nn.GroupNorm(min(32, dim), dim)","handlingStrategy":"validation","validationCode":"assert cfg[\"norm_type\"] in {\"layernorm\", \"rmsnorm\"}, cfg[\"norm_type\"]","typeGuard":"def is_supported_norm(t: str) -> bool:\n    return t in {\"layernorm\", \"rmsnorm\"}","tryCatchPattern":null,"preventionTips":["Smoke-test model load in a tiny script before production launches","Diff checkpoint configs against the official revision"],"tags":["kimi-k3","vision","config-validation","not-implemented"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}