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

Commit

Permalink
fix CuDNN RecurrentOp Gradient init
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Aapo Kyrola authored and facebook-github-bot committed Apr 18, 2017
1 parent f6bbde0 commit f71695d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caffe2/operators/recurrent_op_cudnn.cc
Expand Up @@ -295,7 +295,7 @@ template <typename T>
bool RecurrentGradientOp<T>::RunOnDevice() {
const int seqLength = Input(INPUT).dim32(0);
if (Input(INPUT).dims() != cachedInputDims_) {
initialize(Input(INPUT));
initialize(Input(INPUT), Output(DROPOUT_STATES));
cachedInputDims_ = Input(INPUT).dims();
}
CUDNN_ENFORCE(cudnnGetRNNTrainingReserveSize(
Expand Down

0 comments on commit f71695d

Please sign in to comment.