sgl-project/sglang · critical · ValueError

H3 conditioning projection expects encoder width {input_dim}

Error message

H3 conditioning projection expects encoder width {input_dim}, but the selected text encoder has width {int(arch.hidden_size)}

What it means

The supplied conditioning projection's input width doesn't match the selected text encoder's hidden size. The projection consumes encoder hidden states directly, so input_dim must equal arch.hidden_size.

Source

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

        source = component_paths.get("conditioning_projection")
        if source is None:
            if (
                int(arch.hidden_size) != MINIMAX_H3_QWEN3VL_HIDDEN_DIM
                or int(arch.checkpoint_num_hidden_layers)
                < MINIMAX_H3_QWEN3VL_SELECTED_LM_LAYER
            ):
                raise ValueError(
                    "MiniMax H3 Qwen3-VL encoders smaller than 32B require "
                    "--component-paths.conditioning_projection"
                )
            return

        projection_path = materialize_weight(resolve_weight(source))
        tap, input_dim, output_dim = MiniMaxH3ConditioningProjection.inspect(
            projection_path
        )
        if input_dim != int(arch.hidden_size):
            raise ValueError(
                f"H3 conditioning projection expects encoder width {input_dim}, "
                f"but the selected text encoder has width {int(arch.hidden_size)}"
            )
        if output_dim != MINIMAX_H3_QWEN3VL_HIDDEN_DIM:
            raise ValueError(
                f"H3 conditioning projection must output width "
                f"{MINIMAX_H3_QWEN3VL_HIDDEN_DIM}, got {output_dim}"
            )
        if tap <= 0 or tap > int(arch.checkpoint_num_hidden_layers):
            raise ValueError(
                f"H3 conditioning projection tap {tap} is outside the selected "
                f"encoder's {int(arch.checkpoint_num_hidden_layers)} layers"
            )
        arch.conditioning_projection_path = projection_path
        arch.num_hidden_layers = tap
        arch.text_config.num_hidden_layers = tap

    def should_materialize_checkpoint_weight(self, name: str) -> bool:

View on GitHub (pinned to 0132848349)

Solutions

  1. Use the projection checkpoint exported from the same encoder you're serving
  2. Switch the text encoder to the one matching the projection's input width
  3. Re-export the projection from the correct source model
Defensive patterns

Strategy: validation

Validate before calling

_, in_dim, _ = MiniMaxH3ConditioningProjection.inspect(materialize_weight(resolve_weight(path)))
assert in_dim == int(arch.hidden_size), f"projection input {in_dim} != encoder {arch.hidden_size}"

Prevention

When it happens

Trigger: configure_component_paths with a projection whose inspect() input_dim differs from int(arch.hidden_size).

Common situations: Using a projection exported for a different encoder width (e.g. 2048-projection with a 4096 encoder), or selecting the wrong Qwen3-VL text backbone.

Related errors


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