Repository: pytorch
Issue: PyTorch build with Ideep support?
Labels: module: build,triaged,module: mkldnn

I met the following **ERROR** messages... Any suggestions?

```console
....../pytorch/pytorch/aten/src/ATen/native/mkldnn/Conv.cpp:103:34:   required from here
/usr/local/include/ideep/tensor.hpp:623:56: error: no matching function for call to ‘at::native::AllocForMKLDNN::malloc<ideep::convolution_forward>(size_t)’
     buffer_.reset(alloc::template malloc<computation_t>(
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         adesc.get_size()), alloc::template free<computation_t>);
         ~~~~~~~~~~~~~~~~~                               
caffe2/CMakeFiles/torch_cpu.dir/build.make:2750: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/BinaryOps.cpp.o' failed
make[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/BinaryOps.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
caffe2/CMakeFiles/torch_cpu.dir/build.make:2763: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Conv.cpp.o' failed
make[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Conv.cpp.o] Error 1
In file included from /usr/local/include/ideep.hpp:43:0,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/MKLDNNCommon.h:7,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/MKLDNNConversions.cpp:4:
/usr/local/include/ideep/tensor.hpp: In instantiation of ‘void ideep::param::init(const ideep::param::descriptor&) [with alloc = at::native::AllocForMKLDNN; computation_t = ideep::computation]’:
....../pytorch/pytorch/aten/src/ATen/native/mkldnn/MKLDNNConversions.cpp:71:35:   required from here
/usr/local/include/ideep/tensor.hpp:623:56: error: no matching function for call to ‘at::native::AllocForMKLDNN::malloc<ideep::computation>(size_t)’
     buffer_.reset(alloc::template malloc<computation_t>(
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         adesc.get_size()), alloc::template free<computation_t>);
         ~~~~~~~~~~~~~~~~~                               
In file included from /usr/local/include/ideep.hpp:43:0,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/MKLDNNCommon.h:7,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/Normalization.cpp:28:
/usr/local/include/ideep/tensor.hpp: In instantiation of ‘void ideep::param::init(const ideep::param::descriptor&) [with alloc = at::native::AllocForMKLDNN; computation_t = ideep::batch_normalization_forward_inference]’:
/usr/local/include/ideep/computations.hpp:4741:7:   required from ‘static void ideep::batch_normalization_forward_inference::compute(ideep::key_t&, const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, ideep::tensor&, float) [with alloc = at::native::AllocForMKLDNN; bool web_opt = false; ideep::key_t = std::__cxx11::basic_string<char>]’
/usr/local/include/ideep/computations.hpp:4793:28:   required from ‘static void ideep::batch_normalization_forward_inference::compute(const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, const ideep::tensor&, ideep::tensor&, float) [with alloc = at::native::AllocForMKLDNN; bool web_opt = false]’
....../pytorch/pytorch/aten/src/ATen/native/mkldnn/Normalization.cpp:66:30:   required from here
/usr/local/include/ideep/tensor.hpp:623:56: error: no matching function for call to ‘at::native::AllocForMKLDNN::malloc<ideep::batch_normalization_forward_inference>(size_t)’
     buffer_.reset(alloc::template malloc<computation_t>(
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         adesc.get_size()), alloc::template free<computation_t>);
         ~~~~~~~~~~~~~~~~~                               
caffe2/CMakeFiles/torch_cpu.dir/build.make:2815: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/MKLDNNConversions.cpp.o' failed
make[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/MKLDNNConversions.cpp.o] Error 1
caffe2/CMakeFiles/torch_cpu.dir/build.make:2841: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Normalization.cpp.o' failed
make[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Normalization.cpp.o] Error 1
In file included from /usr/local/include/ideep.hpp:43:0,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/MKLDNNCommon.h:7,
                 from ....../pytorch/pytorch/aten/src/ATen/native/mkldnn/Pooling.cpp:64:
/usr/local/include/ideep/tensor.hpp: In instantiation of ‘void ideep::param::init(const ideep::param::descriptor&) [with alloc = at::native::AllocForMKLDNN; computation_t = ideep::pooling_forward]’:
/usr/local/include/ideep/tensor.hpp:667:33:   required from ‘void ideep::param::reinit(const ideep::param::descriptor&) [with alloc = at::native::AllocForMKLDNN; computation_t = ideep::pooling_forward]’
/usr/local/include/ideep/computations.hpp:3815:7:   required from ‘static void ideep::pooling_forward::compute(ideep::key_t&, const ideep::tensor&, const dims&, ideep::tensor&, const dims&, const dims&, const dims&, const dims&, ideep::algorithm, ideep::prop_kind, ideep::padding_kind) [with alloc = at::native::AllocForMKLDNN; bool web_opt = false; ideep::key_t = std::__cxx11::basic_string<char>; ideep::param::dims = std::vector<int, std::allocator<int> >; ideep::algorithm = mkldnn::algorithm; ideep::prop_kind = mkldnn::prop_kind; ideep::padding_kind = mkldnn::padding_kind]’
/usr/local/include/ideep/computations.hpp:3843:28:   required from ‘static void ideep::pooling_forward::compute(const ideep::tensor&, const dims&, ideep::tensor&, const dims&, const dims&, const dims&, const dims&, ideep::algorithm, ideep::prop_kind, ideep::padding_kind) [with alloc = at::native::AllocForMKLDNN; bool web_opt = false; ideep::param::dims = std::vector<int, std::allocator<int> >; ideep::algorithm = mkldnn::algorithm; ideep::prop_kind = mkldnn::prop_kind; ideep::padding_kind = mkldnn::padding_kind]’
....../pytorch/pytorch/aten/src/ATen/native/mkldnn/Pooling.cpp:142:32:   required from here
/usr/local/include/ideep/tensor.hpp:623:56: error: no matching function for call to ‘at::native::AllocForMKLDNN::malloc<ideep::pooling_forward>(size_t)’
     buffer_.reset(alloc::template malloc<computation_t>(
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         adesc.get_size()), alloc::template free<computation_t>);
         ~~~~~~~~~~~~~~~~~                               
caffe2/CMakeFiles/torch_cpu.dir/build.make:2854: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Pooling.cpp.o' failed
make[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Pooling.cpp.o] Error 1
make[2]: Leaving directory '....../pytorch/pytorch/build_18.04'
CMakeFiles/Makefile2:3986: recipe for target 'caffe2/CMakeFiles/torch_cpu.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/torch_cpu.dir/all] Error 2
make[1]: Leaving directory '....../pytorch/pytorch/build_18.04'
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

```


Cheers
Pei

cc @gujinghui @PenghuiCheng @XiaobingSuper @jianyuh