{"record":{"id":"76050f6c7695b6e6","repo":"sgl-project/sglang","slug":"cannot-configure-checkpoint-quantization-for-comp","errorCode":null,"errorMessage":"Cannot configure checkpoint quantization for {component_name!r}: {error}","messagePattern":"Cannot configure checkpoint quantization for (.+?): (.+?)","errorType":"validation","errorClass":"ComponentCheckpointUnsupportedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py","lineNumber":283,"sourceCode":"            )\n        # Preserve model-owned formats such as Ideogram's bitsandbytes state.\n        # Those models parse metadata, construct layers, and attach quant states\n        # themselves; running the generic lifecycle as well would process twice.\n        return\n\n    _delegate_standard_bnb4_to_transformers(\n        component_config,\n        component_name,\n    )\n    try:\n        quant_config = _get_encoder_quant_config(\n            component_config,\n            component_model_path,\n            component_weights_path,\n            model_cls,\n        )\n    except (KeyError, NotImplementedError, TypeError, ValueError) as error:\n        raise ComponentCheckpointUnsupportedError(\n            f\"Cannot configure checkpoint quantization for {component_name!r}: {error}\"\n        ) from error\n    model_config.quant_config = quant_config\n    if explicit_quantization is not None:\n        if quant_config is not None:\n            raise ComponentCheckpointUnsupportedError(\n                f\"{component_name!r} already declares checkpoint quantization; \"\n                \"drop the explicit online quantization override\"\n            )\n        if explicit_quantization not in _ONLINE_ENCODER_QUANTIZATIONS:\n            raise ComponentCheckpointUnsupportedError(\n                f\"Online quantization {explicit_quantization!r} is not supported \"\n                f\"for native encoders; choose one of \"\n                f\"{sorted(_ONLINE_ENCODER_QUANTIZATIONS)}\"\n            )\n        from sglang.multimodal_gen.runtime.layers.quantization import (\n            get_quantization_config,\n        )","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py#L265-L301","documentation":"Wrapper error: the underlying checkpoint-quantization parser (get_quantization_config path) raised KeyError/NotImplementedError/TypeError/ValueError while deriving a quant config for the component, and it is re-raised as ComponentCheckpointUnsupportedError with the component name and original error chained. The root cause is in {error}.","triggerScenarios":"Loading a component whose config/weights metadata is malformed or uses an unrecognized quantization format: missing keys in quantization_config (KeyError), unknown quant method (NotImplementedError), wrong config types (TypeError), or invalid values (ValueError) inside _configure_encoder_quantization.","commonSituations":"Checkpoint saved by a newer/older library version with a quantization_config schema this loader can't parse; hand-edited config.json; exotic quant formats (e.g. compressed-tensors variants) not registered; truncated weight-file metadata.","solutions":["Read the chained {error} text to identify the underlying exception and fix that (e.g. correct the quantization_config field)","Regenerate or re-download the checkpoint config so the quantization_config matches a supported format","If the format is genuinely unsupported, convert/dequantize the checkpoint or use a supported quantization variant","As a last resort remove quantization_config to load unquantized weights"],"exampleFix":"// before\n{\"quantization_config\": {\"quant_method\": \"my_custom_fmt\"}}\n\n// after\n{\"quantization_config\": {\"quant_method\": \"fp8\", \"fmt\": \"e4m3\"}}","handlingStrategy":"try-catch","validationCode":"import json\ncfg = json.loads((model_path / \"config.json\").read_text())\nqc = cfg.get(\"quantization_config\")\nassert qc is None or qc.get(\"quant_method\") in SUPPORTED_METHODS, f\"unsupported: {qc}\"","typeGuard":null,"tryCatchPattern":"try:\n    _configure_encoder_quantization(...)\nexcept ComponentCheckpointUnsupportedError as e:\n    if \"Cannot configure checkpoint quantization\" in str(e):\n        logger.error(\"bad quant metadata: %s\", e.__cause__)\n        raise\n","preventionTips":["Validate quantization_config schema before loading","Keep checkpoints from tool versions compatible with your sglang version"],"tags":["quantization","checkpoint-parsing","config-error","text-encoder"],"backgroundTag":"checkpoint-quantization-parse-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}