sgl-project/sglang · critical · ValueError

H3 conditioning projection contains unsupported tensors: {so

Error message

H3 conditioning projection contains unsupported tensors: {sorted(tensors)}

What it means

The conditioning projection constructor found leftover tensors in the checkpoint state dict that it could not map to any known weight/bias/MLP pattern. After consuming recognized W, MLP, and normalization tensors, any remaining keys trigger this error listing the offenders.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py:147

        for layer_index in layer_indices:
            weight_name = f"mlp.{layer_index}.weight"
            bias_name = f"mlp.{layer_index}.bias"
            weight = tensors.pop(weight_name)
            bias = tensors.pop(bias_name, None)
            if weight.ndim != 2 or int(weight.shape[1]) != layer_input_dim:
                raise ValueError(
                    f"H3 conditioning projection {weight_name} cannot follow "
                    f"width {layer_input_dim}: got {tuple(weight.shape)}"
                )
            if bias is not None and tuple(bias.shape) != (int(weight.shape[0]),):
                raise ValueError(
                    f"H3 conditioning projection {bias_name} has shape "
                    f"{tuple(bias.shape)}, expected ({int(weight.shape[0])},)"
                )
            layers.append(_FrozenLinear(weight, bias))
            layer_input_dim = int(weight.shape[0])
        if tensors:
            raise ValueError(
                "H3 conditioning projection contains unsupported tensors: "
                f"{sorted(tensors)}"
            )
        if self.weight is None and not layers:
            raise ValueError("H3 conditioning projection has neither W nor an MLP")
        if layers and layer_input_dim != self.output_dim:
            raise ValueError(
                f"H3 conditioning projection MLP outputs width {layer_input_dim}, "
                f"expected {self.output_dim}"
            )
        if self.weight is not None and tuple(self.weight.shape) != (
            self.input_dim,
            self.output_dim,
        ):
            raise ValueError(
                "H3 conditioning projection W has shape "
                f"{tuple(self.weight.shape)}, expected "
                f"({self.input_dim}, {self.output_dim})"

View on GitHub (pinned to 0132848349)

Solutions

  1. Inspect the tensor names listed in the error and strip or rename the unsupported ones before construction
  2. Re-export only the projection submodule keys using the naming pattern expected by the loader
  3. Check for a version mismatch between the checkpoint exporter and this sglang version

Example fix

# before
proj = MiniMaxH3ConditioningProjection(sd, ...)
# after
supported = {k: v for k, v in sd.items() if not k.startswith("unexpected_prefix.")}
proj = MiniMaxH3ConditioningProjection(supported, ...)
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = re.compile(r"^(W$|mlp\..*weight$|mlp\..*bias$|mean_in|std_in|mean_out|std_out|sink_out$)")
bad = [k for k in sd if not ALLOWED.match(k)]
assert not bad, f"unsupported tensors: {bad}"

Prevention

When it happens

Trigger: MiniMaxH3ConditioningProjection constructed with a state dict containing keys that don't match any recognized pattern (extra norms, unexpected prefixes, optimizer state, or renamed keys).

Common situations: Checkpoint format changed between releases, user exported a full model instead of just the projection module, or extra keys like 'norm.weight' variants with unknown prefixes were included.

Related errors


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