{"record":{"id":"09c06ecddc33376a","repo":"sgl-project/sglang","slug":"incomplete-diffusers-h3-fused-parameters-incompl","errorCode":null,"errorMessage":"Incomplete Diffusers H3 fused parameters: {incomplete}","messagePattern":"Incomplete Diffusers H3 fused parameters: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py","lineNumber":125,"sourceCode":"        if merge_index is None:\n            yield target_name, tensor\n            continue\n\n        assert merge_count is not None\n        pending[target_name][merge_index] = tensor\n        if len(pending[target_name]) != merge_count:\n            continue\n\n        merge_dim = 1 if target_name.endswith((\".qweight\", \".qzeros\", \".scales\")) else 0\n        yield target_name, torch.cat(\n            [pending[target_name][index] for index in range(merge_count)],\n            dim=merge_dim,\n        )\n        del pending[target_name]\n\n    if pending:\n        incomplete = \", \".join(sorted(pending))\n        raise ValueError(f\"Incomplete Diffusers H3 fused parameters: {incomplete}\")\n\n\n_BF16_DTYPE = torch.bfloat16\n_FP32_DTYPE = torch.float32\n_MPS_MLP_TOKEN_CHUNK_SIZE = 128\n# keep MPS activation chunks below the allocator high-watermark; CUDA keeps\n# its fused full-sequence projection\n_MPS_QKV_PROJECTION_TOKEN_CHUNK_SIZE = 128\n_MPS_ATTENTION_QUERY_TOKEN_CHUNK_SIZE = 128\n\n_MPS_EMBED_WEIGHT_PREFIXES = (\n    \"condition_proj\",\n    \"video_patch_proj\",\n    \"audio_patch_proj\",\n    \"time_embedder\",\n    \"token_refiner.final_norm\",\n)\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py#L107-L143","documentation":"When loading a MiniMax H3 checkpoint in Diffusers fused format, the loader tracks a set of expected fused parameters; if some remain unfilled after processing (pending), the fused state dict is incomplete and it raises listing the missing names. This guards against silently partial weight loads.","triggerScenarios":"Loading a Diffusers-format H3 checkpoint whose keys don't cover all expected fused parameters — renamed keys across Diffusers versions, a partially exported/sliced checkpoint, or a version skew between the loader's expected name map and the checkpoint.","commonSituations":"Upgrading Diffusers or sglang where fused qkv/mlp parameter names changed; using a community-converted or re-exported checkpoint missing some fused tensors; the test test_native_weight_names_and_grouped_qkv_reorder exercising name mapping with a stale fixture.","solutions":["Inspect the 'incomplete' names in the message and compare against the checkpoint's actual state_dict keys to see the naming mismatch","Re-export or re-download the checkpoint with a matching Diffusers version, or use the native (non-Diffusers) weight layout","Update the name-mapping table in _diffusers_h3_checkpoint to the new key names, mapping each pending tensor"],"exampleFix":"# before: checkpoint uses 'blocks.0.attn.qkv.weight' but map expects fused names\nstate = torch.load('h3_diffusers.pt')\n\n# after: rename to expected fused layout or load native names\nfor k in list(state):\n    state[k.replace('attn.qkv', 'attn.fused_qkv')] = state.pop(k)","handlingStrategy":"validation","validationCode":"expected = set(EXPECTED_FUSED_NAMES)\nactual = set(state_dict.keys())\nmissing = expected - actual\nassert not missing, f'checkpoint missing fused keys: {sorted(missing)}'","typeGuard":null,"tryCatchPattern":"try: load_diffusers_h3(sd)\\nexcept ValueError as e: fallback_to_native_layout(sd) if 'Incomplete' in str(e) else raise","preventionTips":["Validate checkpoint key coverage before loading","Pin the Diffusers version used to export the checkpoint","Prefer native weight layout for H3 when available"],"tags":["checkpoint-loading","weight-mapping","diffusers","minimax-h3","state-dict"],"backgroundTag":"checkpoint-key-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}