Add optimize() method for automatic layout and chunk_size tuning#30
Merged
rapids-bot[bot] merged 7 commits intorapidsai:mainfrom Jan 15, 2026
Merged
Add optimize() method for automatic layout and chunk_size tuning#30rapids-bot[bot] merged 7 commits intorapidsai:mainfrom
optimize() method for automatic layout and chunk_size tuning#30rapids-bot[bot] merged 7 commits intorapidsai:mainfrom
Conversation
Contributor
|
/ok to test 9ec0856 |
hcho3
approved these changes
Jan 15, 2026
Contributor
|
/merge |
csadorf
reviewed
Jan 15, 2026
Contributor
csadorf
left a comment
There was a problem hiding this comment.
Post-merge review; I have one high-level concern.
Comment on lines
318
to
319
Contributor
There was a problem hiding this comment.
I think we should revise the model where we optimize an instance "in-place" that necessitates some of the complexity here for "reloading" a model. We should instead consider whether we simply produce a new "optimized" instance.
Member
Author
There was a problem hiding this comment.
Good point. The in-place mutation with hidden model reload on layout change is surprising behavior. I ca revise to have optimize() return a new instance with optimal settings instead:
fm_opt = fm.optimize(data=X)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR ports the
optimize()method from cuML FIL to cuforest, enabling automatic tuning oflayoutandchunk_sizeparameters for optimal inference performance.Changes
layoutafter construction, triggering automatic model reloadoptimize()method: Searches over layout (depth_first,breadth_first,layered) and chunk_size (powers of 2) combinations to find optimal configuration for a given batch sizedefault_chunk_size: Allows setting the default chunk size used when none is specified in predict callsFiles Modified
detail/forest_inference.pyxlayoutsetter with_reload_model()_forest_inference.pyOptimizeMixinclass withoptimize()method_base.pyoptimize(),layoutsetter,default_chunk_sizetests/test_optimize.pyUsage