Skip to content

Unify DART SHAP forwarding#12073

Merged
RAMitchell merged 2 commits into
dmlc:masterfrom
RAMitchell:partial-unify-dart-shap
Mar 12, 2026
Merged

Unify DART SHAP forwarding#12073
RAMitchell merged 2 commits into
dmlc:masterfrom
RAMitchell:partial-unify-dart-shap

Conversation

@RAMitchell

Copy link
Copy Markdown
Member

This PR is another small step toward the follow-up work to remove GBDart as a separate booster and treat DART as weighted GBTree prediction/training behavior. It removes the DART-specific SHAP forwarding overrides and routes contribution and interaction prediction through the shared GBTree path, with DART supplying tree weights through a shared accessor. The scope here is intentionally limited to SHAP forwarding; serialization, training behavior, and booster identity are unchanged. This is groundwork for the larger PR that removes GBDart.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is groundwork toward treating DART as a weighted GBTree by removing DART-specific SHAP forwarding overrides and routing SHAP contribution/interaction prediction through the shared GBTree path, with DART supplying per-tree weights via a shared accessor.

Changes:

  • Add a GBTree::TreeWeights() virtual accessor and pass it into predictor contribution/interaction APIs.
  • Remove DART overrides for SHAP forwarding and instead provide DART weights via TreeWeights().
  • Add CPU/GPU tests that exercise SHAP contributions/interactions for a DART-trained model.

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
tests/cpp/predictor/test_shap.h Exposes CheckDartShapOutput helper for both CPU and GPU test TUs.
tests/cpp/predictor/test_shap.cc Implements CheckDartShapOutput and adds a CPU unit test for DART SHAP additivity.
tests/cpp/predictor/test_shap.cu Adds a GPU unit test for DART SHAP additivity.
src/gbm/gbtree.h Routes SHAP contribution/interaction prediction through shared path and passes TreeWeights().
src/gbm/gbtree.cc Removes DART SHAP forwarding overrides; supplies DART weights through TreeWeights().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/gbm/gbtree.h
Comment thread tests/cpp/predictor/test_shap.cu
@RAMitchell RAMitchell merged commit 8d34f1c into dmlc:master Mar 12, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants