Skip to content

[WIP] PRF Mitigation heuristic for poor HGB scalability - #34788

Draft
cakedev0 wants to merge 43 commits into
scikit-learn:mainfrom
cakedev0:hgb/both_threads_optim
Draft

[WIP] PRF Mitigation heuristic for poor HGB scalability#34788
cakedev0 wants to merge 43 commits into
scikit-learn:mainfrom
cakedev0:hgb/both_threads_optim

Conversation

@cakedev0

Copy link
Copy Markdown
Contributor

WIP: still being benchmarked/calibrated/refined

Reference Issues/PRs

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

Closes #30662

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 will (I hope) show HGB does continue to scale until 16-32 threads for many medium/big datasets with this PR. I personally would consider that good enough ^^

What does this implement/fix? Explain your changes.

  • "use_threads_if" heuristic: TODO
    • Note: I initially tried dynamic sizing of the thread pool but it is catastrophic: OMP apparently recreates a thread pool each time it's resized.
  • Limitation of the initial thread pool size: in some cases (small datasets, small number of features), we know from the start a big number of threads will not help any parallel region. So we down size it to make sure
  • Cached calibration of how much overhead a prange represents for a given number of threads.

AI usage disclosure

I used AI assistance for:

  • Code generation: closely guided
  • Test/benchmark generation
  • Documentation (comments)
  • Research and understanding: a lot

Any other comments?

Benchmarks on the way.

cakedev0 and others added 29 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 <noreply@anthropic.com>
@github-actions github-actions Bot added module:ensemble module:utils CI:Linter failure The linter CI is failing on this PR labels Aug 21, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant