TaoLv commented on a change in pull request #14713: MKLDNN RNN Inference
Integration(fp32 LSTM and vRNN with tanh and relu)
URL: https://github.com/apache/incubator-mxnet/pull/14713#discussion_r286967877
##########
File path: src/operator/rnn-inl.h
##########
@@ -880,23 +902,78 @@ class RNNOp {
param_.p,
param_.mode);
} else {
- RNNForwardInference<DType>(work_cpu_space,
- param_.state_outputs,
- param_.num_layers,
- direction,
- param_.seq_length_,
- param_.batch_size_,
- param_.input_size_,
- param_.state_size,
- x.dptr_,
- hx.dptr_,
- cx_ptr,
- w.dptr_,
- b_ptr,
- y.dptr_,
- hy_ptr,
- cy_ptr,
- param_.mode);
+ #if MXNET_USE_MKLDNN == 1 && !defined(__CUDACC__)
+ if (dmlc::GetEnv("MXNET_USE_MKLDNN_RNN", 1) && param_.mode !=
rnn_enum::kGru) {
Review comment:
@szha Please review. We add a environmental variable here. Once it's set to
0, RNN operator will fall back to the original version on CPU. Otherwise,
MKL-DNN RNN primitive will be invoked.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services