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
PKG Add Xgboost #2537
PKG Add Xgboost #2537
Conversation
CppException is very helpful btw, thanks @hoodmane. |
I've asked around, and there seems to be a way to install a single-threaded version of XGBoost. Apparently you just need to set the CMake flag |
pyodide/packages/xgboost/meta.yaml Lines 11 to 15 in efedbca
I think I disabled |
I can see that OPENMP is disabled from the build log.
Probably xgboost creates a thread somewhere even if we build it as a single-threaded version? |
Thanks for working on this, I ran simple tests with numpy as input and there's no thread being launched by XGBoost. However the data fetching process inside the parser might spawn threads, will get back to this next week. |
Hi, I can confirm that the data parser is indeed creating new threads. Can we use normal numpy/scipy.sparse/pandas as inputs for tests instead of the data parser inside XGBoost? |
Thanks, @trivialfis! I was able to use numpy arrays and pandas dataframes in the test. |
Okay, then this can be reviewed now. Ideally, it would be great if we can add more tests. But frankly, I don't know much about the common examples for XGBoost. @tunguz would you like to review this PR? Note that you can download build artifacts from CI and test XGBoost. |
Upstream patches in this PR are accepted: dmlc/xgboost#7954 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me aside from some very minor comments.
@@ -0,0 +1,26 @@ | |||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it would be good to share this stuff with other CMake packages? Of course you would be better equipped to know about that than me. Perhaps as a followup to this PR or when you and @henryiii figure out more of the CMake stuff we could move this maybe to the tools
directory and add a section to the package building docs about it?
For comparison, in #2378 I put the toolchain file into tools
. It's not clear that this is the best place for these files, they might be better off in a folder called toolchains
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps as a followup to this PR or when you and @henryiii figure out more of the CMake stuff we could move this maybe to the
tools
directory and add a section to the package building docs about it?
Yeah, I think I should update our build system to use emscripten's cmake toolchain file directly if possible, instead of making a custom toolchain file for each package. I think it is possible if we set some compiler variables correctly but I haven't checked yet.
Thanks for the review! |
Description
On top of #2488, add XGboost package.
Checklists