Move DART state into GBTree#12078
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves DART (Dropout Additive Regression Trees) runtime state and training-time dropout behavior from the separate Dart class into the base GBTree class. This allows dropout to be enabled directly through parameters like rate_drop when using booster=gbtree, without requiring booster=dart. The Dart class is retained as a thin compatibility wrapper for existing serialized models/configs.
Changes:
- Moved
weight_drop_,idx_drop_,dparam_,DropTrees(),NormalizeTrees(), and dropout-aware prediction logic fromDartintoGBTree. - Simplified
Dartto a thin wrapper that only overrides serialization methods (SaveModel,LoadModel,SaveConfig,LoadConfig) andCommitModelfor backward compatibility with the"dart"JSON format. - Updated documentation (
parameter.rst,dart.rst) and tests to reflect that dropout is now a feature ofgbtreerather than a separate booster.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/gbm/gbtree.h |
Added dparam_, weight_drop_, idx_drop_ members and DropTrees/NormalizeTrees declarations to GBTree; made TreeWeights non-virtual. |
src/gbm/gbtree.cc |
Moved dropout logic (DropTrees, NormalizeTrees, weight tracking in CommitModel, PredictBatch, InplacePredict, Slice, serialization) into GBTree; stripped Dart down to a compatibility wrapper. |
tests/cpp/gbm/test_gbtree.cc |
Added GBTree_DropoutJsonIO test verifying gbtree with rate_drop saves/loads correctly. |
doc/parameter.rst |
Renamed DART section to "Additional dropout parameters for tree boosters" and removed DART-specific predict note. |
doc/tutorials/dart.rst |
Updated tutorial to describe dropout as a mode of gbtree rather than a separate booster. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
trivialfis
approved these changes
Mar 12, 2026
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.
This PR is the next step toward removing
GBDartas a separate booster. It moves the DART runtime state and training-time dropout behavior intoGBTree, so dropout can be enabled directly through parameters likerate_dropwithout requiringbooster=dart. The legacyDartclass remains as a thin compatibility wrapper for the existing booster name and serialized model/config shape. A follow-up PR will load old DART models/configs directly into unifiedGBTreestate and remove the separateDartclass.