sgl-project/sglang · error · ValueError

Unsupported data_type: {data_type}, currently only support

Error message

Unsupported data_type: {data_type}, currently only support  {self.SUPPORTED_DTYPES}

What it means

AutoRoundConfig validates the data_type used for activations/weights against SUPPORTED_DTYPES (e.g. 'int'/'float' variants). An unrecognized or unsupported data_type string raises at config construction/load time.

Source

Thrown at python/sglang/srt/layers/quantization/auto_round.py:79

        extra_config: Optional[dict[str, Any]] = None,
        data_type: str = "int",
        backend: str = "auto",
        lm_head_quantized: bool = False,
        desc_act: bool = False,
        dynamic: Optional[dict[str, dict[str, Union[int, bool]]]] = None,
        checkpoint_format: str = "",
        true_sequential: bool = False,
        static_groups: bool = False,
        gptq_defaulted_config_keys: Optional[tuple[str, ...]] = None,
    ) -> None:
        super().__init__()
        if weight_bits not in self.SUPPORTED_BITS:
            raise ValueError(
                f"Unsupported weight_bits: {weight_bits}, "
                f"currently only support  {self.SUPPORTED_BITS}"
            )
        if data_type not in self.SUPPORTED_DTYPES:
            raise ValueError(
                f"Unsupported data_type: {data_type},"
                f" currently only support  {self.SUPPORTED_DTYPES}"
            )
        if packing_format not in self.SUPPORTED_FORMATS:
            raise ValueError(
                f"Unsupported packing_format: {packing_format}, "
                f"currently only support  {self.SUPPORTED_FORMATS}"
            )
        if backend not in self.SUPPORTED_BACKENDS:
            raise ValueError(
                f"Unsupported backend: {backend},  "
                f"currently only support  {self.SUPPORTED_BACKENDS}"
            )

        self.weight_bits = weight_bits
        self.group_size = group_size
        self.sym = sym
        self.packing_format = packing_format

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-export the model with a supported data_type (check AutoRoundConfig.SUPPORTED_DTYPES in auto_round.py)
  2. Upgrade SGLang if a newer version added the data type
  3. Use the checkpoint's native quant method (awq/gptq) instead of auto_round if the dtype is only valid there

Example fix

// before
"quantization_config": {"data_type": "bf16", ...}
// after
"quantization_config": {"data_type": "int", ...}
Defensive patterns

Strategy: validation

Validate before calling

dt = quant_cfg.get("data_type")
assert dt is None or dt in AutoRoundConfig.SUPPORTED_DTYPES, f"bad data_type {dt}"

Type guard

def is_supported_dtype(dt: str) -> bool:
    return dt in AutoRoundConfig.SUPPORTED_DTYPES

Prevention

When it happens

Trigger: Loading an AutoRound checkpoint whose quantization_config data_type is not in SUPPORTED_DTYPES, or constructing AutoRoundConfig(data_type='bf16')-style values the loader cannot map.

Common situations: Checkpoints exported by newer AutoRound versions introducing new data types, or manually editing quantization_config.

Related errors


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