Repository navigation
Using fork in OSX now breaks - #577
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused platform check addresses the macOS crash while preserving existing behavior elsewhere.
0 open findings
What changed in this PR
Updates Docling subprocess creation to avoid PyTorch/MPS crashes on macOS.
Changes:
- Uses
spawnon macOS or whenforkis unavailable. - Retains
forkon supported non-macOS platforms.
| File | Description |
|---|---|
compass/services/cpu.py |
Selects a platform-safe multiprocessing start method for Docling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #577 +/- ##
==========================================
+ Coverage 71.55% 71.56% +0.01%
==========================================
Files 81 81
Lines 8429 8433 +4
Branches 909 910 +1
==========================================
+ Hits 6031 6035 +4
Misses 2225 2225
Partials 173 173
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ppinchuk
left a comment
There was a problem hiding this comment.
Is there any way we can add a test for this?
Bonus points if we can show that a test fails in CI for this particular case
317ca14 to
79f786c
Compare
79f786c to
7ace095
Compare
Forking after PyTorch/MPS (Metal) init silently crashes the Docling child process on macOS, surfacing as a misleading no-text-found result. Add a Darwin-only test asserting _run_docling_in_subprocess selects the spawn start method instead of fork.
7ace095 to
4d17f44
Compare
Because docling uses PyTorch, which on OSX uses MPS, it silently crashes the subprocess resulting in like a no text found. It is interesting that this is a new error. That didn't happen before. Since this is an OSX only change, it shouldn't affect our production runs.
|
@ppinchuk , new test confirmed to crash in GitHub actions. |
|
@ppinchuk , feel free to merge it yourself if you approve it. |
|
Amazing, thank you!!! |
Because docling uses PyTorch, which on OSX uses MPS, it silently crashes the subprocess resulting in like a no text found.
It is interesting that this is a new error. That didn't happen before. Since this is an OSX only change, it shouldn't affect our production runs.