{"record":{"id":"b36b06d5198e0ff5","repo":"sgl-project/sglang","slug":"serialized-w4a4-layer-prefix-r-has-unsupported-l","errorCode":null,"errorMessage":"Serialized W4A4 layer {prefix!r} has unsupported linear_dtype={linear_dtype!r}; expected one of {_SUPPORTED_LINEAR_DTYPES}","messagePattern":"Serialized W4A4 layer (.+?) has unsupported linear_dtype=(.+?); expected one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/layers/quantization/configs/kitchen_w4a4_config.py","lineNumber":133,"sourceCode":"            )\n        self.selected.append(prefix)\n        return KitchenW4A4LinearMethod(\n            convrot_group_size=convrot_group_size,\n            linear_dtype=linear_dtype,\n        )\n\n    @staticmethod\n    def _parse_marker(prefix: str, marker: dict[str, Any]) -> tuple[int, str]:\n        convrot_group_size = int(marker.get(\"convrot_groupsize\", 256))\n        if convrot_group_size not in _SUPPORTED_CONVROT_GROUP_SIZES:\n            raise ValueError(\n                f\"Serialized W4A4 layer {prefix!r} has unsupported \"\n                f\"convrot_groupsize={convrot_group_size}; expected one of \"\n                f\"{_SUPPORTED_CONVROT_GROUP_SIZES}\"\n            )\n        linear_dtype = str(marker.get(\"linear_dtype\", \"int4\"))\n        if linear_dtype not in _SUPPORTED_LINEAR_DTYPES:\n            raise ValueError(\n                f\"Serialized W4A4 layer {prefix!r} has unsupported \"\n                f\"linear_dtype={linear_dtype!r}; expected one of \"\n                f\"{_SUPPORTED_LINEAR_DTYPES}\"\n            )\n        return convrot_group_size, linear_dtype\n\n    @staticmethod\n    def _supports_input_size(input_size: int, convrot_group_size: int) -> bool:\n        return (\n            input_size % _QUANT_GROUP_SIZE == 0 and input_size % convrot_group_size == 0\n        )\n\n    def supports_input_partition(\n        self, prefix: str, input_size_per_partition: int\n    ) -> bool:\n        marker = self.layer_markers.get(prefix)\n        if marker is None:\n            return True","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/quantization/configs/kitchen_w4a4_config.py#L115-L151","documentation":"_parse_marker validates linear_dtype (default 'int4') against _SUPPORTED_LINEAR_DTYPES. Only specific 4-bit storage dtypes have W4A4 kernels, so an unknown dtype string (e.g. 'int8', 'fp4_e2m1') is rejected.","triggerScenarios":"A marker with \"linear_dtype\": \"fp4\" or another string not in _SUPPORTED_LINEAR_DTYPES.","commonSituations":"Exporter emitting new dtype names the installed runtime doesn't know; typos in hand-written markers.","solutions":["Set linear_dtype to a supported value (check _SUPPORTED_LINEAR_DTYPES, e.g. 'int4')","Align exporter and sglang runtime versions"],"exampleFix":"// before\n{\"linear_dtype\": \"nf4\"}\n// after\n{\"linear_dtype\": \"int4\"}","handlingStrategy":"validation","validationCode":"from ...kitchen_w4a4_config import _SUPPORTED_LINEAR_DTYPES\nassert marker.get(\"linear_dtype\", \"int4\") in _SUPPORTED_LINEAR_DTYPES","typeGuard":"def valid_w4a4_linear_dtype(m: dict) -> bool:\n    return str(m.get(\"linear_dtype\", \"int4\")) in _SUPPORTED_LINEAR_DTYPES","tryCatchPattern":null,"preventionTips":["Omit linear_dtype to take the safe 'int4' default unless the export used another supported value"],"tags":["quantization","dtype","validation","w4a4"],"backgroundTag":"invalid-config-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}