Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU support for gradient analyzers #144

Merged
merged 2 commits into from
Sep 15, 2023
Merged

GPU support for gradient analyzers #144

merged 2 commits into from
Sep 15, 2023

Conversation

adrhill
Copy link
Member

@adrhill adrhill commented Sep 15, 2023

Instead of computing the gradient of the input w.r.t. an indexed model output, this PR computes a vector-jacobian-product w.r.t. to the full model output, selecting the vector v such that it masks the model model outputs.

Besides working well with CUDA.jl, this avoids a second forward-pass through the model and greatly simplifies the code by removing the distinction between gradient_wrt_input and gradient_wrt_batch.

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.24% 🎉

Comparison is base (3aa10ba) 94.92% compared to head (dead62e) 95.16%.
Report is 5 commits behind head on master.

❗ Current head dead62e differs from pull request most recent head 9c3fe0b. Consider uploading reports for the commit 9c3fe0b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   94.92%   95.16%   +0.24%     
==========================================
  Files          18       19       +1     
  Lines         689      683       -6     
==========================================
- Hits          654      650       -4     
+ Misses         35       33       -2     
Files Changed Coverage Δ
src/ExplainableAI.jl 100.00% <ø> (ø)
src/lrp/rules.jl 94.16% <ø> (+0.96%) ⬆️
ext/TullioLRPRulesExt.jl 100.00% <100.00%> (ø)
src/gradient.jl 100.00% <100.00%> (ø)
src/lrp/canonize.jl 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adrhill adrhill merged commit d9ea6eb into master Sep 15, 2023
5 checks passed
@adrhill adrhill deleted the ah/grad-gpu branch September 15, 2023 13:24
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.

None yet

1 participant