{"record":{"id":"0a405402e4085005","repo":"sgl-project/sglang","slug":"minimax-h3-checkpoint-shards-disagree-on-adaln-t-t","errorCode":null,"errorMessage":"MiniMax-H3 checkpoint shards disagree on adaln_t_table shape: {adaln_curve_shape} vs {shape}","messagePattern":"MiniMax-H3 checkpoint shards disagree on adaln_t_table shape: (.+?) vs (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/minimax_h3_weights.py","lineNumber":43,"sourceCode":"def 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,\n) -> QuantizationConfig | None:\n    formats = {str(marker.get(\"format\")) for marker in layer_markers.values()}\n    if \"nvfp4\" in formats:\n        unsupported = formats - {\"nvfp4\", \"int8_tensorwise\", \"float8_e4m3fn\"}\n        if unsupported:","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/minimax_h3_weights.py#L25-L61","documentation":"All shards of a MiniMax-H3 checkpoint must agree on the shape of adaln_t_table, since the curve table is a single model-level asset. The inspector records the first shape it sees and raises if a later shard reports a different one.","triggerScenarios":"Loading multi-shard MiniMax-H3 safetensors where two shards contain adaln_t_table tensors with different shapes, e.g. (64, 1152) in one shard and (256, 1152) in another.","commonSituations":"Concatenating checkpoints from different MiniMax-H3 versions or resolutions; a duplicated table saved into every shard during a buggy export where some shards carry a stale copy; mixing base and fine-tuned shards.","solutions":["Ensure only one shard carries adaln_t_table, or that all copies are byte-identical in shape","Re-export the whole checkpoint in one consistent run","If merging shards manually, delete duplicate adaln_t_table entries from all but one shard"],"exampleFix":"# before: shard A has adaln_t_table (64, 1152), shard B has (256, 1152) -> raise\n# after: keep a single consistent copy across all shards","handlingStrategy":"validation","validationCode":"shapes = set()\nfor path in safetensors_list:\n    with safe_open(path, framework='pt') as f:\n        if 'adaln_t_table' in f.keys():\n            shapes.add(tuple(f.get_slice('adaln_t_table').get_shape()))\nassert len(shapes) <= 1, f'shards disagree: {shapes}'","typeGuard":"def shards_agree(safetensors_list) -> bool:\n    shapes = set()\n    for path in safetensors_list:\n        with safe_open(path, framework='pt') as f:\n            if 'adaln_t_table' in f.keys():\n                shapes.add(tuple(f.get_slice('adaln_t_table').get_shape()))\n    return len(shapes) <= 1","tryCatchPattern":null,"preventionTips":["Store adaln_t_table in exactly one shard during export","Never mix shards from different checkpoint versions","Checksum each shard against the release manifest"],"tags":["minimax-h3","safetensors","multi-shard","shape-mismatch"],"backgroundTag":"inconsistent-checkpoint-shards","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}