Skip to content

Commit bcfe344

Browse files
NarineKfacebook-github-bot
authored andcommitted
Add cudnn RNN backward error handling to FAQ (#576)
Summary: Since raised in the issue, #564, adding a solution about it to FAQ. Pull Request resolved: #576 Reviewed By: edward-io Differential Revision: D25725280 Pulled By: NarineK fbshipit-source-id: 376fc3c98f4cc742242842bb2a1e8df1828d7b4d
1 parent efbcaf4 commit bcfe344

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/faq.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ title: FAQ
1111
* [My model inputs or outputs token indices, and when using Captum I see errors relating to gradients, how do I resolve this?](#my-model-inputs-or-outputs-token-indices-and-when-using-captum-i-see-errors-relating-to-gradients-how-do-i-resolve-this)
1212
* [Can my model using functional non-linearities (E.g. nn.functional.ReLU) or reused modules be used with Captum?](#can-my-model-using-functional-non-linearities-eg-nnfunctionalrelu-or-reused-modules-be-used-with-captum)
1313
* [Do JIT models, DataParallel models, or DistributedDataParallel models work with Captum?](#do-jit-models-dataparallel-models-or-distributeddataparallel-models-work-with-captum)
14-
* [I am working on a new interpretability / attribution method and would like to add it to Captum. How do I proceed?](#i-am-working-on-a-new-interpretability-attribution-method-and-would-like-to-add-it-to-captum-how-do-i-proceed)
14+
* [I am working on a new interpretability or attribution method and would like to add it to Captum. How do I proceed?](#i-am-working-on-a-new-interpretability-or-attribution-method-and-would-like-to-add-it-to-captum-how-do-i-proceed)
15+
* [I am using a gradient-based attribution algorithm such as integrated gradients for a RNN or LSTM network and I see 'cudnn RNN backward can only be called in training mode'. How can I resolve this issue ?](#how-can-I-resolve-cudnn-RNN-backward-error-for-RNN-or-LSTM-network)
1516

1617
### **How do I set the target parameter to an attribution method?**
1718

@@ -60,12 +61,16 @@ Most methods will work fine with functional non-linearities and arbitrary operat
6061

6162
Yes, we have support for all these model types. Note that JIT models do not yet support hooks, so any methods using hooks including layer and neuron attribution methods, DeepLift, Guided Backprop, and Deconvolution are not supported. DataParallel and DistributedDataParallel are supported with all model types.
6263

63-
64-
### **I am working on a new interpretability / attribution method and would like to add it to Captum. How do I proceed?**
64+
### **I am working on a new interpretability or attribution method and would like to add it to Captum. How do I proceed?**
6565

6666
For interpretability methods created by the community, we have two methods of involvement:
6767

6868
1. Awesome List - We maintain a list of interesting external projects that focus on interpretability that may be useful for users looking for functionality beyond what’s available in Captum.
6969
2. Inclusion in Captum - New attribution algorithms that fit the structure of Captum can be considered for contribution to the contrib package of algorithms in Captum. We review proposals for new additions to the contrib package on a case-by-case basis and consider factors such as publication history, quantitative and qualitative evaluation, citations, etc.
7070

7171
We are still working out the logistics of setting these up and will update this with more information once it’s available.
72+
73+
### **How can I resolve cudnn RNN backward error for RNN or LSTM network?**
74+
If your model is set in eval mode you might run into errors, such as `cudnn RNN backward can only be called in training mode`, when you try to perform backward pass on a RNN / LSTM model in a GPU environment.
75+
CuDNN with RNN / LSTM doesn't support gradient computation in eval mode that's why we need to disable cudnn for RNN in eval mode.
76+
To resolve the issue you can set`torch.backends.cudnn.enabled` flag to False - `torch.backends.cudnn.enabled=False`

0 commit comments

Comments
 (0)