Using MPS Accelerator with formula enrichment falls back to default CPU #2505
Replies: 1 comment
-
|
Hi @SandeepHub! I'm Dosu and I’m helping the docling team. When you enable formula enrichment, Docling restricts supported accelerator devices to only CPU and CUDA, intentionally excluding MPS—even if it's available on your system. This is due to compatibility issues between the formula enrichment models and the MPS backend. As a result, the pipeline falls back to CPU when formula enrichment is active, and there isn't currently a workaround to force MPS usage with this feature enabled. This behavior is by design to avoid failures or instability with the formula model on MPS devices. For now, using formula enrichment requires CPU or CUDA; if you need hardware acceleration on Mac, you'll need to disable formula enrichment or use a CUDA-capable device instead. For more details, see the discussion and code logic confirming this restriction: To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to parse a pdf document containing mathematical formulas. If i use the default DocumentConverter constructor it uses MPS. However if I use custom PdfPipelineOptions with formula_enrhicment= true. It falls back to CPU.
Here is the log
2025-10-22 01:31:41,220 - INFO - detected formats: [<InputFormat.PDF: 'pdf'>]
2025-10-22 01:31:41,266 - INFO - Going to convert document batch...
2025-10-22 01:31:41,266 - INFO - Initializing pipeline for StandardPdfPipeline with options hash e8dc82c5095ab188b82ddd041c73fb64
2025-10-22 01:31:41,268 - INFO - Loading plugin 'docling_defaults'
2025-10-22 01:31:41,269 - INFO - Registered picture descriptions: ['vlm', 'api']
2025-10-22 01:31:41,272 - INFO - Loading plugin 'docling_defaults'
2025-10-22 01:31:41,274 - INFO - Registered ocr engines: ['auto', 'easyocr', 'ocrmac', 'rapidocr', 'tesserocr', 'tesseract']
2025-10-22 01:31:41,618 - INFO - Auto OCR model selected ocrmac.
2025-10-22 01:31:41,633 - INFO - Accelerator device: 'mps'
2025-10-22 01:31:42,762 - INFO - Removing MPS from available devices because it is not in supported_devices=[<AcceleratorDevice.CPU: 'cpu'>, <AcceleratorDevice.CUDA: 'cuda'>]
2025-10-22 01:31:42,762 - INFO - Accelerator device: 'cpu'
Beta Was this translation helpful? Give feedback.
All reactions