{"record":{"id":"5ddb57c8b253f365","repo":"sgl-project/sglang","slug":"unexpected-minimax-h3-qwen3-vl-checkpoint-weight","errorCode":null,"errorMessage":"Unexpected MiniMax H3 Qwen3-VL checkpoint weight: {name} (mapped to {param_name})","messagePattern":"Unexpected MiniMax H3 Qwen3-VL checkpoint weight: (.+?) \\(mapped to (.+?)\\)","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py","lineNumber":407,"sourceCode":"                f\"unexpected hidden shape {list(hidden.shape)}, \"\n                f\"expected {expected_shape}\"\n            )\n        return hidden\n\n    def load_weights(\n        self,\n        weights: Iterable[tuple[str, torch.Tensor]],\n    ) -> set[str]:\n        params = dict(self.named_parameters(remove_duplicate=False))\n        loaded: set[str] = set()\n        for name, loaded_weight in weights:\n            name = _map_checkpoint_name(name)\n            if not self.should_materialize_checkpoint_weight(name):\n                continue\n            param_name = name\n            param = params.get(param_name)\n            if param is None:\n                raise KeyError(\n                    \"Unexpected MiniMax H3 Qwen3-VL checkpoint weight: \"\n                    f\"{name} (mapped to {param_name})\"\n                )\n            weight_loader = getattr(param, \"weight_loader\", default_weight_loader)\n            try:\n                can_keep_checkpoint_tensor = bool(\n                    getattr(self, \"_keep_checkpoint_mapping\", False)\n                    and weight_loader is default_weight_loader\n                    and param.device.type == \"cpu\"\n                    and loaded_weight.device.type == \"cpu\"\n                    and loaded_weight.dtype == param.dtype\n                    and tuple(loaded_weight.shape) == tuple(param.shape)\n                )\n                if can_keep_checkpoint_tensor:\n                    param.data = loaded_weight\n                else:\n                    weight_loader(param, loaded_weight.to(param.dtype))\n            except Exception as exc:","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py#L389-L425","documentation":"load_weights found a checkpoint tensor whose mapped name doesn't correspond to any parameter of the model. This guards against silently dropping weights — an unrecognized tensor almost always means the checkpoint doesn't match the model definition.","triggerScenarios":"load_weights iterating checkpoint weights where _map_checkpoint_name(name) yields a key absent from self.state_dict (via params lookup).","commonSituations":"Loading a full MiniMax H3 checkpoint that includes non-encoder modules (LM head, vision tower extras) not owned by this encoder; version skew between checkpoint export format and the loader's name mapping.","solutions":["Inspect the reported name and extend _map_checkpoint_name or filter such keys before calling load_weights","Verify you're loading the encoder-specific checkpoint shard matching this model class","Check for sglang version updates that added new name mappings"],"exampleFix":"# before\nmodel.load_weights(iter(weights))\n# after\nowned = set(dict(model.named_parameters()))\nweights = [(n, t) for n, t in weights if _map_checkpoint_name(n) in owned]\nmodel.load_weights(iter(weights))","handlingStrategy":"validation","validationCode":"owned = {n for n, _ in model.named_parameters()}\nfrom sglang.multimodal_gen.runtime.models.encoders.minimax_h3_qwen3vl import _map_checkpoint_name\nfiltered = [(n, t) for n, t in weights if _map_checkpoint_name(n) in owned]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter checkpoint shards to encoder-owned keys before load_weights","Keep name-mapping tests in CI for new checkpoint formats"],"tags":["minimax-h3","load-weights","unknown-key","checkpoint"],"backgroundTag":"checkpoint-key-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}