{"record":{"id":"8eda834bc0602107","repo":"sgl-project/sglang","slug":"failed-to-load-minimax-h3-qwen3-vl-weight-name-r","errorCode":null,"errorMessage":"Failed to load MiniMax H3 Qwen3-VL weight {name!r}: checkpoint={tuple(loaded_weight.shape)}, parameter={tuple(param.shape)}","messagePattern":"Failed to load MiniMax H3 Qwen3-VL weight (.+?): checkpoint=(.+?), parameter=(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py","lineNumber":426,"sourceCode":"                    \"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:\n                raise RuntimeError(\n                    \"Failed to load MiniMax H3 Qwen3-VL weight \"\n                    f\"{name!r}: checkpoint={tuple(loaded_weight.shape)}, \"\n                    f\"parameter={tuple(param.shape)}\"\n                ) from exc\n            loaded.add(param_name)\n        return loaded\n\n\nEntryClass = MiniMaxH3Qwen3VLEncoder\n\n__all__ = [\"MiniMaxH3Qwen3VLEncoder\"]\n","sourceCodeStart":408,"sourceCodeEnd":438,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/encoders/minimax_h3_qwen3vl.py#L408-L438","documentation":"A wrapper around per-weight loading failures: either keeping the checkpoint tensor directly or invoking the weight_loader raised. The message records both checkpoint and parameter shapes to disambiguate sharding/shape problems from dtype/device issues; the original exception is chained via `from exc`.","triggerScenarios":"load_weights where param.data assignment or weight_loader(param, loaded_weight.to(param.dtype)) throws — shape mismatch between loaded_weight and param, unsupported dtype conversions, or column/row-parallel weight loaders rejecting the shard.","commonSituations":"Tensor-parallel sharding where the checkpoint shard count doesn't match the TP degree; quantized params whose weight_loader can't accept the raw tensor; corrupted safetensors slices.","solutions":["Compare the reported checkpoint vs parameter shapes; if they differ by a TP factor, re-shard the checkpoint or fix --tp-size","Inspect the chained exception (raise ... from exc) for the root cause before this wrapper","Re-download/verify the checkpoint files (checksums) if shapes look arbitrary"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for n, t in weights:\n    p = dict(model.named_parameters()).get(_map_checkpoint_name(n))\n    if p is not None and tuple(t.shape) != tuple(p.shape):\n        logger.warning(\"shape mismatch %s: ckpt %s vs param %s\", n, tuple(t.shape), tuple(p.shape))","typeGuard":null,"tryCatchPattern":"try:\n    model.load_weights(weights)\nexcept RuntimeError as e:\n    cause = e.__cause__\n    logger.error(\"weight load failed: %s (root: %s)\", e, cause)\n    raise","preventionTips":["Match --tp-size to checkpoint shard layout","Inspect chained root-cause exceptions, not just the wrapper message","Verify checkpoint checksums after download"],"tags":["minimax-h3","load-weights","weight-loading","tensor-parallel"],"backgroundTag":"weight-loading-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}