You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/14 21:09:52 UTC

[GitHub] zheng-da commented on a change in pull request #10116: [MXNET-105][WIP] Fix CuDNN performance after code refactor

zheng-da commented on a change in pull request #10116: [MXNET-105][WIP] Fix CuDNN performance after code refactor
URL: https://github.com/apache/incubator-mxnet/pull/10116#discussion_r174611191
 
 

 ##########
 File path: src/operator/nn/batch_norm.cu
 ##########
 @@ -690,12 +690,16 @@ void BatchNormGradCompute<gpu>(const nnvm::NodeAttrs& attrs,
                                const OpContext& ctx, const std::vector<TBlob>& inputs,
                                const std::vector<OpReqType>& req,
                                const std::vector<TBlob>& outputs) {
-  CHECK_EQ(inputs.size(), 11U);
+  CHECK_EQ(inputs.size(), 5U);
   BatchNormParam param = nnvm::get<BatchNormParam>(attrs.parsed);
   std::vector<TBlob> out_grad(1, inputs[0]);
-  std::vector<TBlob> in_data(inputs.begin() + 3, inputs.begin() + 6);
-  std::vector<TBlob> aux_states(inputs.begin() + 6, inputs.begin() + 8);
-  std::vector<TBlob> out_data(inputs.begin() + 8, inputs.end());
+  std::vector<TBlob> out_data(3);
+  out_data[batchnorm::kMean] = inputs[1];
+  out_data[batchnorm::kVar] = inputs[2];
+  std::vector<TBlob> in_data(3);
+  in_data[batchnorm::kData] = inputs[3];
+  in_data[batchnorm::kGamma] = inputs[4];
+  std::vector<TBlob> aux_states(2);
 
 Review comment:
   CuDNN version doesn't need aux_states. CUDA version does. So aux_states is set properly to run CUDA code.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services