We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
xgboost leads to a segmentation fault when torch is imported before xgboost. Tested on py37/macOS
xgboost
torch
Prepare the environment
virtualenv venv -p37 . venv/bin/activate pip install torch 'xgboost[scikit-learn]'
Versions:
$ python -VV Python 3.7.10 (default, Jun 9 2021, 14:25:02) [Clang 12.0.5 (clang-1205.0.22.9)] $ pip freeze | grep -E 'torch|xgboost|scikit-learn' scikit-learn==1.0.1 torch==1.10.1 xgboost==1.5.1
Minimal script:
# segfault_example.py import numpy as np import torch from xgboost import XGBClassifier model = XGBClassifier(objective="multi:softmax", num_class=3) x = np.random.rand(3, 10) y = np.arange(3) model.fit(x, y)
run
$ python segfault_example.py <unrelated warnings> [1] 27331 segmentation fault segfault_example.py
If torch is imported after xgboost then the segfault goes away. (Try swappign the imports in the script above.)
11.6.2
3.7.10
scikit-learn==1.0.1
torch==1.10.1
xgboost==1.5.1
The text was updated successfully, but these errors were encountered:
Is it related to #7039 ?
Sorry, something went wrong.
Good point. I just downgraded to libomp==11.1.0 as per #7039 and the error went away.
libomp==11.1.0
I guess torch does something with libomp as well? Not sure why the error goes away if torch is imported after xgboost.
libomp
Not sure why the error goes away if torch is imported after xgboost
I don't know, would be curious to take a look into libomp if the issue is on Linux ..
Closing as it's duplicated to #7039
No branches or pull requests
xgboost
leads to a segmentation fault whentorch
is imported beforexgboost
. Tested on py37/macOSTo reproduce
Prepare the environment
Versions:
Minimal script:
run
Note
If
torch
is imported afterxgboost
then the segfault goes away. (Try swappign the imports in the script above.)System
11.6.2
3.7.10
scikit-learn==1.0.1
torch==1.10.1
xgboost==1.5.1
The text was updated successfully, but these errors were encountered: