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

Upgrade XGBoost to use BB on all platforms #68

Merged
merged 5 commits into from
Jun 20, 2019

Conversation

staticfloat
Copy link
Contributor

This upgrades the package (and a few stylistic points within the package itself) to use prebuilt binaries instead of requiring the user to compile on their own machine.

@staticfloat staticfloat changed the title Upgrade XGBoost to use BB on all platforms [WIP] Upgrade XGBoost to use BB on all platforms Jun 19, 2019
@staticfloat
Copy link
Contributor Author

staticfloat commented Jun 19, 2019

I've switched this to WIP, because in my testing, Windows doesn't work yet, and I also suspect that there are std::string values that cross the API boundary, which means we need to test out the new BB multiversioning capability to match against std::string ABI version. (EDIT: This was incorrect; this package only uses std::basic_string, so there are no incompatibilities) Hold tight. :)

@staticfloat
Copy link
Contributor Author

So the problem with Windows is that the binaries immediately crash Julia upon dlopen(). The backtrace is the following:

julia> using Libdl; Libdl.dlopen("xgboost.dll")
warning: Critical error detected c0000374

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x000007fba7a7a598 in ntdll!RtlpNtCreateKey () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
(gdb) bt
#0  0x000007fba7a7a598 in ntdll!RtlpNtCreateKey () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fba7a7f3f0 in ntdll!RtlpNtCreateKey () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#2  0x000007fba7a25f05 in ntdll!RtlSetCurrentEnvironment () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#3  0x000007fba54c11bc in msvcrt!free () from /cygdrive/c/Windows/system32/msvcrt.dll
#4  0x000000006fcb366d in libstdc++-6!_ZNSs6assignERKSs () from /home/Administrator/dist/bin/libstdc++-6.dll
#5  0x0000000029d96f9d in dmlc::data::LibSVMParserParam::__MANAGER__() () from /cygdrive/c/Users/Administrator/.julia/packages/XGBoost/VnexW/deps/usr/bin/xgboost.dll
#6  0x0000000029f0559e in _GLOBAL__sub_I_data.cc () from /cygdrive/c/Users/Administrator/.julia/packages/XGBoost/VnexW/deps/usr/bin/xgboost.dll
#7  0x0000000029da4ed5 in __do_global_ctors () at /workspace/srcdir/mingw-w64-v6.0.0/mingw-w64-crt/crt/gccmain.c:67
#8  0x0000000029d2129e in __DllMainCRTStartup (hDllHandle=0x29d20000, dwReason=1, lpreserved=0x0) at /workspace/srcdir/mingw-w64-v6.0.0/mingw-w64-crt/crt/crtdll.c:193
#9  0x000007fba79ab7df in ntdll!RtlAllocateAndInitializeSid () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#10 0x000007fba79bd288 in ntdll!RtlLocaleNameToLcid () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#11 0x000007fba79bc817 in ntdll!RtlLocaleNameToLcid () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#12 0x000007fba79be5a6 in ntdll!RtlLocaleNameToLcid () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#13 0x000007fba79be966 in ntdll!RtlLocaleNameToLcid () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#14 0x000007fba79d1c47 in ntdll!LdrLoadDll () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#15 0x000007fba4bc7c4d in LoadLibraryExW () from /cygdrive/c/Windows/system32/KERNELBASE.dll
#16 0x000000006b5af0ba in jl_dlopen (filename=filename@entry=0x29d1eaf0 "xgboost.dll", flags=flags@entry=68)
    at /home/Administrator/buildbot/worker/package_win64/build/src/dlload.c:85
#17 0x000000006b5af2b0 in jl_load_dynamic_library (modname=0xd675d58 "xgboost.dll", flags=68, throw_err=701623824)
    at /home/Administrator/buildbot/worker/package_win64/build/src/dlload.c:189
#18 0x00000000030e7a19 in julia_#dlopen#3_14362 () at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Libdl\src\Libdl.jl:109
#19 0x0000000028d20e0a in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@staticfloat
Copy link
Contributor Author

staticfloat commented Jun 19, 2019

Alright, I'm not certain why I thought std::basic_string values were somehow exempt from the cxx11 string ABI problems, but they aren't. Building string-abi-specific tarballs fixes this, and this package passes tests on linux64, mac64 and win64, so I am taking off the WIP tag. :)

@staticfloat staticfloat changed the title [WIP] Upgrade XGBoost to use BB on all platforms Upgrade XGBoost to use BB on all platforms Jun 19, 2019
@aviks
Copy link
Collaborator

aviks commented Jun 19, 2019

Thanks Elliot, this is exciting. Do you know if these binaries are built with openmp?

@staticfloat
Copy link
Contributor Author

All except for MacOS are. This is because on MacOS, we are using clang to build Julia, and getting OpenMP to work with clang is apparently complicated, I haven't looked into it too much. Using gcc on MacOS will cause us to mix C++ stdlibs, and I don't think that's a good thing, so we're sticking with non-OpenMP on macOS. Is that reasonable?

@aviks
Copy link
Collaborator

aviks commented Jun 19, 2019

Is that reasonable?

eminently.

Manifest.toml Show resolved Hide resolved
Project.toml Show resolved Hide resolved
src/XGBoost.jl Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants