{"record":{"id":"808229d554cbbee5","repo":"sgl-project/sglang","slug":"minimax-h3-mps-execution-does-not-support-torch-co","errorCode":null,"errorMessage":"MiniMax-H3 MPS execution does not support torch.compile; pass --enable-torch-compile false","messagePattern":"MiniMax-H3 MPS execution does not support torch\\.compile; pass --enable-torch-compile false","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/configs/pipeline_configs/minimax_h3.py","lineNumber":248,"sourceCode":"            required_components = (\n                \"transformer\",\n                \"text_encoder\",\n                \"video_vae\",\n                \"audio_vae\",\n            )\n            missing_components = [\n                component\n                for component in required_components\n                if server_args.residency_mode(component) != LAYERWISE_OFFLOAD\n            ]\n            if missing_components:\n                raise ValueError(\n                    \"MiniMax-H3 on MPS requires synchronous layerwise offload for \"\n                    f\"{missing_components}; pass --layerwise-offload-components \"\n                    \"transformer text_encoder video_vae audio_vae\"\n                )\n            if server_args.enable_torch_compile:\n                raise ValueError(\n                    \"MiniMax-H3 MPS execution does not support torch.compile; \"\n                    \"pass --enable-torch-compile false\"\n                )\n        selected_backend = self.resolve_transformer_attention_backend(server_args)\n        if (\n            int(server_args.ring_degree or 1) > 1\n            and selected_backend is not AttentionBackendEnum.FA\n        ):\n            raise ValueError(\n                \"MiniMax-H3 ring parallelism requires the FlashAttention \"\n                \"backend for the transformer\"\n            )\n        if selected_backend is None:\n            return\n        get_attn_backend(\n            self.dit_config.arch_config.attention_head_dim,\n            torch.bfloat16,\n            selected_attention_backend=selected_backend,","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/configs/pipeline_configs/minimax_h3.py#L230-L266","documentation":"The MiniMax-H3 MPS execution path (synchronous layerwise offload) is incompatible with torch.compile, so validate_server_args rejects server_args.enable_torch_compile == True on MPS. Compiling graph-broken offload loops yields no benefit and can produce incorrect graphs, so it is hard-disabled.","triggerScenarios":"Launching MiniMax-H3 on MPS with --enable-torch-compile (or a config defaulting it on) while the MPS layerwise-offload path is active.","commonSituations":"Reusing a CUDA launch script with --enable-torch-compile on a Mac; profiles/tuning guides written for GPU being applied to MPS runs.","solutions":["Pass --enable-torch-compile false (or omit the flag) when running on MPS","Strip GPU-specific perf flags from launch scripts when targeting Apple Silicon","If torch.compile is required, run on a CUDA host"],"exampleFix":"# before\npython -m sglang.launch_server --model MiniMax-H3 --device mps --enable-torch-compile\n\n# after\npython -m sglang.launch_server --model MiniMax-H3 --device mps --enable-torch-compile false","handlingStrategy":"validation","validationCode":"if server_args.device == \"mps\":\n    assert not server_args.enable_torch_compile, \"torch.compile unsupported on MPS path\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep separate launch scripts per device; never copy CUDA perf flags to MPS","Default enable_torch_compile to False and enable explicitly only on CUDA"],"tags":["minimax-h3","mps","torch-compile","server-args"],"backgroundTag":"incompatible-launch-flags","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}