Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[submodule] Remove soon to be obsolete dnnl nomenclature from mxnet #20606

Merged
merged 22 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ header:
- 'src/operator/contrib/multi_proposal.cu'
- 'src/operator/contrib/psroi_pooling.cc'
- 'src/operator/contrib/psroi_pooling.cu'
- 'src/operator/nn/mkldnn/mkldnn_base-inl.h'
- 'src/operator/nn/dnnl/dnnl_base-inl.h'
# files licensed under boost license
- 'cmake/Modules/FindJeMalloc.cmake'
# files licensed under bsd 3-clause
Expand Down Expand Up @@ -64,7 +64,7 @@ header:
- 'include/mshadow' # symlink to 3rdparty/mshadow/mshadow
- 'include/onednn' # symlinks to 3rdparty/onednn
# test/build data
- 'tests/python/mkl/data/test_mkldnn_test_mkldnn_model_model1.json'
- 'tests/python/dnnl/data/test_dnnl_test_dnnl_model_model1.json'


comment: on-failure
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,16 @@ if(USE_ONEDNN)
endif()

function(load_onednn)
set(MKLDNN_BUILD_TESTS OFF CACHE INTERNAL "" FORCE)
set(MKLDNN_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE)
set(MKLDNN_ARCH_OPT_FLAGS "" CACHE INTERNAL "" FORCE)
set(MKLDNN_ENABLE_JIT_PROFILING OFF CACHE INTERNAL "" FORCE)
set(MKLDNN_LIBRARY_TYPE STATIC CACHE INTERNAL "" FORCE)
set(DNNL_BUILD_TESTS OFF CACHE INTERNAL "" FORCE)
set(DNNL_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE)
set(DNNL_ARCH_OPT_FLAGS "" CACHE INTERNAL "" FORCE)
set(DNNL_ENABLE_JIT_PROFILING OFF CACHE INTERNAL "" FORCE)
set(DNNL_LIBRARY_TYPE STATIC CACHE INTERNAL "" FORCE)
set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE INTERNAL "" FORCE)
set(DNNL_ENABLE_PRIMITIVE_CACHE ON CACHE INTERNAL "" FORCE)

if(NOT USE_OPENMP)
set(MKLDNN_CPU_RUNTIME SEQ CACHE INTERNAL "" FORCE)
set(DNNL_CPU_RUNTIME SEQ CACHE INTERNAL "" FORCE)
endif()

