{"record":{"id":"af8cde52840085b1","repo":"sgl-project/sglang","slug":"component-name-r-already-declares-checkpoint-qua","errorCode":null,"errorMessage":"{component_name!r} already declares checkpoint quantization; drop the explicit online quantization override","messagePattern":"(.+?) already declares checkpoint quantization; drop the explicit online quantization override","errorType":"validation","errorClass":"ComponentCheckpointUnsupportedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py","lineNumber":289,"sourceCode":"    _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        )\n\n        model_config.quant_config = get_quantization_config(explicit_quantization)(\n            ignored_layers=ignored_layers\n        )\n        quant_config = model_config.quant_config\n    if quant_config is None:","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py#L271-L307","documentation":"ComponentCheckpointUnsupportedError raised when an explicit online quantization override is supplied AND the checkpoint already carries a serialized quantization config. Applying online quantization on top of an already-quantized checkpoint is contradictory, so the loader asks you to drop the override.","triggerScenarios":"Calling load_customized with explicit_quantization=\"fp8\" (etc.) for a component whose config.json/weights already declare quantization, so _get_encoder_quant_config returned a non-None quant_config.","commonSituations":"Server started with a global --quantization fp8 flag while loading an already-FP8-serialized CLIP encoder; mixing PD/D deployment flags with pre-quantized component checkpoints.","solutions":["Remove the explicit online quantization argument/flag for this component — the checkpoint's serialized config wins","If you intended online quantization, switch to an unquantized (BF16/FP16) checkpoint of the encoder","Exclude self-quantized components from global quantization flag propagation"],"exampleFix":"# before\nload_customized(..., explicit_quantization=\"fp8\")  # checkpoint is already fp8\n\n# after\nload_customized(..., explicit_quantization=None)","handlingStrategy":"validation","validationCode":"if explicit_quantization is not None and checkpoint_declares_quant(model_path):\n    explicit_quantization = None  # checkpoint wins","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't combine --quantization flags with pre-quantized checkpoints","Test loader config against both serialized and unquantized checkpoints"],"tags":["quantization","online-quantization","conflicting-config","text-encoder"],"backgroundTag":"conflicting-quantization-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}