{"record":{"id":"8de650311176b95b","repo":"sgl-project/sglang","slug":"mps-currently-supports-only-num-gpus-1","errorCode":null,"errorMessage":"MPS currently supports only --num-gpus 1","messagePattern":"MPS currently supports only --num-gpus 1","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/server_args/server_args.py","lineNumber":1422,"sourceCode":"\n    @staticmethod\n    def _is_ltx23_model_path(model_path: str | None) -> bool:\n        if not model_path:\n            return False\n        normalized = model_path.lower()\n        return any(\n            token in normalized\n            for token in (\n                \"lightricks/ltx-2.3\",\n                \"models--lightricks--ltx-2.3\",\n                \"lightricks__ltx-2.3\",\n            )\n        )\n\n    def _adjust_platform_specific(self):\n        if current_platform.is_mps():\n            if self.num_gpus != 1:\n                raise ValueError(\"MPS currently supports only --num-gpus 1\")\n            if self.component_residency is not None and any(\n                mode not in (RESIDENT, LAYERWISE_OFFLOAD)\n                for mode in self.component_residency.values()\n            ):\n                raise ValueError(\n                    \"MPS supports only resident or layerwise-offload component \"\n                    \"residency\"\n                )\n            self.use_fsdp_inference = False\n\n    def is_arg_explicitly_set(self, arg_name: str) -> bool:\n        return arg_name in self._explicit_arg_names\n\n    def canonical_residency_mode(self, component_name: str) -> str | None:\n        \"\"\"Resolve the canonical selector for one component, if present.\"\"\"\n        return resolve_component_residency_mode(\n            component_name, self.component_residency\n        )","sourceCodeStart":1404,"sourceCodeEnd":1440,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/server_args/server_args.py#L1404-L1440","documentation":"On Apple MPS there is no multi-GPU support, so the runtime enforces --num-gpus 1 during platform-specific adjustment.","triggerScenarios":"Running on macOS with current_platform.is_mps() true while --num-gpus > 1 (or a config defaulting num_gpus to the machine's GPU-count heuristic).","commonSituations":"Reusing a Linux multi-GPU config on a Mac; a launcher auto-setting num_gpus = torch.cuda.device_count()-like value that is >1 on MPS.","solutions":["Set --num-gpus 1 explicitly on MPS","Use a platform-conditional launch config","Move multi-GPU workloads to a CUDA host"],"exampleFix":"# before\n--num-gpus 2  # on Apple Silicon\n# after\n--num-gpus 1","handlingStrategy":"validation","validationCode":"if platform.system() == 'Darwin':\n    assert num_gpus == 1, 'MPS supports only 1 GPU'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Platform-gate launch configs","Pin --num-gpus 1 in Mac dev scripts"],"tags":["platform","mps","gpu","config"],"backgroundTag":"unsupported-platform-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}