{"record":{"id":"467f416342b1f639","repo":"docling-project/docling","slug":"mps-is-not-supported-by-this-model-supported-devi","errorCode":null,"errorMessage":"MPS is not supported by this model. Supported devices: {[d.value for d in supported_devices]}","messagePattern":"MPS is not supported by this model\\. Supported devices: (.+?)","errorType":"exception","errorClass":"AcceleratorDeviceNotAvailableError","httpStatus":null,"severity":"error","filePath":"docling/utils/accelerator_utils.py","lineNumber":95,"sourceCode":"            elif len(parts) == 1:  # just \"cuda\"\n                device = \"cuda:0\"\n            else:\n                raise AcceleratorDeviceNotAvailableError(\n                    f\"Invalid CUDA device format '{accelerator_device}'. \"\n                    f\"Use 'cuda' or 'cuda:N' where N is a valid device index.\"\n                )\n        else:\n            raise AcceleratorDeviceNotAvailableError(\n                \"CUDA is not available in the system. \"\n                \"Please ensure PyTorch with CUDA support is installed, or use --device auto/cpu.\"\n            )\n\n    elif accelerator_device == AcceleratorDevice.MPS.value:\n        if (\n            supported_devices is not None\n            and AcceleratorDevice.MPS not in supported_devices\n        ):\n            raise AcceleratorDeviceNotAvailableError(\n                f\"MPS is not supported by this model. Supported devices: {[d.value for d in supported_devices]}\"\n            )\n\n        if has_mps:\n            device = \"mps\"\n        else:\n            raise AcceleratorDeviceNotAvailableError(\n                \"MPS is not available in the system. \"\n                \"Please ensure you are running on Apple Silicon with MPS support, or use --device auto/cpu.\"\n            )\n\n    elif accelerator_device == AcceleratorDevice.XPU.value:\n        if (\n            supported_devices is not None\n            and AcceleratorDevice.XPU not in supported_devices\n        ):\n            raise AcceleratorDeviceNotAvailableError(\n                f\"XPU is not supported by this model. Supported devices: {[d.value for d in supported_devices]}\"","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/utils/accelerator_utils.py#L77-L113","documentation":"AcceleratorDeviceNotAvailableError raised by decide_device() when the user explicitly requests 'mps' but the model's supported_devices list excludes AcceleratorDevice.MPS. Like the CUDA twin, this is a model-capability mismatch: the pipeline stage being initialized cannot run on Apple Silicon MPS regardless of whether MPS exists.","triggerScenarios":"Setting accelerator_device='mps' in pipeline options or via CLI while initializing a model stage whose constructor passes supported_devices without MPS (e.g. a CUDA/CPU-only model spec).","commonSituations":"Enabling MPS globally on a Mac while a specific pipeline stage (certain table/OCR backends) does not support it; version changes that restrict a model's device set; custom models added without MPS support.","solutions":["Use accelerator_device='auto', which silently demotes MPS for models that do not support it","Check the model stage's documentation/source for its supported_devices and align the request","Set the device per-stage instead of globally if only one component rejects MPS","Update docling — device support for specific models changes between releases"],"exampleFix":"# before\naccelerator_options.accelerator_device = \"mps\"\n\n# after\naccelerator_options.accelerator_device = \"auto\"","handlingStrategy":"validation","validationCode":"from docling.datamodel.accelerator_options import AcceleratorDevice\n\nsupported = {d.value for d in model_supported_devices or []}\nif accelerator_options.accelerator_device == \"mps\" and supported and \"mps\" not in supported:\n    accelerator_options.accelerator_device = \"auto\"","typeGuard":"def mps_supported(supported: set[str]) -> bool:\n    return \"mps\" in supported","tryCatchPattern":"from docling.exceptions import AcceleratorDeviceNotAvailableError\n\ntry:\n    device = decide_device(\"mps\", supported_devices)\nexcept AcceleratorDeviceNotAvailableError:\n    device = decide_device(\"auto\", supported_devices)","preventionTips":["Use 'auto' on mixed Mac fleets — it demotes MPS per model","Check the specific model stage's supported device list before forcing MPS","Set device per stage when only some components accept MPS","Recheck after upgrading docling — device support sets change"],"tags":["mps","accelerator","configuration","apple-silicon"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}