{"record":{"id":"7b63e26d5979a580","repo":"sgl-project/sglang","slug":"cannot-parse-checkpoint-quantization-metadata-for","errorCode":null,"errorMessage":"Cannot parse checkpoint quantization metadata for {component_name!r}: {error}","messagePattern":"Cannot parse checkpoint quantization metadata for (.+?): (.+?)","errorType":"validation","errorClass":"ComponentCheckpointUnsupportedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py","lineNumber":518,"sourceCode":"            return loader\n\n        # For unknown component types, use a generic loader\n        logger.warning(\n            \"No specific loader found for component type: %s. Using generic loader.\",\n            component_name,\n        )\n        return GenericComponentLoader(transformers_or_diffusers, component_architecture)\n\n\nclass PlainStateDictComponentLoader(ComponentLoader):\n    \"\"\"Base for native loaders whose current materializer expects plain weights.\"\"\"\n\n    @staticmethod\n    def ensure_plain_state_dict_checkpoint(config: object, component_name: str) -> None:\n        try:\n            quant_spec = resolve_checkpoint_quant_spec(config)\n        except (TypeError, ValueError) as error:\n            raise ComponentCheckpointUnsupportedError(\n                f\"Cannot parse checkpoint quantization metadata for \"\n                f\"{component_name!r}: {error}\"\n            ) from error\n        if quant_spec is None:\n            return\n\n        method = quant_spec.declared_method or \"unspecified\"\n        raise ComponentCheckpointUnsupportedError(\n            f\"{component_name!r} checkpoint declares quantization metadata in \"\n            f\"{quant_spec.source} (quant_method={method!r}), which its current \"\n            \"plain state-dict materializer cannot restore.\"\n        )\n\n    def load_component_config(\n        self, component_model_path: str, component_name: str\n    ) -> dict[str, Any]:\n        config = get_diffusers_component_config(component_path=component_model_path)\n        self.ensure_plain_state_dict_checkpoint(config, component_name)","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py#L500-L536","documentation":"ensure_plain_state_dict_checkpoint validates that a component loaded via a plain state-dict materializer carries no quantization metadata. If parsing the quant spec itself raises TypeError/ValueError (malformed metadata), it is wrapped as ComponentCheckpointUnsupportedError with this message.","triggerScenarios":"Calling load_component_config or load_customized for a component whose config's quantization metadata is structurally invalid (wrong type or values), so resolve_checkpoint_quant_spec throws.","commonSituations":"Corrupted or hand-edited quantization_config in the component's config.json; checkpoints produced by non-standard quantization tooling; partial downloads.","solutions":["Inspect and repair the component config's quantization-related fields so resolve_checkpoint_quant_spec can parse them","Re-download the component checkpoint","If quantization metadata is unwanted, delete the malformed quantization_config key entirely so quant_spec is None"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try:\n    resolve_checkpoint_quant_spec(config)\nexcept (TypeError, ValueError):\n    raise SystemExit(\"component has malformed quantization metadata; re-download or repair config.json\")","typeGuard":null,"tryCatchPattern":"except ComponentCheckpointUnsupportedError as e:\n    if \"Cannot parse checkpoint quantization metadata\" in str(e):\n        config.pop('quantization_config', None)  # if truly unquantized","preventionTips":["Validate quantization_config structure before deploying a checkpoint","Avoid hand-editing quant metadata"],"tags":["quantization","config","model-loading","fail-closed"],"backgroundTag":"malformed-quantization-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}