{"record":{"id":"1b67274db479c62e","repo":"sgl-project/sglang","slug":"online-quantization-explicit-quantization-r-is-n","errorCode":null,"errorMessage":"Online quantization {explicit_quantization!r} is not supported for native encoders; choose one of {sorted(_ONLINE_ENCODER_QUANTIZATIONS)}","messagePattern":"Online quantization (.+?) is not supported for native encoders; choose one of (.+?)","errorType":"validation","errorClass":"ComponentCheckpointUnsupportedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py","lineNumber":294,"sourceCode":"        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:\n        return\n    if not issubclass(model_cls, EncoderTensorParallelMixin):\n        raise ComponentCheckpointUnsupportedError(\n            f\"A quantized {component_name!r} checkpoint requires an in-tree \"\n            \"native encoder; \"","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py#L276-L312","documentation":"ComponentCheckpointUnsupportedError raised when explicit online quantization is requested with a method not in _ONLINE_ENCODER_QUANTIZATIONS. The message lists the allowed set; the loader then would proceed via get_quantization_config only for whitelisted methods.","triggerScenarios":"Passing explicit_quantization such as \"awq\", \"gptq\", or \"bitsandbytes\" (or a typo like \"int8\" when unsupported) to load_customized for a native encoder; only entries in _ONLINE_ENCODER_QUANTIZATIONS are accepted.","commonSituations":"Copy-pasting quantization method names that work for the main LLM backbone but are not implemented for encoders; version skew where a method was added/removed from the whitelist; misspelled quant names in YAML/CLI config.","solutions":["Switch to one of the methods listed in the error message (sorted(_ONLINE_ENCODER_QUANTIZATIONS))","Check the whitelist in text_encoder_loader.py for your version and update the config accordingly","Upgrade sglang if the method you need was added to _ONLINE_ENCODER_QUANTIZATIONS later","Use a pre-quantized checkpoint in the desired format instead of online quantization"],"exampleFix":"# before\nload_customized(..., explicit_quantization=\"awq\")\n\n# after\nload_customized(..., explicit_quantization=\"fp8\")  # one of the supported methods","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.loader.component_loaders.text_encoder_loader import _ONLINE_ENCODER_QUANTIZATIONS\nassert explicit_quantization in _ONLINE_ENCODER_QUANTIZATIONS, (\n    f\"pick from {sorted(_ONLINE_ENCODER_QUANTIZATIONS)}\")","typeGuard":"def is_supported_online_quant(q: str) -> bool:\n    return q in _ONLINE_ENCODER_QUANTIZATIONS","tryCatchPattern":null,"preventionTips":["Source the whitelist from the installed version rather than hardcoding method names","Log available methods on startup config validation"],"tags":["quantization","online-quantization","unsupported-format","text-encoder"],"backgroundTag":"unsupported-quantization-method","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}