Skip to content

docs: adding OpenMP conflicts resolution to FAISSDocumentStore documents#10740

Merged
davidsbatista merged 1 commit intomainfrom
docs/adding-FAISSDocumentStore-OpenMP-issue-fix
Mar 5, 2026
Merged

docs: adding OpenMP conflicts resolution to FAISSDocumentStore documents#10740
davidsbatista merged 1 commit intomainfrom
docs/adding-FAISSDocumentStore-OpenMP-issue-fix

Conversation

@davidsbatista
Copy link
Contributor

Notes for the reviewer

see: deepset-ai/haystack-integrations#410 (comment)

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@davidsbatista davidsbatista requested a review from a team as a code owner March 5, 2026 10:54
@davidsbatista davidsbatista requested review from julian-risch and removed request for a team March 5, 2026 10:54
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment Mar 5, 2026 10:55am

Request Review


#### Symptoms

You may encounter one or both of the following errors at runtime:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[MyStyle.TheFollowing] Avoid 'the following'—it's implied by the colon. Rephrase or remove.

resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
```

If setting `OMP_NUM_THREADS=1` prevents the crash, the root cause is **multiple OpenMP runtimes loaded simultaneously**. Each runtime maintains its own thread pool and thread-local storage (TLS). When two runtimes spin up worker threads at the same time, they corrupt each other's memory — causing segfaults at `N > 1` threads.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Google.Parens] Use parentheses judiciously.

resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
```

If setting `OMP_NUM_THREADS=1` prevents the crash, the root cause is **multiple OpenMP runtimes loaded simultaneously**. Each runtime maintains its own thread pool and thread-local storage (TLS). When two runtimes spin up worker threads at the same time, they corrupt each other's memory — causing segfaults at `N > 1` threads.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Google.EmDash] Don't put a space before or after a dash.


#### Fix

The solution is to pick one canonical `libomp.dylib` (torch's is a good choice) and replace all other copies with symlinks pointing to it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Google.Parens] Use parentheses judiciously.


The solution is to pick one canonical `libomp.dylib` (torch's is a good choice) and replace all other copies with symlinks pointing to it.

For each duplicate, delete the copy and replace it with a symlink:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[MyStyle.KeyboardKeys] Keyboard keys should be capitalized ('Delete', 'Enter', 'F2').

/path/to/.venv/lib/pythonX.Y/site-packages/<package>/.dylibs/libomp.dylib
```

Repeat for every duplicate found. Because these packages use `@loader_path`-relative references to load `libomp.dylib`, the symlink will be transparently resolved to the single canonical runtime at load time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[MyStyle.WeakWords] Avoid weak filler words like 'very'.

/path/to/.venv/lib/pythonX.Y/site-packages/<package>/.dylibs/libomp.dylib
```

Repeat for every duplicate found. Because these packages use `@loader_path`-relative references to load `libomp.dylib`, the symlink will be transparently resolved to the single canonical runtime at load time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[Google.Will] Avoid using 'will'.

@davidsbatista davidsbatista merged commit 0b46872 into main Mar 5, 2026
12 checks passed
@davidsbatista davidsbatista deleted the docs/adding-FAISSDocumentStore-OpenMP-issue-fix branch March 5, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants