-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[mkldnn-v1.0] Add MKL-DNN Convolution #16141
Conversation
@@ -20,18 +20,18 @@ | |||
/*! | |||
* \file mkldnn_convolution-inl.h | |||
* \brief | |||
*/ | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the change.
#include "./mkldnn_base-inl.h" | ||
#include "./mkldnn_ops-inl.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change the order?
@TaoLv @ciyongch @ZhennanQin please help to review :) |
if (in.IsView() && in.IsMKLDNNData()) { | ||
ret.push_back(in.Reorder2Default()); | ||
} else { | ||
ret.push_back(in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return inputs
here to avoid overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls let author @ZhennanQin help to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
std::shared_ptr<mkldnn::convolution_backward_data> bwd_data_; | ||
std::shared_ptr<mkldnn::convolution_backward_weights> bwd_weight_; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use weight
or weights
consistently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we all use weight or weights ? @ZhennanQin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a difference between mkldnn and mxnet. mxnet prefer to use weight
while mkldnn prefer weights
. So I don't know which should be the boundary of mkldnn and mxnet. @rongzha1 You can make the decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's all use weight as mkldnn_fully_connect.cc did. So change bwd_weights_pd_ to bwd_weight_pd_
@@ -57,7 +58,7 @@ mkldnn::convolution_forward::primitive_desc GetConvFwdImpl(const MKLDNNConvFullP | |||
auto bias_md = | |||
bias ? (param.mkldnn_param.quantized ? GetMemDesc(*bias, mshadow::kInt32) : GetMemDesc(*bias)) | |||
: mkldnn::memory::desc{ | |||
{}, mkldnn::memory::data_type::data_undef, mkldnn::memory::format::any}; | |||
{}, mkldnn::memory::data_type::undef, mkldnn::memory::format_tag::any}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -126,13 +127,12 @@ mkldnn::convolution_forward::primitive_desc GetConvFwdImpl(const MKLDNNConvFullP | |||
|
|||
if (param.conv_param.dilate.ndim() == 0 && bias_md_ptr == nullptr) { | |||
mkldnn::convolution_forward::desc desc(prop, mkldnn::algorithm::convolution_direct, data_md, | |||
weight_md, out_md, strides, padding, padding, | |||
mkldnn::padding_kind::zero); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is padding_kind
disabled or zero
becomes default option from MKL-DNN v1.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkldnn_padding_kind_t Not used anymore
https://intel.github.io/mkl-dnn/dev_guide_transition_to_v1.html
@@ -59,15 +59,15 @@ inline bool SetupDefaultBlobsIn(const std::vector<NDArray>& src, | |||
for (size_t i = 0; i < src.size(); i++) { | |||
auto& nd = src[i]; | |||
bool is_default = nd.storage_type() == kDefaultStorage; | |||
#if MXNET_USE_MKLDNN == 1 | |||
#if MXNET_USE_MKLDNN == 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we upgrade mkldnn to version 1.1, shall we have to change this to something like 110? I prefer not encoding the version into this macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Here we simply use 100 and 1 to distinguish the code for MKL-DNN v0.x and v1.x so we don't need to remove v0.x integration code and hence convenient to review. When merging this branch back to master, we will change all MXNET_USE_MKLDNN == 100
back to MXNET_USE_MKLDNN == 1
.
hash = hash * 2 + desc.data.data_type; | ||
eles.push_back(desc.data.data_type); | ||
for (int i = 0; i < desc.data.ndims; i++) { | ||
hash = hash * 2 + desc.data.dims[i]; | ||
eles.push_back(desc.data.dims[i]); | ||
} | ||
switch (desc.data.format_kind) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hashing mkldnn memory is more heavy than before, so shall we cache the hash result somewhere to reduce the hash overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems need extra for ( loop: desc.data.ndims) && for(loop: desc.data.format_desc.blocking.inner_nblks), I will do some profile to decide whether hash rslt needs cached
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Ideally, we can save the hash result into MKLDNNMemory, only computing it when hash result doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in tests/python/train/test_conv.py
fwd cache cost: 2.603
total fwd cost: 505.974
bwd cache cost: 1.798
total bwd cost: 720.74
So maybe not that necessary to optimize this code ?
@ZhennanQin @ciyongch @TaoLv are all concerns resolved? Please help take a review again or approve the PR? |
@@ -60,8 +60,12 @@ static void ConvolutionComputeExCPU(const nnvm::NodeAttrs& attrs, | |||
const ConvolutionParam& params = nnvm::get<ConvolutionParam>(attrs.parsed); | |||
if (SupportMKLDNNConv(params, inputs[0])) { | |||
MKLDNN_OPCHECK_INIT(false, outputs.size(), inputs, outputs); | |||
const auto mkldnn_inputs = GetMKLDNNInputArray(inputs); | |||
MKLDNNConvolutionForward(attrs, ctx, mkldnn_inputs, req, outputs); | |||
if (CheckMKLDNNInputArrayIsView(inputs)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make line 63 - 67 into a helper function, like
MKLDNNRun(MKLDNNConvolutionForward, attrs, ctx, inputs, req, outputs);
Then we can use this for all operators.
macro also works here, just like MKLDNN_OPCHECK_RUN
. Depends on your preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
merging now. |
* [mkldnn-v1.0] Initiate the transition to MKL-DNN v1.0 (#15706) * update mkldnn to 1.0.1 release * change makefile * change cmake * update ci build and pip package build * fix typo in mkldnn.mk * fix build for USE_BLAS=mkl & bump MKL version * skip mkldnn unit tests * remove iomp5 from mx_mkldnn_lib * ci: skip test_mkldnn_install * retrigger ci * retrigger ci * retrigger ci * [mkldnn-v1.0] Update MKL-DNN to v1.0.2 (#16012) * bump mkldnn to v1.0.2 * skip quantization unit test * add useless build flag * Fixes openblas installation for static build * empty commit * [mkldnn-v1.0] Enable base code with new APIs. (#16064) * fix comments (#8) * add base code for mkldnn 1.0 * fix comments * Update mkldnn.mk * add base code for mkldnn 1.0 * fix build * fix lint * fix lint * [mkldnn-v1.0] Add MKL-DNN Convolution (#16141) * add mkldnn conv * revert unnecessary change * fix testcase fail for cpu: test_convolution_independent_gradients * fix failed testcase: test_reshape_transpose_6d&&test_weight_async_reorder * fix comments * change variable name from weights to weight in mkldnn_conv * [mkldnn-v1.0] Add MKL-DNN activation (#16195) * add mkldnn act; pass lint; pass mnist training * make bwd as private member * [mkldnn-v1.0] Add MKL-DNN BN (#16199) * add mkldnn bn * add static_cast to transform data type * change mkldnn_args_map_t * retrigger CI * add mkldnn lrn (#16223) * [mkldnn-v1.0] Add MKL-DNN Transpose (#16250) * add mkldnn transpose * using mkldnn_args_map_t instead of std::unordered_map<int, mkldnn::memory> * [mkldnn-v1.0] Add MKL-DNN softmax (#16246) * add mkldnn softmax * trigger CI * [mkldnn-v1.0] Add MKL-DNN FC (#16221) * add mkldnn fc; pass lint; pass mnist training * add TODO info for future debug * [mkldnn-v1.0] Add MKL-DNN deconv (#16259) * add mkldnn deconv * coding style * trigger CI * add mkldnn softmax_output (#16222) * [mkldnn-v1.0] Add MKL-DNN Pooling (#16272) * add mkldnn pooling * add workaround for mkldnn v1.0 pooling fwd && bwd workspace mismatch * code clean * fix lint error * trigger CI * trigger CI * add extra work_space check and fix some typo * trigger CI * [mkldnn-v1.0] Add MKL-DNN reshape&flatten&expand_dims (#16258) * Add mkldnn 1.0 support for reshape/flatten/expanddims ops * improve log & modify definition location of args_map_ * fix comments * rebase code * trigger CI * trigger CI * trigger CI * trigger CI * [mkldnn-v1.0] Add MKL-DNN int8 activation&pooling&flatten (#16425) * Add mkldnn quantized activation/pooling/flatten * int8 flatten * [mkldnn-1.0] int8 conv quantize dequantize requantize (#16283) * int8 conv quantize dequantize requantize Change-Id: Ibd9df97288a95c61d6d85ec3831fd18b626ca283 * Fix lint * Fix clang build Change-Id: I9468774d014c852901e4cc3bffabd8a3d8004519 * add mkldnn sum concat (#16263) * [mkldnn-1.0] mkldnn int8 elemwise_add (#16454) * add mkldnn int8 elemwise_add * add workaround to fix format any issue * code clean * upgrade int8 bn to MKLDNN1.0 (#16458) * [mkldnn-v1.0] Fused RNN Op (#16420) * [mkldnn-v1.0] Add MKL-DNN int8 fc (#16457) * Add mkldnn_v1.0 int8 fc * trigger CI * trigger CI * [mkldnn-v1.0] Update enabling flag for MKL dropout (#16433) * use MSHADOW_USE_MKL to determine whther to use mkl optimized dropout * rebase code * [mkldnn-1.0] upgrade int8 concat to MKLDNN1.0 (#16466) * [mkldnn-1.0] upgrade int8 concat to MKLDNN1.0 * fix lint * use mkldnn_args_map_t * update dict usage style * retrigger CI * retrigger CI again * retrigger CI again 2 * [mkldnn-v1.0] Add MKL-DNN slice (#16484) * change slice to mkldnn v1.0 * fix lint * [mkldnn-1.0] add mkldnn subgraph fc (#16468) * add mkldnn subgraph fc * code clean * trigger CI * [mkldnn-v1.0]enable mkldnn concat (#16507) * enable mkldnn concat * trigger CI * trigger CI * [mkldnn-v1.0] Enable mkldnn cpp-test, copy op, concat op (#16503) * [mkldnn-v1.0] Enable mkldnn test, copy op, concat op Exclude gpu topology via MXNET_USE_CUDA nit default format Remove whitespace * Unix-GPU Tensor-RT build timeout, re-trigger CI * [mkldnn-1.0] add skipped case for mkldnn_v1.0 (#16470) * add skipped case for mkldnn_v1.0 * enable mkl quantized testcase * enable skipped testcase * trigger CI * trigger CI * trigger CI * trigger CI * [mkldnn-1.0]enable mkldnn elemwise_sum (#16521) * enable mkldnn elemwise_sum * trigger CI * trigger CI * trigger CI * [mkldnn-v1.0] Enable more checks for MXNET_USE_MKLDNN (#16520) * open USE_MKLDNN check * trigger ci * ci * [mkldnn-v1.0]Minor fix for leakyrelu compile flag (#16519) * change to MXNET_USE_MKLDNN == 100 * trigger * remove MKL license (#16534) * change MXNET_USE_MKLDNN from 100 to 1 (#16551) * re-enable unit tests (#16565) * [mkldnn-v1.0] Skip flaky test for unidirectional rnn_relu (#16545) Skip `test_rnnrelu_sym`, and add some issue tracking message Add return Revert test_rnnrelu_sym to origin * Add some annotations and log strings, rename mem_desc variables (#16609) * [mkldnn-v1.0]set fc weight layout as mkldnn v0.2x did (#16593) * set fc weight layout as mkldnn v0.2x did * fix lint * [mkldnn-v1.0] Upgrade to MKL-DNN v1.0.4 patch release (#16592) * upgrade to mkldnn v1.0.3 patch release * retrigger ci * mkldnn v1.0.4 patch release * [mkldnn-1.0]Rebase to master (#16648) * fixed broken links across multiple files (#16581) * fix missing docs due to git add issues (#16496) * Create SECURITY.md (#16573) * Create SECURITY.md * Update SECURITY.md * [Numpy] Support N_D(N>=3) batch_dot (#16586) * Support N_D(N>=3) batch_dot * use 1E-4 * fix lint * remove unnecessary comment * Update test_numpy_op.py * Large Vector tests for DGL Ops Part 2 (#16497) * add hyperbolic, logical, sign and regression tests for large vector * changed hyperbolic functions into existing trignometric functions * fix trigo and simple bind needs shape as tuple * fix logical ops, add with_seed * fix arcosh in largearray, remove regression from largevector * [Numpy] Loading numpy-incompatible NDArray in numpy-compatible mode (#16597) * Make MXIsNumpyShape return enum * address the comment * Surpress subgraph log in CI (#16607) Change-Id: Ia2ed6fdbb1d2cb5cc607a8856ca13ee338e27eac * Fix dequantize memory corruption (#16606) Change-Id: I51b62a32987bdbcf96f04b1bc6617e66796f648b * [MKLDNN]Fix reorder2default (#16602) * Fix reorder2default Change-Id: I74c87af9535f6264e6d1ea7eaed089a6480a3358 * fix Change-Id: I6d07b43b520a47e7c78bd4b4b6390f5fb95e6957 * Fix Change-Id: Id72f25c34291be4711f55569c6d61467edd6113d * Fix CI Change-Id: I8c33a82555d5ace2d0b682c1e3eefa13f3a44768 * Run CI Change-Id: Ie8a6dab80ef91c0337cafbae4e3db277e0c7ebf7 * second round of fixing broken links in multiple files (#16598) * Python Docstring Convetion (#16550) * Docstring convetnion for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention * Revert removing new line * Remove white space * [MXNET-1434] Fix a broken link for basic C++ tutorial (#16461) * Fix for wrong reqs set after switching from training to inference (#16553) * Debugging reqs * Move literal strings to const static members * Fix lint * julia/docs: more DRY on page rendering (#16396) * [mkldnn-v1.0]rebase with master (#16649) * fixed broken links across multiple files (#16581) * fix missing docs due to git add issues (#16496) * Create SECURITY.md (#16573) * Create SECURITY.md * Update SECURITY.md * [Numpy] Support N_D(N>=3) batch_dot (#16586) * Support N_D(N>=3) batch_dot * use 1E-4 * fix lint * remove unnecessary comment * Update test_numpy_op.py * Large Vector tests for DGL Ops Part 2 (#16497) * add hyperbolic, logical, sign and regression tests for large vector * changed hyperbolic functions into existing trignometric functions * fix trigo and simple bind needs shape as tuple * fix logical ops, add with_seed * fix arcosh in largearray, remove regression from largevector * [Numpy] Loading numpy-incompatible NDArray in numpy-compatible mode (#16597) * Make MXIsNumpyShape return enum * address the comment * Surpress subgraph log in CI (#16607) Change-Id: Ia2ed6fdbb1d2cb5cc607a8856ca13ee338e27eac * Fix dequantize memory corruption (#16606) Change-Id: I51b62a32987bdbcf96f04b1bc6617e66796f648b * [MKLDNN]Fix reorder2default (#16602) * Fix reorder2default Change-Id: I74c87af9535f6264e6d1ea7eaed089a6480a3358 * fix Change-Id: I6d07b43b520a47e7c78bd4b4b6390f5fb95e6957 * Fix Change-Id: Id72f25c34291be4711f55569c6d61467edd6113d * Fix CI Change-Id: I8c33a82555d5ace2d0b682c1e3eefa13f3a44768 * Run CI Change-Id: Ie8a6dab80ef91c0337cafbae4e3db277e0c7ebf7 * second round of fixing broken links in multiple files (#16598) * Python Docstring Convetion (#16550) * Docstring convetnion for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention * Revert removing new line * Remove white space * [MXNET-1434] Fix a broken link for basic C++ tutorial (#16461) * Fix for wrong reqs set after switching from training to inference (#16553) * Debugging reqs * Move literal strings to const static members * Fix lint * julia/docs: more DRY on page rendering (#16396) * Disables test_bulking_operator_gpu due to flakiness (#16611) * C Api for simplebind, fix comment for trigoops, add atol to assert (#16585) * C Api for simplebind, fix comment for trigoops, add atol to assert * fix build issues * fix lint and add regression test * fix indent * api doc and function name change * fix lint and add infer shape test * Imagenet inference to nightly fix (#16599) * split to cd and shell * comment * lots of prints * copy binary at correct location * remove comments * add mkl lib * update docker run build function * set nvidia docker true to run imagenet inference on GPU * Revert "set nvidia docker true to run imagenet inference on GPU" This reverts commit 98f8eef. As we don't need GPU for compilation. * Fix python doc build issue (#16630) * pin the pip versions * remove nbconvert comment * Faster general take (#16615) * Sped up perf of take op when axis != 0 * Formatting and syntax fixes * Rename Take to specify axis * Fix line length lint errors * [Gluon] Don't serialize shared parameters twice (#16582) Add deduplicate argument (default of False) to save_parameters. * Fix index overflow bug in einsum (#16589) * fix index overflow * check index overflow * fix index overflow in einsum path * fix indent * reduce NPY_MAXARGS * safe accumulate * Move some subgraph verbose to MXNET_SUBGRAPH_VERBOSE=2 (#16622) * Move subgraph pass log to verbose=2 * Run CI * add npx reshape (#16640) * RNNOp only call cuda/cudnn if GPU ctx is requested (#16632) * fix bad encode (#16641) * [Perl] - ndarray to native array conversion fix (#16635) * fixing broken links in multiple files - round 3 (#16634) * add type switch to weight tensor (#16543) * numpy doc enhancement (#16637) * Change NDArray to ndarray for npx ops Add nonzero boolean mask supports boolean ndarray Add argmin op and interoperability test for nonzero Fix vdot, inner, outter docs Add nonzero to mx.nd.np Add docs Fix * Fix lint * Fix * Fix * Fix get_constant * Disable float16 test (#16643) * Fix GetMKLDNNData for delay alloc (#16618) * Fix GetMKLDNNData for delay alloc * Run CI * Run CI * Run CI * Run CI * Run CI Change-Id: I7ac2796e0ee8439c92fd2bd7a70a23a359b76b12 * Revert "[mkldnn-1.0]Rebase to master (#16648)" This reverts commit dea3dd2. * [mkldnn-v1.0] Minor fix of mkldnn-v1.0 transition (#16644) mk and rm directory in mkldnn.mk ndarray.cc redundant whitespace mkldnn_act rename variables of bwd primitives mkldnn_rnn.cc iterator -> const_iterator Use != instead of < for iterator in for-loop Code comment for explaining the reason why excludes the last layer * [mkldnn-v1.0]rm int8 sum workaround (#16623) * rm int8 sum workaround due to mkldnn lib update * simple dims asignments in mkldnn_quantized_elemwise_add.cc * make MKLDNN macro simple for imperative_utils.h (#16652) * fix ci jenkins step groovy (#16659) * Adopt autograd.record() context to RNNOp (#16657) * Use memcopy instead of set_handle when num_layer=0, direction=1 (#16663) * fallback mkldnn fc bwd in imperative mode (#16672) * disable MKLDNN FC backward * [mkldnn-v1.0] Must reorder and emplace weights for inference primitives (#16682) * add default parameter for mkldnn rnn
* [mkldnn-v1.0] Initiate the transition to MKL-DNN v1.0 (apache#15706) * update mkldnn to 1.0.1 release * change makefile * change cmake * update ci build and pip package build * fix typo in mkldnn.mk * fix build for USE_BLAS=mkl & bump MKL version * skip mkldnn unit tests * remove iomp5 from mx_mkldnn_lib * ci: skip test_mkldnn_install * retrigger ci * retrigger ci * retrigger ci * [mkldnn-v1.0] Update MKL-DNN to v1.0.2 (apache#16012) * bump mkldnn to v1.0.2 * skip quantization unit test * add useless build flag * Fixes openblas installation for static build * empty commit * [mkldnn-v1.0] Enable base code with new APIs. (apache#16064) * fix comments (#8) * add base code for mkldnn 1.0 * fix comments * Update mkldnn.mk * add base code for mkldnn 1.0 * fix build * fix lint * fix lint * [mkldnn-v1.0] Add MKL-DNN Convolution (apache#16141) * add mkldnn conv * revert unnecessary change * fix testcase fail for cpu: test_convolution_independent_gradients * fix failed testcase: test_reshape_transpose_6d&&test_weight_async_reorder * fix comments * change variable name from weights to weight in mkldnn_conv * [mkldnn-v1.0] Add MKL-DNN activation (apache#16195) * add mkldnn act; pass lint; pass mnist training * make bwd as private member * [mkldnn-v1.0] Add MKL-DNN BN (apache#16199) * add mkldnn bn * add static_cast to transform data type * change mkldnn_args_map_t * retrigger CI * add mkldnn lrn (apache#16223) * [mkldnn-v1.0] Add MKL-DNN Transpose (apache#16250) * add mkldnn transpose * using mkldnn_args_map_t instead of std::unordered_map<int, mkldnn::memory> * [mkldnn-v1.0] Add MKL-DNN softmax (apache#16246) * add mkldnn softmax * trigger CI * [mkldnn-v1.0] Add MKL-DNN FC (apache#16221) * add mkldnn fc; pass lint; pass mnist training * add TODO info for future debug * [mkldnn-v1.0] Add MKL-DNN deconv (apache#16259) * add mkldnn deconv * coding style * trigger CI * add mkldnn softmax_output (apache#16222) * [mkldnn-v1.0] Add MKL-DNN Pooling (apache#16272) * add mkldnn pooling * add workaround for mkldnn v1.0 pooling fwd && bwd workspace mismatch * code clean * fix lint error * trigger CI * trigger CI * add extra work_space check and fix some typo * trigger CI * [mkldnn-v1.0] Add MKL-DNN reshape&flatten&expand_dims (apache#16258) * Add mkldnn 1.0 support for reshape/flatten/expanddims ops * improve log & modify definition location of args_map_ * fix comments * rebase code * trigger CI * trigger CI * trigger CI * trigger CI * [mkldnn-v1.0] Add MKL-DNN int8 activation&pooling&flatten (apache#16425) * Add mkldnn quantized activation/pooling/flatten * int8 flatten * [mkldnn-1.0] int8 conv quantize dequantize requantize (apache#16283) * int8 conv quantize dequantize requantize Change-Id: Ibd9df97288a95c61d6d85ec3831fd18b626ca283 * Fix lint * Fix clang build Change-Id: I9468774d014c852901e4cc3bffabd8a3d8004519 * add mkldnn sum concat (apache#16263) * [mkldnn-1.0] mkldnn int8 elemwise_add (apache#16454) * add mkldnn int8 elemwise_add * add workaround to fix format any issue * code clean * upgrade int8 bn to MKLDNN1.0 (apache#16458) * [mkldnn-v1.0] Fused RNN Op (apache#16420) * [mkldnn-v1.0] Add MKL-DNN int8 fc (apache#16457) * Add mkldnn_v1.0 int8 fc * trigger CI * trigger CI * [mkldnn-v1.0] Update enabling flag for MKL dropout (apache#16433) * use MSHADOW_USE_MKL to determine whther to use mkl optimized dropout * rebase code * [mkldnn-1.0] upgrade int8 concat to MKLDNN1.0 (apache#16466) * [mkldnn-1.0] upgrade int8 concat to MKLDNN1.0 * fix lint * use mkldnn_args_map_t * update dict usage style * retrigger CI * retrigger CI again * retrigger CI again 2 * [mkldnn-v1.0] Add MKL-DNN slice (apache#16484) * change slice to mkldnn v1.0 * fix lint * [mkldnn-1.0] add mkldnn subgraph fc (apache#16468) * add mkldnn subgraph fc * code clean * trigger CI * [mkldnn-v1.0]enable mkldnn concat (apache#16507) * enable mkldnn concat * trigger CI * trigger CI * [mkldnn-v1.0] Enable mkldnn cpp-test, copy op, concat op (apache#16503) * [mkldnn-v1.0] Enable mkldnn test, copy op, concat op Exclude gpu topology via MXNET_USE_CUDA nit default format Remove whitespace * Unix-GPU Tensor-RT build timeout, re-trigger CI * [mkldnn-1.0] add skipped case for mkldnn_v1.0 (apache#16470) * add skipped case for mkldnn_v1.0 * enable mkl quantized testcase * enable skipped testcase * trigger CI * trigger CI * trigger CI * trigger CI * [mkldnn-1.0]enable mkldnn elemwise_sum (apache#16521) * enable mkldnn elemwise_sum * trigger CI * trigger CI * trigger CI * [mkldnn-v1.0] Enable more checks for MXNET_USE_MKLDNN (apache#16520) * open USE_MKLDNN check * trigger ci * ci * [mkldnn-v1.0]Minor fix for leakyrelu compile flag (apache#16519) * change to MXNET_USE_MKLDNN == 100 * trigger * remove MKL license (apache#16534) * change MXNET_USE_MKLDNN from 100 to 1 (apache#16551) * re-enable unit tests (apache#16565) * [mkldnn-v1.0] Skip flaky test for unidirectional rnn_relu (apache#16545) Skip `test_rnnrelu_sym`, and add some issue tracking message Add return Revert test_rnnrelu_sym to origin * Add some annotations and log strings, rename mem_desc variables (apache#16609) * [mkldnn-v1.0]set fc weight layout as mkldnn v0.2x did (apache#16593) * set fc weight layout as mkldnn v0.2x did * fix lint * [mkldnn-v1.0] Upgrade to MKL-DNN v1.0.4 patch release (apache#16592) * upgrade to mkldnn v1.0.3 patch release * retrigger ci * mkldnn v1.0.4 patch release * [mkldnn-1.0]Rebase to master (apache#16648) * fixed broken links across multiple files (apache#16581) * fix missing docs due to git add issues (apache#16496) * Create SECURITY.md (apache#16573) * Create SECURITY.md * Update SECURITY.md * [Numpy] Support N_D(N>=3) batch_dot (apache#16586) * Support N_D(N>=3) batch_dot * use 1E-4 * fix lint * remove unnecessary comment * Update test_numpy_op.py * Large Vector tests for DGL Ops Part 2 (apache#16497) * add hyperbolic, logical, sign and regression tests for large vector * changed hyperbolic functions into existing trignometric functions * fix trigo and simple bind needs shape as tuple * fix logical ops, add with_seed * fix arcosh in largearray, remove regression from largevector * [Numpy] Loading numpy-incompatible NDArray in numpy-compatible mode (apache#16597) * Make MXIsNumpyShape return enum * address the comment * Surpress subgraph log in CI (apache#16607) Change-Id: Ia2ed6fdbb1d2cb5cc607a8856ca13ee338e27eac * Fix dequantize memory corruption (apache#16606) Change-Id: I51b62a32987bdbcf96f04b1bc6617e66796f648b * [MKLDNN]Fix reorder2default (apache#16602) * Fix reorder2default Change-Id: I74c87af9535f6264e6d1ea7eaed089a6480a3358 * fix Change-Id: I6d07b43b520a47e7c78bd4b4b6390f5fb95e6957 * Fix Change-Id: Id72f25c34291be4711f55569c6d61467edd6113d * Fix CI Change-Id: I8c33a82555d5ace2d0b682c1e3eefa13f3a44768 * Run CI Change-Id: Ie8a6dab80ef91c0337cafbae4e3db277e0c7ebf7 * second round of fixing broken links in multiple files (apache#16598) * Python Docstring Convetion (apache#16550) * Docstring convetnion for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention * Revert removing new line * Remove white space * [MXNET-1434] Fix a broken link for basic C++ tutorial (apache#16461) * Fix for wrong reqs set after switching from training to inference (apache#16553) * Debugging reqs * Move literal strings to const static members * Fix lint * julia/docs: more DRY on page rendering (apache#16396) * [mkldnn-v1.0]rebase with master (apache#16649) * fixed broken links across multiple files (apache#16581) * fix missing docs due to git add issues (apache#16496) * Create SECURITY.md (apache#16573) * Create SECURITY.md * Update SECURITY.md * [Numpy] Support N_D(N>=3) batch_dot (apache#16586) * Support N_D(N>=3) batch_dot * use 1E-4 * fix lint * remove unnecessary comment * Update test_numpy_op.py * Large Vector tests for DGL Ops Part 2 (apache#16497) * add hyperbolic, logical, sign and regression tests for large vector * changed hyperbolic functions into existing trignometric functions * fix trigo and simple bind needs shape as tuple * fix logical ops, add with_seed * fix arcosh in largearray, remove regression from largevector * [Numpy] Loading numpy-incompatible NDArray in numpy-compatible mode (apache#16597) * Make MXIsNumpyShape return enum * address the comment * Surpress subgraph log in CI (apache#16607) Change-Id: Ia2ed6fdbb1d2cb5cc607a8856ca13ee338e27eac * Fix dequantize memory corruption (apache#16606) Change-Id: I51b62a32987bdbcf96f04b1bc6617e66796f648b * [MKLDNN]Fix reorder2default (apache#16602) * Fix reorder2default Change-Id: I74c87af9535f6264e6d1ea7eaed089a6480a3358 * fix Change-Id: I6d07b43b520a47e7c78bd4b4b6390f5fb95e6957 * Fix Change-Id: Id72f25c34291be4711f55569c6d61467edd6113d * Fix CI Change-Id: I8c33a82555d5ace2d0b682c1e3eefa13f3a44768 * Run CI Change-Id: Ie8a6dab80ef91c0337cafbae4e3db277e0c7ebf7 * second round of fixing broken links in multiple files (apache#16598) * Python Docstring Convetion (apache#16550) * Docstring convetnion for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention for * Docstring convention * Revert removing new line * Remove white space * [MXNET-1434] Fix a broken link for basic C++ tutorial (apache#16461) * Fix for wrong reqs set after switching from training to inference (apache#16553) * Debugging reqs * Move literal strings to const static members * Fix lint * julia/docs: more DRY on page rendering (apache#16396) * Disables test_bulking_operator_gpu due to flakiness (apache#16611) * C Api for simplebind, fix comment for trigoops, add atol to assert (apache#16585) * C Api for simplebind, fix comment for trigoops, add atol to assert * fix build issues * fix lint and add regression test * fix indent * api doc and function name change * fix lint and add infer shape test * Imagenet inference to nightly fix (apache#16599) * split to cd and shell * comment * lots of prints * copy binary at correct location * remove comments * add mkl lib * update docker run build function * set nvidia docker true to run imagenet inference on GPU * Revert "set nvidia docker true to run imagenet inference on GPU" This reverts commit 98f8eef. As we don't need GPU for compilation. * Fix python doc build issue (apache#16630) * pin the pip versions * remove nbconvert comment * Faster general take (apache#16615) * Sped up perf of take op when axis != 0 * Formatting and syntax fixes * Rename Take to specify axis * Fix line length lint errors * [Gluon] Don't serialize shared parameters twice (apache#16582) Add deduplicate argument (default of False) to save_parameters. * Fix index overflow bug in einsum (apache#16589) * fix index overflow * check index overflow * fix index overflow in einsum path * fix indent * reduce NPY_MAXARGS * safe accumulate * Move some subgraph verbose to MXNET_SUBGRAPH_VERBOSE=2 (apache#16622) * Move subgraph pass log to verbose=2 * Run CI * add npx reshape (apache#16640) * RNNOp only call cuda/cudnn if GPU ctx is requested (apache#16632) * fix bad encode (apache#16641) * [Perl] - ndarray to native array conversion fix (apache#16635) * fixing broken links in multiple files - round 3 (apache#16634) * add type switch to weight tensor (apache#16543) * numpy doc enhancement (apache#16637) * Change NDArray to ndarray for npx ops Add nonzero boolean mask supports boolean ndarray Add argmin op and interoperability test for nonzero Fix vdot, inner, outter docs Add nonzero to mx.nd.np Add docs Fix * Fix lint * Fix * Fix * Fix get_constant * Disable float16 test (apache#16643) * Fix GetMKLDNNData for delay alloc (apache#16618) * Fix GetMKLDNNData for delay alloc * Run CI * Run CI * Run CI * Run CI * Run CI Change-Id: I7ac2796e0ee8439c92fd2bd7a70a23a359b76b12 * Revert "[mkldnn-1.0]Rebase to master (apache#16648)" This reverts commit dea3dd2. * [mkldnn-v1.0] Minor fix of mkldnn-v1.0 transition (apache#16644) mk and rm directory in mkldnn.mk ndarray.cc redundant whitespace mkldnn_act rename variables of bwd primitives mkldnn_rnn.cc iterator -> const_iterator Use != instead of < for iterator in for-loop Code comment for explaining the reason why excludes the last layer * [mkldnn-v1.0]rm int8 sum workaround (apache#16623) * rm int8 sum workaround due to mkldnn lib update * simple dims asignments in mkldnn_quantized_elemwise_add.cc * make MKLDNN macro simple for imperative_utils.h (apache#16652) * fix ci jenkins step groovy (apache#16659) * Adopt autograd.record() context to RNNOp (apache#16657) * Use memcopy instead of set_handle when num_layer=0, direction=1 (apache#16663) * fallback mkldnn fc bwd in imperative mode (apache#16672) * disable MKLDNN FC backward * [mkldnn-v1.0] Must reorder and emplace weights for inference primitives (apache#16682) * add default parameter for mkldnn rnn
Description
add first mkldnn v1.0 OP: mkldnn conv; pass mnist training test; pass make lint
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
@TaoLv @PatricZhao @ZhennanQin