[WIP] Add CPU QuadratureSHAP prototype alongside TreeSHAP#12106
Draft
RAMitchell wants to merge 10 commits intodmlc:masterfrom
Draft
[WIP] Add CPU QuadratureSHAP prototype alongside TreeSHAP#12106RAMitchell wants to merge 10 commits intodmlc:masterfrom
RAMitchell wants to merge 10 commits intodmlc:masterfrom
Conversation
c73c829 to
0888129
Compare
Member
Author
|
Added a reproducible QuadratureSHAP benchmark harness in The main result is that the observed speedup depends much more on tree size than on whether the data is “real” or “synthetic”. For small trees, TreeSHAP is often competitive or faster. For medium trees, QuadratureSHAP is typically around
Two practical takeaways from this:
|
Member
|
Is there a reference for the algorithm you are working on? |
Member
Author
|
There are no public materials yet this is still very much in flight. |
4 tasks
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.
Summary
This draft PR introduces a new CPU SHAP algorithm,
quadratureshap, alongside the existing CPU TreeSHAP implementation.The intent of this change is to make it possible to evaluate the new algorithm side by side with the current baseline, focusing on:
What this adds
shap_algorithm=treeshapshap_algorithm=quadratureshapsrc/predictor/interpretability/Current status
This PR is intentionally draft.
At this stage, the goal is not to replace TreeSHAP, but to introduce QuadratureSHAP in a form that can be reviewed and benchmarked against the existing implementation.
The current CPU implementation uses an endpoint-adapted quadrature rule with 16 points.
Preliminary results
On a local CPU benchmark with:
tree_method=histmax_depth=8Measured means:
2.107s0.805sThis is about a
2.62xspeedup relative to TreeSHAP on that workload.For the same run, the output remained very close to TreeSHAP:
7.45e-082.50e-094.77e-07These results are preliminary and intended to support further evaluation.
Testing
/home/nfs/rorym/anaconda3/bin/conda run -n xgboost ./build-cpu-v8/testxgboost --gtest_filter='Predictor.QuadratureShapPrototypeMatchesTreeShapCPU:Predictor.QuadratureShapSelectorMatchesTreeShapCPU:Predictor.ShapOutputCasesCPU'Review focus
Feedback is especially useful on: