Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PRF Mitigation heuristics for HGB scalability - #34935

Draft
cakedev0 wants to merge 34 commits into
scikit-learn:mainfrom
cakedev0:hgb/active_wait
Draft

PRF Mitigation heuristics for HGB scalability#34935
cakedev0 wants to merge 34 commits into
scikit-learn:mainfrom
cakedev0:hgb/active_wait

Conversation

@cakedev0

@cakedev0 cakedev0 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Finally, I have something that has a uniformly positive impact on the 8 scenarios I'm testing:

  • Big machine with default OMP settings
  • Big machine with default OMP_PROC_BIND=close => this setting avoids penalizing when a lower number of threads than what's available on the machine.
  • Laptop with no active wait enabled (behavior of conda-forge packages)
  • Laptop with active wait

(x Libgomp & libomp for each of those cases)

And that can be very/hugely beneficial in some scenarios (2-10x speed-ups):

  • small to medium datasets on big machine
  • small to medium-big datasets on laptops with no active wait

Reference Issues/PRs

Implements item 4 partially, item 5 and item 6 of #34764 (comment)

And I'd say it also closes #14306. Though this issues does have some interesting idea that are not implemented here, especially parallelism over block of samples x features for the histogram building. Still, benchmarks show HGB does continue to scale until 16-32 threads for many medium/big datasets (as long as active wait is enabled). I personally would consider that good enough ^^

What does this implement/fix? Explain your changes.

  • Limit number of threads for tree-growth based on number of features and some heuristics
  • Use a serialized implementation of apply split when the number of samples is small compared to the number of threads => this makes apply split scales as well as it can (scale when possible, do not regress otherwise)
  • Some limitations on the number of threads for the binning
  • Detect active wait by reading the stderr of import openMP with OMP_VERBOSE=true. Claude found a way to make this fast even if it has to do subprocess.run
  • Adapt heuristics depending on that.

AI usage disclosure

Mostly not, except for the active wait detection part.

Benchmarks

WIP

https://pr-81.sklbench-dashboard-preview.pages.dev/

cakedev0 and others added 30 commits August 13, 2026 09:50
Non regression test for the OverflowError fixed in 68e1aae: find_best_split
only populated n_subsampled_features entries of the split_infos buffer, but
scanned all n_allowed_features when picking the best split, reading
uninitialized memory whenever max_features < 1.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multicore scalability of the Histogram-based GBDT

1 participant