sgl-project/sglang · error · ComponentCheckpointUnsupportedError

Cannot parse checkpoint quantization metadata for {component

Error message

Cannot parse checkpoint quantization metadata for {component_name!r}: {error}

What it means

ensure_plain_state_dict_checkpoint validates that a component loaded via a plain state-dict materializer carries no quantization metadata. If parsing the quant spec itself raises TypeError/ValueError (malformed metadata), it is wrapped as ComponentCheckpointUnsupportedError with this message.

Source

Thrown at python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py:518

            return loader

        # For unknown component types, use a generic loader
        logger.warning(
            "No specific loader found for component type: %s. Using generic loader.",
            component_name,
        )
        return GenericComponentLoader(transformers_or_diffusers, component_architecture)


class PlainStateDictComponentLoader(ComponentLoader):
    """Base for native loaders whose current materializer expects plain weights."""

    @staticmethod
    def ensure_plain_state_dict_checkpoint(config: object, component_name: str) -> None:
        try:
            quant_spec = resolve_checkpoint_quant_spec(config)
        except (TypeError, ValueError) as error:
            raise ComponentCheckpointUnsupportedError(
                f"Cannot parse checkpoint quantization metadata for "
                f"{component_name!r}: {error}"
            ) from error
        if quant_spec is None:
            return

        method = quant_spec.declared_method or "unspecified"
        raise ComponentCheckpointUnsupportedError(
            f"{component_name!r} checkpoint declares quantization metadata in "
            f"{quant_spec.source} (quant_method={method!r}), which its current "
            "plain state-dict materializer cannot restore."
        )

    def load_component_config(
        self, component_model_path: str, component_name: str
    ) -> dict[str, Any]:
        config = get_diffusers_component_config(component_path=component_model_path)
        self.ensure_plain_state_dict_checkpoint(config, component_name)

View on GitHub (pinned to 0132848349)

Solutions

  1. Inspect and repair the component config's quantization-related fields so resolve_checkpoint_quant_spec can parse them
  2. Re-download the component checkpoint
  3. If quantization metadata is unwanted, delete the malformed quantization_config key entirely so quant_spec is None
Defensive patterns

Strategy: try-catch

Validate before calling

try:
    resolve_checkpoint_quant_spec(config)
except (TypeError, ValueError):
    raise SystemExit("component has malformed quantization metadata; re-download or repair config.json")

Try / catch

except ComponentCheckpointUnsupportedError as e:
    if "Cannot parse checkpoint quantization metadata" in str(e):
        config.pop('quantization_config', None)  # if truly unquantized

Prevention

When it happens

Trigger: Calling load_component_config or load_customized for a component whose config's quantization metadata is structurally invalid (wrong type or values), so resolve_checkpoint_quant_spec throws.

Common situations: Corrupted or hand-edited quantization_config in the component's config.json; checkpoints produced by non-standard quantization tooling; partial downloads.

Related errors


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