Skip to content

SEGFAULT on MacOS with scikit-learn==1.0.0 #7355

Closed
@PrimozGodec

Description

@PrimozGodec

xgboost segfaults in combination with scikit-learn==1.0.0 and works fine with scikit-learn==0.24

Steps to reproduce:

  1. Install scikit-learn==1.0.0 and xgboost==1.5.0
  2. Run this simple script
     import numpy as np
     import xgboost
     
     x = np.random.random((150, 4))
     y = np.random.randint(0, 3, 150)
     
     learner = xgboost.XGBClassifier()
     learner.fit(x, y)
    

I found out that scikit-learn brings its own version of libomp library together with the package. It is stored in sklearn/.dylibs/libomp.dylib. When I remove it from sklearn segfault does not happen. When libomp is present in sklearn and I remove a global version from the computer xgboost does not work since it cannot find the library. It shows that xgboost is actually not using the libomp library from scikit-learn but there must be some coincidence.

When downgrading scikit-learn to 0.24 it still ships its own version of libomp but the segfaul does not happen.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions