{"record":{"id":"ec665d0c8a1b1b5d","repo":"sgl-project/sglang","slug":"mps-supports-only-resident-or-layerwise-offload-co","errorCode":null,"errorMessage":"MPS supports only resident or layerwise-offload component residency","messagePattern":"MPS supports only resident or layerwise-offload component residency","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/server_args/server_args.py","lineNumber":1427,"sourceCode":"        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        )\n\n    def explicit_residency_mode(self, component_name: str) -> str | None:\n        \"\"\"Resolve explicit controls in canonical-to-compatibility priority.\"\"\"\n        mode = self.canonical_residency_mode(component_name)\n        if mode is not None:","sourceCodeStart":1409,"sourceCodeEnd":1445,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/server_args/server_args.py#L1409-L1445","documentation":"On MPS, component_residency values must be 'resident' or 'layerwise_offload'; other offload modes rely on CUDA-only facilities and are rejected during platform adjustment.","triggerScenarios":"--component-residency dit=cycle or any non-{RESIDENT, LAYERWISE_OFFLOAD} mode while running on Apple MPS.","commonSituations":"Porting CUDA-oriented offload configs (e.g. block/cycle offload) to a Mac; defaults introduced by a shared config that include unsupported modes.","solutions":["Restrict each entry to resident or layerwise_offload on MPS","Drop --component-residency to use defaults","Run the exotic offload modes on CUDA hardware instead"],"exampleFix":"# before\n--component-residency dit=block_offload  # on MPS\n# after\n--component-residency dit=layerwise_offload","handlingStrategy":"validation","validationCode":"ALLOWED = {'resident', 'layerwise_offload'}\nif on_mps:\n    assert all(m in ALLOWED for m in component_residency.values())","typeGuard":"def mps_safe_residency(m: str) -> bool:\n    return m in ('resident', 'layerwise_offload')","tryCatchPattern":null,"preventionTips":["Maintain per-platform config profiles","Test configs on the target platform in CI"],"tags":["platform","mps","residency","config"],"backgroundTag":"unsupported-platform-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}