[GitHub] [incubator-mxnet] TaoLv commented on a change in pull request #17702: Support projection feature for LSTM on CPU (Only Inference)

2020-02-29 Thread GitBox
TaoLv commented on a change in pull request #17702: Support projection feature 
for LSTM on CPU (Only Inference)
URL: https://github.com/apache/incubator-mxnet/pull/17702#discussion_r386026804
 
 

 ##
 File path: src/operator/rnn.cc
 ##
 @@ -385,7 +399,9 @@ The definition of GRU here is slightly different from 
paper but compatible with
 })
 .set_attr("FInferShape", RNNShape)
 .set_attr("FInferType", RNNType)
+#if MXNET_USE_MKLDNN == 1
 
 Review comment:
   Let's merge this check with the one at L407.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] TaoLv commented on a change in pull request #17702: Support projection feature for LSTM on CPU (Only Inference)

2020-02-29 Thread GitBox
TaoLv commented on a change in pull request #17702: Support projection feature 
for LSTM on CPU (Only Inference)
URL: https://github.com/apache/incubator-mxnet/pull/17702#discussion_r386027073
 
 

 ##
 File path: src/operator/rnn_impl.h
 ##
 @@ -219,7 +220,10 @@ void LstmForwardInferenceSingleLayer(DType* ws,
  DType* cy_ptr) {
   using namespace mshadow;
   const Tensor wx(w_ptr, Shape2(H * 4, I));
-  const Tensor wh(w_ptr + I * H * 4, Shape2(H * 4, H));
+  const Tensor wh(w_ptr + I * H * 4, Shape2(H * 4, (P ? P : 
H)));
+  Tensor whr(w_ptr, Shape2(1, 1));
+  if (P > 0)
+whr = Tensor(wh.dptr_ + P * 4 * H, Shape2(P, H));
 
 Review comment:
   Let's put this into the same line of `if (P > 0)` or add `{. .. }` for it, 
like what you're doing at L236.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] TaoLv commented on a change in pull request #17702: Support projection feature for LSTM on CPU (Only Inference)

2020-02-29 Thread GitBox
TaoLv commented on a change in pull request #17702: Support projection feature 
for LSTM on CPU (Only Inference)
URL: https://github.com/apache/incubator-mxnet/pull/17702#discussion_r386026951
 
 

 ##
 File path: src/operator/rnn.cc
 ##
 @@ -427,7 +443,9 @@ NNVM_REGISTER_OP(_backward_RNN)
 .set_attr_parser(ParamParser)
 .set_attr("TIsLayerOpBackward", true)
 .set_attr("TIsBackward", true)
+#if MXNET_USE_MKLDNN == 1
 
 Review comment:
   Same here, merge this check with the one at L450.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] TaoLv commented on a change in pull request #17702: Support projection feature for LSTM on CPU (Only Inference)

2020-02-29 Thread GitBox
TaoLv commented on a change in pull request #17702: Support projection feature 
for LSTM on CPU (Only Inference)
URL: https://github.com/apache/incubator-mxnet/pull/17702#discussion_r386026898
 
 

 ##
 File path: src/operator/rnn.cc
 ##
 @@ -385,7 +399,9 @@ The definition of GRU here is slightly different from 
paper but compatible with
 })
 .set_attr("FInferShape", RNNShape)
 .set_attr("FInferType", RNNType)
+#if MXNET_USE_MKLDNN == 1
 
 Review comment:
   Make sure you know that, if MKL-DNN is not used, FInferStorageType will not 
be registered.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services