{"record":{"id":"0338b689d64ab8ae","repo":"sgl-project/sglang","slug":"cannot-parse-checkpoint-quantization-for-componen","errorCode":null,"errorMessage":"Cannot parse checkpoint quantization for {component_name!r}: {quantization_error}","messagePattern":"Cannot parse 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":341,"sourceCode":"    explicit_quantization: str | None = None,\n    ignored_layers: list[str] | None = None,\n) -> type[nn.Module]:\n    architectures = getattr(model_config, \"architectures\", [])\n    try:\n        model_cls, _ = ModelRegistry.resolve_model_cls(architectures)\n    except Exception as resolution_error:\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            )\n        except Exception as quantization_error:\n            raise ComponentCheckpointUnsupportedError(\n                f\"Cannot parse checkpoint quantization for {component_name!r}: \"\n                f\"{quantization_error}\"\n            ) from quantization_error\n        if explicit_quantization is not None and quant_config is None:\n            raise ComponentCheckpointUnsupportedError(\n                f\"Online quantization for {component_name!r} requires an in-tree \"\n                f\"native encoder; unsupported architectures: {architectures}\"\n            ) from resolution_error\n        if quant_config is None:\n            raise\n        raise ComponentCheckpointUnsupportedError(\n            f\"A quantized {component_name!r} checkpoint requires an in-tree \"\n            f\"native encoder; unsupported architectures: {architectures}\"\n        ) from resolution_error\n\n    _configure_encoder_quantization(\n        model_config,\n        model_cls,","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py#L323-L359","documentation":"ComponentCheckpointUnsupportedError raised in _resolve_and_configure_encoder_quantization when _get_encoder_quant_config throws any exception while parsing the checkpoint's quantization. Unlike 1342 this is the outer resolution path (after architecture resolution failed to yield a native class), wrapping arbitrary exceptions with the component name and original error.","triggerScenarios":"load_customized on a component whose weights/config trigger an unexpected exception in GGUF metadata reading, quant config parsing, or transformers quantization_config interpretation — e.g. malformed GGUF header, missing quantization_config keys, unsupported quant_method string.","commonSituations":"Corrupted or partially downloaded .gguf/.safetensors files; checkpoints from incompatible tool versions; config.json quantization_config entries with missing required fields.","solutions":["Inspect the chained {quantization_error} message for the root cause and fix that specific issue","Verify checkpoint integrity (re-download; check file sizes/hash) especially for GGUF files","Fix or complete the quantization_config section of the component's config.json","Convert the checkpoint to a supported format or load unquantized weights"],"exampleFix":"// before\n{\"quantization_config\": {\"quant_method\": \"fp8\"}}  // missing required sub-fields\n\n// after\n{\"quantization_config\": {\"quant_method\": \"fp8\", \"fmt\": \"e4m3\", \"weight_block_size\": [128, 128]}}","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\np = Path(weights_path)\nif p.suffix == \".gguf\" and not p.stat().st_size > 1024:\n    raise SystemExit(\"GGUF file looks truncated\")","typeGuard":null,"tryCatchPattern":"try:\n    load_customized(...)\nexcept ComponentCheckpointUnsupportedError as e:\n    if \"Cannot parse checkpoint quantization\" in str(e) and e.__cause__:\n        logger.error(\"root cause: %r\", e.__cause__)\n    raise\n","preventionTips":["Validate/verify downloaded checkpoint files before loading","Sanity-check quantization_config fields for required keys"],"tags":["quantization","checkpoint-parsing","gguf","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"}