LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

Irreproducible Segfault with LightGBM

Open vruvora opened this issue 8 years ago • 24 comments

We are experiencing cases of irreproducible Segfault with LightGBM. Does anyone else have this issue?

Environment info

Operating System:

CPU/GPU model:

C++/Python/R version:

Error message

Reproducible examples

Steps to reproduce

1. 2. 3.

vruvora avatar Oct 11 '18 07:10 vruvora

Did you install LightGBM from PyPI? The distributions on PyPI may be broken. (I guess compile optimization may be a cause) So, can you try to compile from source?

henry0312 avatar Oct 11 '18 07:10 henry0312

We are installing with pip install. It just hangs in a middle of an optimization. We can try compiling from source but is there a reason why PyPI may be broken?

vruvora avatar Oct 11 '18 07:10 vruvora

I guess there are something wrong with manylinux and -O3. Maybe, we should compile without -O3 on manylinux.

henry0312 avatar Oct 11 '18 07:10 henry0312

Interesting. Have you or anyone else experienced this because we have been experiencing this a fair amount but I have not seen any big reported use cases? This seems like it would break the package from being used in production.

vruvora avatar Oct 11 '18 07:10 vruvora

@vruvora Did the Segfault occur often?

guolinke avatar Oct 11 '18 07:10 guolinke

Yes. It has been happening a quite a bit as of late. We have automated statistical unit tests with sample datasets which may be a degenerate optimization problem. However, we use them to make sure our pipeline is in order when we have big changes. Generally, ~1/5 times it will segfault and it will stop once we do it again.

vruvora avatar Oct 11 '18 07:10 vruvora

I saw uncertain crash many times in my main job.

henry0312 avatar Oct 11 '18 07:10 henry0312

@henry0312 Interesting. Have you been able to fix it?

vruvora avatar Oct 11 '18 07:10 vruvora

@vruvora you should be sure to uninstall the package from PyPI and install manually.

henry0312 avatar Oct 11 '18 07:10 henry0312

@vruvora Yeah, installing from source have solved the problem.

henry0312 avatar Oct 11 '18 07:10 henry0312

@henry0312 I will try this out and update accordingly. Thanks. @guolinke Do you know why source isn't up to date with PyPI?

vruvora avatar Oct 11 '18 07:10 vruvora

No, please see https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst.

henry0312 avatar Oct 11 '18 08:10 henry0312

@vruvora you can use

pip install --no-binary :all: lightgbm

as well.

guolinke avatar Oct 11 '18 08:10 guolinke

@henry0312 building without O3 may slow-down the running speed.

I am not very sure why Segfault happened, and why building from source can fix it.

guolinke avatar Oct 11 '18 09:10 guolinke

@guolinke Yes, -O3 makes cumpting perfomance better, but there may be something wrong with tunes for manylinux.

henry0312 avatar Oct 11 '18 09:10 henry0312

@guolinke Will this be slower pip install --no-binary :all: lightgbm than regular pip? Can you elaborate on the differences?

vruvora avatar Oct 11 '18 23:10 vruvora

@vruvora have you solved your issue?

henry0312 avatar Oct 15 '18 09:10 henry0312

@henry0312 Yes. As far as we know. No more segafults.

vruvora avatar Oct 18 '18 00:10 vruvora

should we add this problem and solution to the document?

guolinke avatar Oct 18 '18 03:10 guolinke

ping @henry0312

StrikerRUS avatar Nov 27 '18 14:11 StrikerRUS