rongzha1 commented on a change in pull request #19749:
URL: https://github.com/apache/incubator-mxnet/pull/19749#discussion_r559634622
##########
File path: src/operator/tensor/amp_cast.cc
##########
@@ -41,25 +41,29 @@ static void AMPCastExCPU(const nnvm::NodeAttrs& attrs,
if (req[0] == kWriteInplace) {
return;
}
- mkldnn::engine cpu_engine = mxnet::CpuEngine::Get()->get_engine();
auto data = inputs[0];
- if (data.IsView() && data.IsMKLDNNData())
- data = data.Reorder2Default();
- const auto i_mem = data.GetMKLDNNData();
- const size_t i_ndim = data.shape().ndim();
- mkldnn::memory::dims i_dims = mkldnn::memory::dims(i_ndim);
- for (size_t i = 0; i < i_ndim; i++) {
- i_dims[i] = static_cast<int>(data.shape()[i]);
+ if (data.dtype() != mshadow::kFloat16) {
Review comment:
shall we add isValidMKLDNNDataType() to check whether it is supported by
mkldnn? mshadow has so many data types and some of them are not supported.
https://github.com/apache/incubator-mxnet/blob/64f737cdd59fe88d2c5b479f25d011c5156b6a8a/3rdparty/mshadow/mshadow/base.h#L364:3
----------------------------------------------------------------
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]