[GitHub] eric-haibin-lin commented on a change in pull request #10025: Language model with Google's billion words dataset

2018-03-07 Thread GitBox
eric-haibin-lin commented on a change in pull request #10025: Language model 
with Google's billion words dataset
URL: https://github.com/apache/incubator-mxnet/pull/10025#discussion_r173073715
 
 

 ##
 File path: src/operator/nn/fully_connected.cc
 ##
 @@ -87,8 +90,16 @@ void FullyConnectedComputeExCPU(const nnvm::NodeAttrs& 
attrs,
 return;
   }
   FallBackCompute(FullyConnectedCompute, attrs, ctx, inputs, req, 
outputs);
+#else
+  std::vector in_blobs(inputs.size());
+  for (size_t i = 0; i < in_blobs.size(); i++) in_blobs[i] = inputs[i].data();
+  std::vector out_blobs(outputs.size());
+  for (size_t i = 0; i < out_blobs.size(); i++) out_blobs[i] = 
outputs[i].data();
+  FullyConnectedCompute(attrs, ctx, in_blobs, req, out_blobs);
+#endif
 
 Review comment:
   When USE_MKL=1,
   I wanted to simply use the non-MKL FCForward with 
   ```
   data.data(),
   weight.data(),
   bias.data(),
   ```
   assuming `data.data()` returns a TBlob with normal cpu layout even if data 
is in MKL layout. `weight.data()` and `bias.data()` should always return normal 
cpu layout if weight and bias are `row_sparse`. Please advice. 


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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #10025: Language model with Google's billion words dataset

2018-03-07 Thread GitBox
eric-haibin-lin commented on a change in pull request #10025: Language model 
with Google's billion words dataset
URL: https://github.com/apache/incubator-mxnet/pull/10025#discussion_r173073054
 
 

 ##
 File path: src/operator/nn/fully_connected.cc
 ##
 @@ -87,8 +90,16 @@ void FullyConnectedComputeExCPU(const nnvm::NodeAttrs& 
attrs,
 return;
   }
   FallBackCompute(FullyConnectedCompute, attrs, ctx, inputs, req, 
outputs);
+#else
+  std::vector in_blobs(inputs.size());
+  for (size_t i = 0; i < in_blobs.size(); i++) in_blobs[i] = inputs[i].data();
+  std::vector out_blobs(outputs.size());
+  for (size_t i = 0; i < out_blobs.size(); i++) out_blobs[i] = 
outputs[i].data();
+  FullyConnectedCompute(attrs, ctx, in_blobs, req, out_blobs);
+#endif
 
 Review comment:
   Does MKL support kFComputeFallback dispatch mode? 
   Are you both referring to line 93 - line 99? `FallBackCompute ` is only 
defined when `USE_MKL=1`. Can I still use it?
   What I need to address is the following case for inference:
   - data = dense
   - weight = rowsparse
   - bias = rowsparse
   - output = dense
   But I don't know how to deal with this efficiently with `USE_MKL=1`. 
   


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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #10025: Language model with Google's billion words dataset

2018-03-07 Thread GitBox
eric-haibin-lin commented on a change in pull request #10025: Language model 
with Google's billion words dataset
URL: https://github.com/apache/incubator-mxnet/pull/10025#discussion_r172870624
 
 

 ##
 File path: src/operator/nn/fully_connected.cc
 ##
 @@ -214,9 +238,7 @@ If ``no_bias`` is set to be true, then the ``bias`` term 
is ignored.
 .set_attr("FInferShape", FullyConnectedShape)
 .set_attr("FInferType", FullyConnectedType)
 .set_attr("FCompute", FullyConnectedCompute)
-#if MXNET_USE_MKLDNN == 1
 
 Review comment:
   This is for adding sparse support for FC. See line 213.


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


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #10025: Language model with Google's billion words dataset

2018-03-07 Thread GitBox
eric-haibin-lin commented on a change in pull request #10025: Language model 
with Google's billion words dataset
URL: https://github.com/apache/incubator-mxnet/pull/10025#discussion_r172870497
 
 

 ##
 File path: src/operator/nn/fully_connected.cc
 ##
 @@ -87,8 +90,16 @@ void FullyConnectedComputeExCPU(const nnvm::NodeAttrs& 
attrs,
 return;
   }
   FallBackCompute(FullyConnectedCompute, attrs, ctx, inputs, req, 
outputs);
+#else
+  std::vector in_blobs(inputs.size());
+  for (size_t i = 0; i < in_blobs.size(); i++) in_blobs[i] = inputs[i].data();
+  std::vector out_blobs(outputs.size());
+  for (size_t i = 0; i < out_blobs.size(); i++) out_blobs[i] = 
outputs[i].data();
+  FullyConnectedCompute(attrs, ctx, in_blobs, req, out_blobs);
+#endif
 
 Review comment:
   This block will only be executed when MKL is absent


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


With regards,
Apache Git Services