{"record":{"id":"ea2f5ea10807f25d","repo":"sgl-project/sglang","slug":"h3-conditioning-projection-expects-encoder-width","errorCode":null,"errorMessage":"H3 conditioning projection expects encoder width {input_dim}, but the selected text encoder has width {int(arch.hidden_size)}","messagePattern":"H3 conditioning projection expects encoder width (.+?), but the selected text encoder has width (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py","lineNumber":240,"sourceCode":"        source = component_paths.get(\"conditioning_projection\")\n        if source is None:\n            if (\n                int(arch.hidden_size) != MINIMAX_H3_QWEN3VL_HIDDEN_DIM\n                or int(arch.checkpoint_num_hidden_layers)\n                < MINIMAX_H3_QWEN3VL_SELECTED_LM_LAYER\n            ):\n                raise ValueError(\n                    \"MiniMax H3 Qwen3-VL encoders smaller than 32B require \"\n                    \"--component-paths.conditioning_projection\"\n                )\n            return\n\n        projection_path = materialize_weight(resolve_weight(source))\n        tap, input_dim, output_dim = MiniMaxH3ConditioningProjection.inspect(\n            projection_path\n        )\n        if input_dim != int(arch.hidden_size):\n            raise ValueError(\n                f\"H3 conditioning projection expects encoder width {input_dim}, \"\n                f\"but the selected text encoder has width {int(arch.hidden_size)}\"\n            )\n        if output_dim != MINIMAX_H3_QWEN3VL_HIDDEN_DIM:\n            raise ValueError(\n                f\"H3 conditioning projection must output width \"\n                f\"{MINIMAX_H3_QWEN3VL_HIDDEN_DIM}, got {output_dim}\"\n            )\n        if tap <= 0 or tap > int(arch.checkpoint_num_hidden_layers):\n            raise ValueError(\n                f\"H3 conditioning projection tap {tap} is outside the selected \"\n                f\"encoder's {int(arch.checkpoint_num_hidden_layers)} layers\"\n            )\n        arch.conditioning_projection_path = projection_path\n        arch.num_hidden_layers = tap\n        arch.text_config.num_hidden_layers = tap\n\n    def should_materialize_checkpoint_weight(self, name: str) -> bool:","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py#L222-L258","documentation":"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.","triggerScenarios":"configure_component_paths with a projection whose inspect() input_dim differs from int(arch.hidden_size).","commonSituations":"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.","solutions":["Use the projection checkpoint exported from the same encoder you're serving","Switch the text encoder to the one matching the projection's input width","Re-export the projection from the correct source model"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"_, in_dim, _ = MiniMaxH3ConditioningProjection.inspect(materialize_weight(resolve_weight(path)))\nassert in_dim == int(arch.hidden_size), f\"projection input {in_dim} != encoder {arch.hidden_size}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair projection and encoder from the same release bundle","Add a launch-time assert comparing widths"],"tags":["minimax-h3","conditioning-projection","width-mismatch","config-validation"],"backgroundTag":"model-dimension-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}