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

Sklearn/XGBoost n threads is hardcoded #112

Closed
svandenhoek opened this issue Jun 21, 2022 · 1 comment · Fixed by #117
Closed

Sklearn/XGBoost n threads is hardcoded #112

svandenhoek opened this issue Jun 21, 2022 · 1 comment · Fixed by #117
Assignees
Labels
bug Something isn't working

Comments

@svandenhoek
Copy link
Contributor

svandenhoek commented Jun 21, 2022

Describe the bug

Number of parallel threads used by XGBoost is hardcoded instead of checking n threads available on system:

Expected behavior

Either:
A) Value is based on available threads on system. Should be fixable with n_jobs=-1 (except perhaps on cluster, see below).
B) Set through a command line argument (with value 1 or option A as default).

Additional context

Pre-1.3.0 versions of XGBoost have a bug and should use something like this instead.

XGBoost uses cgroup to determine if CPU limit should be set lower than actual system resources (when using n_jobs=-1). Not sure if this works nicely together with Slurm. Something like this might be needed for that instead. But either way would require some testing on the cluster no matter what solution is chosen.

@svandenhoek svandenhoek added the bug Something isn't working label Jun 21, 2022
@dennishendriksen
Copy link
Contributor

I prefer B) with 1 as default

@SietsmaRJ SietsmaRJ self-assigned this Jul 4, 2022
SietsmaRJ pushed a commit that referenced this issue Jul 4, 2022
- Fixes an issue where the amount of threads that XGBoost could use to train was hardcoded. The user can now set that amount themselves, although limited to at least 1.

Closes #112
@SietsmaRJ SietsmaRJ mentioned this issue Jul 4, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants