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

Conversation

thatlittleboy
Copy link
Collaborator

@thatlittleboy thatlittleboy commented Jul 15, 2023

Overview

Description of the changes proposed in this pull request:

Fix the segmentation fault issue arising from lightgbm x libomp version on MacOS.
Read #3092 for the diagnostics / reproducible example.

This isn't a new problem (been an issue since 2021 it seems, cf. microsoft/LightGBM#4229 and autogluon/autogluon#1442).
So not quite sure why this error is only popping up now, but it's probably triggered by the new 4.0 release of lightgbm a couple days ago.

If you read the threads above, the canonical solution is to downgrade the libomp version to < 12. But I don't think that is necessary anymore, since lightgbm distributes its own libomp to the best of my understanding, which is why the bug only occurs if you import torch, lightgbm, but not when import lightgbm, torch.

So I'm proposing a different solution, which is to import lightgbm as early as possible in our test suite, and it seems to work.

Checklist

@thatlittleboy thatlittleboy changed the title try debugging fix: segmentation faults on MacOS with lightgbm tests (due to libomp version) Jul 15, 2023
@thatlittleboy thatlittleboy changed the title fix: segmentation faults on MacOS with lightgbm tests (due to libomp version) fix: segmentation faults on MacOS with lightgbm tests (with newer libomp versions) Jul 15, 2023
@thatlittleboy thatlittleboy added bug Indicates an unexpected problem or unintended behaviour ci Relating to Continuous Integration / GitHub Actions labels Jul 15, 2023
@thatlittleboy thatlittleboy marked this pull request as ready for review July 16, 2023 01:23
@thatlittleboy thatlittleboy added this to the 0.43.0 milestone Jul 16, 2023
Copy link
Collaborator

@connortann connortann left a comment

Choose a reason for hiding this comment

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

LGTM!

@thatlittleboy thatlittleboy merged commit 5a84521 into master Jul 16, 2023
@thatlittleboy thatlittleboy deleted the segfault branch July 16, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behaviour ci Relating to Continuous Integration / GitHub Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Lightgbm tests are failing on MacOS (segmentation fault)
2 participants