dmlc / XGBoost.jl

XGBoost Julia Package
Other
288 stars 111 forks source link

xgboost failing with julia 1.8.5 #179

Closed naveenpalli closed 1 year ago

naveenpalli commented 1 year ago

XGBoost version 2.2.5 Julia Version 1.8.5 Commit 17cfb8e65e (2023-01-08 06:45 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, skylake) Threads: 1 on 8 virtual cores

--- sample code below crashes at the last line

using XGBoost using DataFrames

(X,y) = (DataFrame(randn(100,3), [:l, :r, :u]), randn(100))

b = xgboost((X,y), max_depth=4)

ExpandingMan commented 1 year ago

Can you show the full stack trace? I can't reproduce any error.

ablaom commented 1 year ago

Yes, please post stack trace, but my guess is https://github.com/JuliaLang/julia/issues/48187 . Only workaround I know of is downgrade julia to < 1.8.4 or use non-windows machine

naveenpalli commented 1 year ago

How do I generate the full stack trace? Running on Windows 11

ExpandingMan commented 1 year ago

Oh, I didn't notice this was windows, yeah it's probably that. Also Julia 1.9 just came out today so that might work (and it's best to upgrade anyway).

How do I generate the full stack trace? Running on Windows 11

What appears when you see the error?

jeremiedb commented 1 year ago

Unfortunately the problem hasn't been resolved with Julia v1.9. AFAIK, the most active thread discussing the issue is: https://discourse.julialang.org/t/issue-with-xgboost-jl-and-libsvm-jl-when-julia-1-8-4/92396/46

naveenpalli commented 1 year ago

Yeah, didn't fix the issue when I tried in 1.9.0 as well. Seems to be ongoing since 1.8.4. No errors are generated it silently crashes. The REPL dies when you run the four lines above and if you put in a script nothing prints.

ExpandingMan commented 1 year ago

I'm getting the sense that there are a lack of windows people around to debug the issue. I don't think any of us who have made recent commits to this package are capable of debugging the issue. Probably something JLL related but :shrug:

jd-foster commented 1 year ago

As discussed in the linked discourse thread, it seems to be an incompatibility arising after an update to building julia under gcc 12 since v1.8.4, and the libgomp (OpenMP) library. A possible work-around is to use your own system's version of libgomp, but not a good long-term solution. And, yes, it needs someone who knows how to debug windows crashes.

ExpandingMan commented 1 year ago

Do we know what library that xgboost relies on has libgomp as a build dependency? I'm wondering if it could be as simple as updating a jll build script, but I don't even know which one my specify this as a dependency.

jd-foster commented 1 year ago

The julia stdlib CompilerSupportLibraries and the CompilerSupportLibraries_jll supply a specific libgomp:

https://github.com/JuliaPackaging/Yggdrasil/blob/543e52c046761a2ad39c1d93dbbe108b79a48b22/X/XGBoost/build_tarballs.jl#LL86C1-L86C1

See also my halting attempts: https://discourse.julialang.org/t/issue-with-xgboost-jl-and-libsvm-jl-when-julia-1-8-4/92396/28?u=jd-foster

naveenpalli commented 1 year ago

Ok, quick and dirty fix to at least avoid crashes. As noted above, offending library seems to be libgomp-1.dll that is installed in the bin directory. Replacing with the 1.8.3 version seems to fix the crashes.

Mode LastWriteTime Length Name


-a--- 11/14/2022 1:07 PM 1761059 libgomp-1.dll -a--- 5/8/2023 6:28 AM 1511051 libgomp-1.dll.installed_1_9_0

the 1_9_0 version (second one) comes with 1.8.5 and 1.9.0, the first one is from 1.8.3. For now, just replace this one if you need to use XGBoost. Of course, someone needs to figure out why libgomp-1.dll.installed_1_9_0 crashes.

devmotion commented 1 year ago

Seems like a duplicate of #153?

giordano commented 1 year ago

Fixed in Julia master by https://github.com/JuliaLang/julia/pull/50135 (and yes, this is a duplicate)

ExpandingMan commented 1 year ago

Thanks so much for your efforts on this @giordano .

giordano commented 1 year ago

I merely executed the solution found by @jd-foster :slightly_smiling_face:

ExpandingMan commented 1 year ago

Ok, well thanks @jd-foster then!

giordano commented 1 year ago

I reported the fact that this issue has been fixed (at least on Julia master) because maybe you want to close this ticket (and #153) :slightly_smiling_face:

ExpandingMan commented 1 year ago

I'll wait until 1.9.2 is out and we see CI/CD pass to close them.

giordano commented 1 year ago

For CI you can check it works on nightly, like https://github.com/JuliaApproximation/FastTransforms.jl/pull/222

naveenpalli commented 1 year ago

Issue fixed in latest nightly 👍 . Great job @jd-foster and @giordano.

julia> b = xgboost((X,y), max_depth=4) [ Info: XGBoost: starting training. [ Info: [1] train-rmse:0.92113782176854342 [ Info: [2] train-rmse:0.86453193144589746 [ Info: [3] train-rmse:0.81174178860290347 [ Info: [4] train-rmse:0.77007250879661970 [ Info: [5] train-rmse:0.70126246007321902 [ Info: [6] train-rmse:0.64168739063396085 [ Info: [7] train-rmse:0.61086880841385705 [ Info: [8] train-rmse:0.56906845909755754 [ Info: [9] train-rmse:0.54034384738000574 [ Info: [10] train-rmse:0.51089554296834572 [ Info: Training rounds complete.

tylerjthomas9 commented 1 year ago

We should be good to go. All the tests are now green thanks to Julia v1.9.2

https://github.com/dmlc/XGBoost.jl/pull/184

ExpandingMan commented 1 year ago

As with #153, I believe this is now resolved on 1.9.2. Please re-open if this is not the case.