Repository navigation
QuadratureTreeSHAP GPU: Parallelize the final step of SHAP interaction values - #12654
Conversation
After the tree walk, each interaction matrix is made symmetric and its diagonal is computed. Run this as two passes over the GPU, one thread per entry and then one thread per column, instead of one thread per matrix. The results are bit-for-bit the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable issue remains identified in the interaction-value finalization change. It is mergeable after normal checks.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR is split out of #12652 . See that PR for more details, including benchmark results against master for this change and the three related ones.
This PR include contribution 2 of #12652 :
Parallelize the final step of interaction values.
After the tree walk, each interaction matrix is made symmetric (the (i, j) and (j, i) entries are
averaged) and its diagonal (each feature's interaction with itself) is computed. This used to run
with a single GPU thread per matrix. It now runs as two passes: one thread per entry to make the matrix symmetric, then one thread per column to compute its diagonal. The results are bit-for-bit the same. The gain is largest for models with many features: with 1000 features, interaction values are 3.4× faster in batch and about 60× faster for a single row.
This improvement speedup is evident in the SHAP interaction values of the bioresponse datasets, which include 1776 features and have a 6.18× speedup across all 4 improvements. See #12652 (comment).