set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/onednn")
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ healthy project. The PPMC actively seeks to appoint new committers from the list
* [Aaron Markham](https://github.com/aaronmarkham)
* [Alex Zai](https://github.com/azai91)
* [Anirudh Acharya](https://github.com/anirudhacharya)
* [Anna Karbownik]((https://github.com/akarbown)
* [Anna Karbownik](https://github.com/akarbown)
* [Aston Zhang](https://github.com/astonzhang)
* [Chaitanya Bapat](https://github.com/ChaiBapchya)
* [Ciyong Chen](https://github.com/ciyongch)
Expand Down
2 changes: 1 addition & 1 deletion MKLDNN_README.md → DNNL_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
~
-->

File is moved to [docs/tutorials/mkldnn/MKLDNN_README.md](docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md).
File is moved to [docs/python_docs/python/tutorials/performance/backend/dnnl/dnnl_readme.md](docs/python_docs/python/tutorials/performance/backend/dnnl/dnnl_readme.md).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
src/operator/contrib/multi_proposal.cu
src/operator/contrib/psroi_pooling.cc
src/operator/contrib/psroi_pooling.cu
src/operator/nn/mkldnn/mkldnn_base-inl.h
src/operator/nn/dnnl/dnnl_base-inl.h

=======================================================================================
MIT license
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ What's New

### Ecosystem News

* [ONEDNN for Faster CPU Performance](docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md)
* [oneDNN for Faster CPU Performance](docs/python_docs/python/tutorials/performance/backend/dnnl/dnnl_readme.md)
* [MXNet Memory Monger, Training Deeper Nets with Sublinear Memory Cost](https://github.com/dmlc/mxnet-memonger)
* [Tutorial for NVidia GTC 2016](https://github.com/dmlc/mxnet-gtc-tutorial)
* [MXNet.js: Javascript Package for Deep Learning in Browser (without server)](https://github.com/dmlc/mxnet.js/)
Expand Down
2 changes: 1 addition & 1 deletion cd/python/docker/test_python_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

# Execute tests
if [[ $mxnet_variant != native ]]; then
python3 tests/python/mkl/test_mkldnn.py
python3 tests/python/dnnl/test_dnnl.py
fi

# TODO: Add more tests (18549)
Expand Down
3 changes: 1 addition & 2 deletions cd/python/pypi/pypi_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ set -ex
export mxnet_variant=${1:?"Please specify the mxnet variant"}

# Due to this PR: https://github.com/apache/incubator-mxnet/pull/14899
# The setup.py expects that mkldnn_version.h be present in
# The setup.py expects that dnnl_version.h be present in
# mxnet-build/3rdparty/onednn/build/install/include
# The artifact repository stores this file in the dependencies
# and CD unpacks it to a directory called cd_misc
# Nov. 2019 Update: With v1.1, MKL-DNN is renaming to DNNL. Hence changing the prefix of file name.
if [ -f "cd_misc/dnnl_version.h" ]; then
mkdir -p 3rdparty/onednn/include/oneapi/dnnl
cp cd_misc/dnnl_version.h 3rdparty/onednn/include/oneapi/dnnl/.
bartekkuncer marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ cd_unittest_ubuntu() {
fi

if [[ ${mxnet_variant} = *mkl ]]; then
bartekkuncer marked this conversation as resolved.
Show resolved Hide resolved
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 --durations=50 --verbose tests/python/mkl
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 --durations=50 --verbose tests/python/dnnl
fi
}

Expand Down Expand Up @@ -841,7 +841,7 @@ unittest_ubuntu_python3_cpu_onednn() {
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest --durations=50 --cov-report xml:tests_mkl.xml --verbose tests/python/mkl
pytest --durations=50 --cov-report xml:tests_mkl.xml --verbose tests/python/dnnl
}

unittest_array_api_standardization() {
Expand Down
2 changes: 1 addition & 1 deletion cpp-package/example/inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This directory contains following examples. In order to run the examples, ensure

## [imagenet_inference.cpp](<https://github.com/apache/incubator-mxnet/blob/master/cpp-package/example/inference/imagenet_inference.cpp>)

This example demonstrates image classification workflow with pre-trained models using MXNet C++ API. Now this script also supports inference with quantized CNN models generated by Intel® MKL-DNN (see this [quantization flow](https://github.com/apache/incubator-mxnet/blob/master/example/quantization/README.md)). By using C++ API, the latency of most models will be reduced to some extent compared with current Python implementation.
This example demonstrates image classification workflow with pre-trained models using MXNet C++ API. Now this script also supports inference with quantized CNN models generated by oneDNN (see this [quantization flow](https://github.com/apache/incubator-mxnet/blob/master/example/quantization/README.md)). By using C++ API, the latency of most models will be reduced to some extent compared with current Python implementation.

Most of CNN models have been tested on Linux systems. And 50000 images are used to collect accuracy numbers. Please refer to this [README](https://github.com/apache/incubator-mxnet/blob/master/example/quantization/README.md) for more details about accuracy.

Expand Down
4 changes: 2 additions & 2 deletions docs/python_docs/python/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ Performance
How to use int8 in your model to boost training speed.

.. card::
:title: MKL-DNN
:title: oneDNN
:link: performance/backend/mkldnn/index.html

How to get the most from your CPU by using Intel's MKL-DNN.
How to get the most from your CPU by using oneDNN.

.. card::
:title: TVM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ o = exe.outputs[0]
t = o.asnumpy()
```

More detailed debugging and profiling information can be logged by setting the environment variable 'MKLDNN_VERBOSE':
More detailed debugging and profiling information can be logged by setting the environment variable 'DNNL_VERBOSE':
```
export MKLDNN_VERBOSE=1
export DNNL_VERBOSE=1
```
For example, by running above code snippet, the following debugging logs providing more insights on ONEDNN primitives `convolution` and `reorder`. That includes: Memory layout, infer shape and the time cost of primitive execution.
For example, by running above code snippet, the following debugging logs providing more insights on oneDNN primitives `convolution` and `reorder`. That includes: Memory layout, infer shape and the time cost of primitive execution.
```
dnnl_verbose,info,DNNL v1.1.2 (commit cb2cc7ac17ff4e2ef50805c7048d33256d82be4d)
dnnl_verbose,info,Detected ISA is Intel AVX-512 with Intel DL Boost
Expand Down Expand Up @@ -281,7 +281,7 @@ MKL_VERBOSE SGEMM(T,N,12,10,8,0x7f7f927b1378,0x1bc2140,8,0x1ba8040,8,0x7f7f927b1
Graph optimization with subgraph is available and enabled by default in master branch. For MXNet release v1.5, you can manually enable it by:

```
export MXNET_SUBGRAPH_BACKEND=MKLDNN
export MXNET_SUBGRAPH_BACKEND=ONEDNN
```

This limitations of this experimental feature are:
Expand All @@ -293,7 +293,7 @@ This limitations of this experimental feature are:

<h2 id="7">Quantization and Inference with INT8</h2>

Benefiting from Intel ONEDNN, MXNet built with Intel ONEDNN brings outstanding performance improvement on quantization and inference with INT8 Intel CPU Platform on Intel Xeon Scalable Platform.
Benefiting from oneDNN, MXNet built with oneDNN brings outstanding performance improvement on quantization and inference with INT8 Intel CPU Platform on Intel Xeon Scalable Platform.

- [CNN Quantization Examples](https://github.com/apache/incubator-mxnet/tree/master/example/quantization).

Expand All @@ -303,6 +303,6 @@ Benefiting from Intel ONEDNN, MXNet built with Intel ONEDNN brings outstanding p

- For questions or support specific to MKL, visit the [Intel MKL](https://software.intel.com/en-us/mkl) website.

- For questions or support specific to ONEDNN, visit the [Intel ONEDNN](https://github.com/oneapi-src/oneDNN) website.
- For questions or support specific to oneDNN, visit the [oneDNN](https://github.com/oneapi-src/oneDNN) website.

- If you find bugs, please open an issue on GitHub for [MXNet with MKL](https://github.com/apache/incubator-mxnet/labels/MKL) or [MXNet with ONEDNN](https://github.com/apache/incubator-mxnet/labels/MKLDNN).
- If you find bugs, please open an issue on GitHub for [MXNet with MKL](https://github.com/apache/incubator-mxnet/labels/MKL) or [MXNet with oneDNN](https://github.com/apache/incubator-mxnet/labels/MKLDNN).
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
specific language governing permissions and limitations
under the License.

Intel MKL-DNN
oneDNN
=============

.. container:: cards

.. card::
:title: MKL-DNN Installation and Verification
:link: mkldnn_readme
:title: oneDNN Installation and Verification
:link: dnnl_readme

A guide on using MKL-DNN with MXNet.
A guide on using oneDNN with MXNet.

.. card::
:title: MKL-DNN Quantization
:link: mkldnn_quantization
:title: oneDNN Quantization
:link: dnnl_quantization

How to perform quantization with MKLDNN
How to perform quantization with oneDNN

.. toctree::
:hidden:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ The following tutorials will help you learn how to use backend tools to boost pe
.. container:: cards

.. card::
:title: MKL-DNN
:link: mkldnn/index.html
:title: oneDNN
:link: dnnl/index.html

How to get the most from your CPU by using Intel's MKL-DNN.
How to get the most from your CPU by using oneDNN.

.. card::
:title: TVM
Expand All @@ -50,7 +50,7 @@ The following tutorials will help you learn how to use backend tools to boost pe
:hidden:
:maxdepth: 1

mkldnn/index
dnnl/index
tvm
profiler
amp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ Let's zoom in to check the time taken by operators
The above picture visualizes the sequence in which the operators were executed and the time taken by each operator.

### Profiling ONEDNN Operators
Reagrding ONEDNN operators, the library has already provided the internal profiling tool. Firstly, you need set `MKLDNN_VERBOSE=1` to enable internal profiler.
Reagrding ONEDNN operators, the library has already provided the internal profiling tool. Firstly, you need set `DNNL_VERBOSE=1` to enable internal profiler.

`$ MKLDNN_VERBOSE=1 python my_script.py > mkldnn_verbose.log`
`$ DNNL_VERBOSE=1 python my_script.py > dnnl_verbose.log`

Now, the detailed profiling insights of each ONEDNN prmitive are saved into `mkldnn_verbose.log` (like below).
Now, the detailed profiling insights of each oneDNN prmitive are saved into `dnnl_verbose.log` (like below).

```
dnnl_verbose,info,DNNL v1.1.2 (commit cb2cc7ac17ff4e2ef50805c7048d33256d82be4d)
Expand All @@ -225,13 +225,13 @@ dnnl_verbose,exec,cpu,convolution,jit:avx512_common,forward_inference,src_f32::b

For example, if you want to calculate the total executing time of `convolution` primitive, you can just run:

`$ cat mkldnn_verbose.log | grep "exec,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`
`$ cat dnnl_verbose.log | grep "exec,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`

Moreover, you can set `MKLDNN_VERBOSE=2` to collect both creating and executing time of each primitive.
Moreover, you can set `DNNL_VERBOSE=2` to collect both creating and executing time of each primitive.

`$ cat mkldnn_verbose.log | grep "create,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`
`$ cat dnnl_verbose.log | grep "create,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`

`$ cat mkldnn_verbose.log | grep "exec,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`
`$ cat dnnl_verbose.log | grep "exec,cpu,convolution" | awk 'BEGIN{FS=","} {SUM+=$11} END {print SUM}'`


### Profiling Custom Operators
Expand Down
6 changes: 3 additions & 3 deletions docs/python_docs/python/tutorials/performance/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ Accelerated Backend
..
TBD Content
.. card::
:title: MKL-DNN
:link: backend/mkldnn/mkldnn_readme
:title: oneDNN
:link: backend/dnnl/dnnl_readme

How to get the most from your CPU by using Intel's MKL-DNN.
How to get the most from your CPU by using oneDNN.

.. card::
:title: TVM
Expand Down
4 changes: 2 additions & 2 deletions docs/static_site/src/pages/api/faq/env_var.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ If ctypes is used, it must be `mxnet._ctypes.ndarray.NDArrayBase`.
- This variable controls how many CuDNN dropout state resources to create for each GPU context for use in operator.

* MXNET_SUBGRAPH_BACKEND
- Values: String ```(default="MKLDNN")``` if ONEDNN is avaliable, otherwise ```(default="")```
- Values: String ```(default="ONEDNN")``` if oneDNN is available, otherwise ```(default="")```
- This variable controls the subgraph partitioning in MXNet.
- This variable is used to perform ONEDNN FP32 operator fusion and quantization. Please refer to the [ONEDNN operator list](https://github.com/apache/incubator-mxnet/blob/v1.5.x/docs/tutorials/mkldnn/operator_list.md) for how this variable is used and the list of fusion passes.
- This variable is used to perform oneDNN FP32 operator fusion and quantization. Please refer to the [oneDNN operator list](https://github.com/apache/incubator-mxnet/blob/v1.5.x/docs/tutorials/mkldnn/operator_list.md) for how this variable is used and the list of fusion passes.
- Set ```MXNET_SUBGRAPH_BACKEND=NONE``` to disable subgraph backend.

* MXNET_SAFE_ACCUMULATION
Expand Down
2 changes: 1 addition & 1 deletion docs/static_site/src/pages/api/faq/perf.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ We also find that setting the following environment variables can help:
| :-------- | :---------- |
| `OMP_NUM_THREADS` | Suggested value: `vCPUs / 2` in which `vCPUs` is the number of virtual CPUs. For more information, please see the guide for [setting the number of threads using an OpenMP environment variable](https://software.intel.com/en-us/mkl-windows-developer-guide-setting-the-number-of-threads-using-an-openmp-environment-variable) |
| `KMP_AFFINITY` | Suggested value: `granularity=fine,compact,1,0`. For more information, please see the guide for [Thread Affinity Interface (Linux* and Windows*)](https://software.intel.com/en-us/node/522691). |
| `MXNET_SUBGRAPH_BACKEND` | Set to ONEDNN to enable the [subgraph feature](https://cwiki.apache.org/confluence/display/MXNET/MXNet+Graph+Optimization+and+Quantization+based+on+subgraph+and+MKL-DNN) for better performance. For more information please see [Build/Install MXNet with ONEDNN](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html)|
| `MXNET_SUBGRAPH_BACKEND` | Set to ONEDNN to enable the [subgraph feature](https://cwiki.apache.org/confluence/display/MXNET/MXNet+Graph+Optimization+and+Quantization+based+on+subgraph+and+MKL-DNN) for better performance. For more information please see [Build/Install MXNet with oneDNN](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/dnnl/dnnl_readme.html)|

Note that _MXNet_ treats all CPUs on a single machine as a single device.
So whether you specify `cpu(0)` or `cpu()`, _MXNet_ will use all CPU cores on the machine.
Expand Down
2 changes: 1 addition & 1 deletion include/mxnet/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ inline std::ostream& operator<<(std::ostream &out, const Context &ctx) {


#if MXNET_USE_ONEDNN == 1 || MXNET_USE_INTGEMM == 1
constexpr size_t kMKLDNNAlign = 64;
constexpr size_t kDNNLAlign = 64;
#endif

} // namespace mxnet
Expand Down
Loading