{"record":{"id":"c731ef186cce96a5","repo":"sgl-project/sglang","slug":"serialized-w4a4-layer-prefix-r-has-unsupported-c","errorCode":null,"errorMessage":"Serialized W4A4 layer {prefix!r} has unsupported convrot_groupsize={convrot_group_size}; expected one of {_SUPPORTED_CONVROT_GROUP_SIZES}","messagePattern":"Serialized W4A4 layer (.+?) has unsupported convrot_groupsize=(.+?); 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":126,"sourceCode":"\n        convrot_group_size, linear_dtype = self._parse_marker(prefix, marker)\n        if not self._supports_input_size(layer.input_size, convrot_group_size):\n            raise ValueError(\n                f\"Serialized W4A4 layer {prefix!r} has input size \"\n                f\"{layer.input_size}, incompatible with quant_group_size=\"\n                f\"{_QUANT_GROUP_SIZE} and convrot_groupsize={convrot_group_size}\"\n            )\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        )","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/quantization/configs/kitchen_w4a4_config.py#L108-L144","documentation":"_parse_marker validates convrot_groupsize (default 256) against _SUPPORTED_CONVROT_GROUP_SIZES. Values outside the set cannot be dispatched to a compiled kernel, so __init__/get_quant_method reject them.","triggerScenarios":"A W4A4 marker whose 'convrot_groupsize' is missing (defaulting to 256, if 256 is unsupported in the build) or set to an unsupported value like 64 or 512.","commonSituations":"Exporter and runtime version skew changing the supported set; hand-edited markers.","solutions":["Use a value from _SUPPORTED_CONVROT_GROUP_SIZES in kitchen_w4a4_config.py","Upgrade/downgrade the exporter so emitted group sizes match the runtime"],"exampleFix":"// before\n{\"convrot_groupsize\": 64}\n// after\n{\"convrot_groupsize\": 256}","handlingStrategy":"validation","validationCode":"from ...kitchen_w4a4_config import _SUPPORTED_CONVROT_GROUP_SIZES\nassert int(marker.get(\"convrot_groupsize\", 256)) in _SUPPORTED_CONVROT_GROUP_SIZES","typeGuard":"def valid_w4a4_convrot_groupsize(m: dict) -> bool:\n    return int(m.get(\"convrot_groupsize\", 256)) in _SUPPORTED_CONVROT_GROUP_SIZES","tryCatchPattern":null,"preventionTips":["Pin exporter/runtime versions so emitted group sizes stay in the supported set"],"tags":["quantization","convrot","group-size","validation"],"backgroundTag":"invalid-config-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}