eric-haibin-lin commented on a change in pull request #13896: Cudnn dropout
URL: https://github.com/apache/incubator-mxnet/pull/13896#discussion_r251248652
 
 

 ##########
 File path: src/operator/nn/dropout-inl.h
 ##########
 @@ -289,26 +282,22 @@ class DropoutOp {
 
       // perform dropout with cudnn
       CUDNN_CALL(cudnnDropoutGetReserveSpaceSize(x_desc_, 
&dropout_reserve_byte_));
-      if (init_cudnn_ && dropout_reserve_byte_ > reserve_space_.size) {
-        Storage::Get()->Free(reserve_space_);
-        init_cudnn_ = false;
-      }
-      if (!init_cudnn_) {
-        reserve_space_ = Storage::Get()->Alloc(dropout_reserve_byte_, 
Context::GPU(s->dev_id));
-        init_cudnn_ = true;
-      }
+      // cudnn uses bits to record the positions that are dropped, so reserve 
bytes is always
+      // 1/8 of input size.
+      CHECK_GE(mask.Size() * sizeof(DType), dropout_reserve_byte_);
 
 Review comment:
   need better err msg

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to