Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: segmentation faults on MacOS with lightgbm tests (with newer libomp versions) #3093

Merged
merged 8 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- Fixed segmentation fault errors on our MacOS test suite involving `lightgbm`
([#3093](https://github.com/slundberg/shap/pull/3093) by @thatlittleboy).

### Changed

### Removed
Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
try:
# On MacOS, the newer libomp versions that comes with Homebrew (version >= 12)
# cause segfaults to occur when pytorch + lightgbm are imported (in that order).
# The error does not occur when we import lightgbm first because lightgbm
# distributes its own libomp which takes precedence.
# cf. GH issue #3092 for more context.
import lightgbm # noqa: F401
except ImportError:
pass

import numpy as np
import pytest

Expand Down