{"record":{"id":"44ec772d84c9ddf2","repo":"sgl-project/sglang","slug":"minimax-h3-adaln-t-table-must-have-shape-n-d-wi","errorCode":null,"errorMessage":"MiniMax-H3 adaln_t_table must have shape [N, D] with N >= 2, got {shape} in {path}","messagePattern":"MiniMax-H3 adaln_t_table must have shape \\[N, D\\] with N >= 2, got (.+?) in (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/minimax_h3_weights.py","lineNumber":38,"sourceCode":"\ndef comfy_quant_key_filter(name: str) -> bool:\n    return not name.endswith(\".comfy_quant\")\n\n\ndef inspect_minimax_h3_safetensors(\n    safetensors_list: list[str],\n) -> tuple[tuple[int, int] | None, dict[str, dict[str, Any]]]:\n    \"\"\"Read H3 architecture metadata and Comfy per-layer format markers.\"\"\"\n    adaln_curve_shape = None\n    layer_markers = inspect_comfy_quant_markers(safetensors_list)\n\n    for path in safetensors_list:\n        with safe_open(path, framework=\"pt\", device=\"cpu\") as checkpoint:\n            keys = checkpoint.keys()\n            if \"adaln_t_table\" in keys:\n                shape = tuple(checkpoint.get_slice(\"adaln_t_table\").get_shape())\n                if len(shape) != 2 or shape[0] < 2:\n                    raise ValueError(\n                        \"MiniMax-H3 adaln_t_table must have shape [N, D] with \"\n                        f\"N >= 2, got {shape} in {path}\"\n                    )\n                if adaln_curve_shape is not None and adaln_curve_shape != shape:\n                    raise ValueError(\n                        \"MiniMax-H3 checkpoint shards disagree on adaln_t_table \"\n                        f\"shape: {adaln_curve_shape} vs {shape}\"\n                    )\n                adaln_curve_shape = shape\n\n    return adaln_curve_shape, layer_markers\n\n\ndef resolve_minimax_h3_checkpoint_quantization(\n    layer_markers: dict[str, dict[str, Any]],\n    safetensors_list: list[str] | None = None,\n    param_names_mapping: dict | None = None,\n    reverse_param_names_mapping: dict | None = None,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/minimax_h3_weights.py#L20-L56","documentation":"inspect_minimax_h3_safetensors uses the 'adaln_t_table' tensor both to detect MiniMax-H3 checkpoints and to derive the adaptive-layer-norm curve. It requires the table to be a 2D tensor whose first dimension (number of curve points N) is at least 2; otherwise the shape is unusable for curve interpolation and the file is rejected.","triggerScenarios":"Calling load_customized (or inspect_minimax_h3_safetensors) on safetensors shards where 'adaln_t_table' exists but has rank != 2 or shape[0] < 2 — e.g. a 1D table or a single-row [1, D] table.","commonSituations":"Corrupted or truncated MiniMax-H3 safetensors exports; a checkpoint from a different model family that happens to contain an 'adaln_t_table' key; partial shards where only a fragment of the table was saved.","solutions":["Re-download or re-export the MiniMax-H3 checkpoint so adaln_t_table is a complete [N, D] table with N >= 2","Verify the tensor with safetensors' get_slice before loading: shape must be 2D with shape[0] >= 2","If the key is spurious (non-MiniMax checkpoint), remove it or point the loader at the correct checkpoint"],"exampleFix":"# before: adaln_t_table shape (1, 1152) -> raise\n# after: shape (256, 1152) -> valid curve table\nfrom safetensors import safe_open\nwith safe_open(path, framework='pt') as f:\n    assert tuple(f.get_slice('adaln_t_table').get_shape())[0] >= 2","handlingStrategy":"validation","validationCode":"from safetensors import safe_open\nwith safe_open(path, framework='pt') as f:\n    if 'adaln_t_table' in f.keys():\n        s = tuple(f.get_slice('adaln_t_table').get_shape())\n        assert len(s) == 2 and s[0] >= 2, f'bad adaln_t_table {s} in {path}'","typeGuard":"def is_valid_adaln_table(shape: tuple) -> bool:\n    return len(shape) == 2 and shape[0] >= 2","tryCatchPattern":null,"preventionTips":["Validate checkpoint headers before loading","Download checkpoints from official MiniMax releases with checksums","Fail fast on unknown adaln_t_table shapes in CI smoke tests"],"tags":["minimax-h3","safetensors","checkpoint","tensor-shape","validation"],"backgroundTag":"checkpoint-metadata-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}