sgl-project/sglang · error · ComponentCheckpointUnsupportedError

Online quantization {explicit_quantization!r} is not support

Error message

Online quantization {explicit_quantization!r} is not supported for native encoders; choose one of {sorted(_ONLINE_ENCODER_QUANTIZATIONS)}

What it means

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.

Source

Thrown at python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py:294

        quant_config = _get_encoder_quant_config(
            component_config,
            component_model_path,
            component_weights_path,
            model_cls,
        )
    except (KeyError, NotImplementedError, TypeError, ValueError) as error:
        raise ComponentCheckpointUnsupportedError(
            f"Cannot configure checkpoint quantization for {component_name!r}: {error}"
        ) from error
    model_config.quant_config = quant_config
    if explicit_quantization is not None:
        if quant_config is not None:
            raise ComponentCheckpointUnsupportedError(
                f"{component_name!r} already declares checkpoint quantization; "
                "drop the explicit online quantization override"
            )
        if explicit_quantization not in _ONLINE_ENCODER_QUANTIZATIONS:
            raise ComponentCheckpointUnsupportedError(
                f"Online quantization {explicit_quantization!r} is not supported "
                f"for native encoders; choose one of "
                f"{sorted(_ONLINE_ENCODER_QUANTIZATIONS)}"
            )
        from sglang.multimodal_gen.runtime.layers.quantization import (
            get_quantization_config,
        )

        model_config.quant_config = get_quantization_config(explicit_quantization)(
            ignored_layers=ignored_layers
        )
        quant_config = model_config.quant_config
    if quant_config is None:
        return
    if not issubclass(model_cls, EncoderTensorParallelMixin):
        raise ComponentCheckpointUnsupportedError(
            f"A quantized {component_name!r} checkpoint requires an in-tree "
            "native encoder; "

View on GitHub (pinned to 0132848349)

Solutions

  1. Switch to one of the methods listed in the error message (sorted(_ONLINE_ENCODER_QUANTIZATIONS))
  2. Check the whitelist in text_encoder_loader.py for your version and update the config accordingly
  3. Upgrade sglang if the method you need was added to _ONLINE_ENCODER_QUANTIZATIONS later
  4. Use a pre-quantized checkpoint in the desired format instead of online quantization

Example fix

# before
load_customized(..., explicit_quantization="awq")

# after
load_customized(..., explicit_quantization="fp8")  # one of the supported methods
Defensive patterns

Strategy: validation

Validate before calling

from sglang.multimodal_gen.runtime.loader.component_loaders.text_encoder_loader import _ONLINE_ENCODER_QUANTIZATIONS
assert explicit_quantization in _ONLINE_ENCODER_QUANTIZATIONS, (
    f"pick from {sorted(_ONLINE_ENCODER_QUANTIZATIONS)}")

Type guard

def is_supported_online_quant(q: str) -> bool:
    return q in _ONLINE_ENCODER_QUANTIZATIONS

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/1b67274db479c62e. Report an issue: GitHub.