{"record":{"id":"84929cc23cd4aeef","repo":"sgl-project/sglang","slug":"minimaxh3ditmodel-forward-received-unexpected-kwar","errorCode":null,"errorMessage":"MiniMaxH3DiTModel.forward received unexpected kwargs: {unexpected}; supported kwargs: {sorted(_FORWARD_SUPPORTED_KWARGS)}","messagePattern":"MiniMaxH3DiTModel\\.forward received unexpected kwargs: (.+?); supported kwargs: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py","lineNumber":2373,"sourceCode":"                audio_row_ids,\n                audio_embed.to(_BF16_DTYPE),\n            )\n\n        t_emb = self._time_embedding(unique_timesteps)\n        return embeddings, t_emb\n\n    def forward(self, **kwargs: Any) -> tuple[torch.Tensor, torch.Tensor]:\n        \"\"\"Packed inference forward.\n\n        Keyword names follow the checkpoint's serving contract.\n        Returns `(video_logits, audio_logits)` from rows selected by\n        `img_pos_for_infer_output_info` and `audio_pos_info`, with condition\n        rows zeroed by update masks.\n        \"\"\"\n        # Strict keyword contract: refuse any kwarg forward does not consume.\n        unexpected = sorted(set(kwargs) - _FORWARD_SUPPORTED_KWARGS)\n        if unexpected:\n            raise TypeError(\n                \"MiniMaxH3DiTModel.forward received unexpected kwargs: \"\n                f\"{unexpected}; supported kwargs: \"\n                f\"{sorted(_FORWARD_SUPPORTED_KWARGS)}\"\n            )\n\n        x = _required_kwarg(kwargs, \"x\")\n        audio_x = _required_kwarg(kwargs, \"audio_x\")\n        img_position_ids = _required_kwarg(kwargs, \"img_position_ids\")\n        unique_timesteps = _required_kwarg(kwargs, \"unique_timesteps\")\n        inverse_indices = (\n            _required_kwarg(kwargs, \"inverse_indices\").view(-1).to(torch.long)\n        )\n        update_mask = _required_kwarg(kwargs, \"update_mask\")\n        subblock_sparse_query_block_mask = kwargs.get(\n            \"subblock_sparse_query_block_mask\"\n        )\n        block_token_tags = kwargs.get(\"block_token_tags\")\n        token_tags = kwargs.get(\"token_tags\")","sourceCodeStart":2355,"sourceCodeEnd":2391,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py#L2355-L2391","documentation":"MiniMaxH3DiTModel.forward enforces a strict keyword contract: any kwarg not in _FORWARD_SUPPORTED_KWARGS raises TypeError. This catches typos and stale call sites early instead of silently ignoring parameters via **kwargs.","triggerScenarios":"Calling forward with a misspelled or deprecated kwarg (e.g. img_pos_for_infer instead of img_pos_for_infer_output_info), or a caller written against an older/newer signature.","commonSituations":"Version drift between the pipeline code and the DiT model signature; copy-pasted kwargs from a different DiT implementation; renamed flags after refactors.","solutions":["Check the error message: it lists the supported kwargs; remove/rename the unexpected ones","Align pipeline code with the current forward signature (see _FORWARD_SUPPORTED_KWARGS in the source)","Pin versions of the multimodal_gen runtime and model code to matching commits"],"exampleFix":"// before\nmodel(x=x, img_pos_for_infer=img_pos, ...)\n// after\nmodel(x=x, img_pos_for_infer_output_info=img_pos, ...)","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.models.dits.minimax_h3 import _FORWARD_SUPPORTED_KWARGS\nbad = set(my_kwargs) - _FORWARD_SUPPORTED_KWARGS\nassert not bad, f\"unsupported kwargs: {bad}\"","typeGuard":null,"tryCatchPattern":"try:\n    model.forward(**kwargs)\nexcept TypeError as e:\n    if 'unexpected kwargs' in str(e):\n        log_and_align_signature(e)  # message lists supported kwargs\n    raise","preventionTips":["Update pipeline and model code together (same commit/PR)","Write a smoke test that calls forward with the pipeline's exact kwargs"],"tags":["minimax-h3","kwargs-contract","api-signature"],"backgroundTag":"unexpected-keyword-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}