Skip to content

QuadratureTreeSHAP GPU: Parallelize the final step of SHAP interaction values - #12654

Merged
RAMitchell merged 2 commits into
dmlc:masterfrom
ron-wettenstein:feature/qts-gpu-parallel-interaction-finalization
Oct 6, 2026
Merged

RAMitchell merged 2 commits into
dmlc:masterfrom
ron-wettenstein:feature/qts-gpu-parallel-interaction-finalization

Conversation

@ron-wettenstein

Copy link
Copy Markdown
Contributor

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).

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>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d22e7ff-8f7b-48fd-97aa-6bc0b605b88c
📥 Commits

Reviewing files that changed from the base of the PR and between 866ac93 and 6ffc448.

📒 Files selected for processing (1)
  • src/predictor/interpretability/shap.cu
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/predictor/interpretability/shap.cu

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

ShapInteractionValues now symmetrizes interaction matrix entries in a separate pass. A second pass adjusts each diagonal using off-diagonal column entries. The bias-column diagonal receives the group root mean and base margin or score.

Suggested reviewers: ramitchell

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 6ffc4

No actionable issue remains identified in the interaction-value finalization change. It is mergeable after normal checks.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RAMitchell
RAMitchell merged commit d3fbc50 into dmlc:master Oct 6, 2026
84 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