Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit f71695d

Browse files
Aapo Kyrolafacebook-github-bot
authored andcommitted
fix CuDNN RecurrentOp Gradient init
Summary: CuDNN RecurrentNet GradientOp did not pass the DROPOUT information to the initializer, causing incorrect scratch space size to be estimated. We have an assertion encorcing that scratch space is same for forward and backward ops, so this failed an assertion. We currently hard-code dropout to be 1.0, so this has had no effect on correctness in our tests. For some reason with num_layers=1 there wasn't an issue, but with num_layers>=2, the scratch space size was different. Reviewed By: salexspb Differential Revision: D4904715 fbshipit-source-id: 780266c5ecf1f7a32387edcb6fc498a13ac782ac
1 parent f6bbde0 commit f71695d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

caffe2/operators/recurrent_op_cudnn.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ template <typename T>
295295
bool RecurrentGradientOp<T>::RunOnDevice() {
296296
const int seqLength = Input(INPUT).dim32(0);
297297
if (Input(INPUT).dims() != cachedInputDims_) {
298-
initialize(Input(INPUT));
298+
initialize(Input(INPUT), Output(DROPOUT_STATES));
299299
cachedInputDims_ = Input(INPUT).dims();
300300
}
301301
CUDNN_ENFORCE(cudnnGetRNNTrainingReserveSize(

0 commit comments

Comments
 (0)