ZenDNN (Zen Deep Neural Network) Library accelerates deep learning inference applications on AMD CPUs. This library, which includes APIs for basic neural network building blocks optimized for AMD CPUs, targets deep learning application and framework developers with the goal of improving inference performance on AMD CPUs across a variety of workloads, including computer vision, natural language processing (NLP), and recommender systems. ZenDNN leverages oneDNN/DNNL v2.2's basic infrastructure and APIs. ZenDNN optimizes several APIs and adds new APIs, which are currently integrated into TensorFlow, ONNXRT, and PyTorch. ZenDNN uses AMD BLIS (BLAS-like Library Instantiation Software) library for its BLAS (Basic Linear Algebra Subprograms) API needs.
The scope of ZenDNN is to support AMD EPYCTM CPUs on the Linux® platform. ZenDNN v3.2 offers optimized primitives, such as Convolution, MatMul, Elementwise, and Pool (Max and Average) that improve performance of many convolutional neural networks, recurrent neural networks, transformer-based models, and recommender system models. For the primitives not supported by ZenDNN, execution will fall back to the native path of the framework.
Following are the highlights of this release:
ZenDNN library is intended to be used in conjunction with the frameworks mentioned above and cannot be used independently.
The latest information on the ZenDNN release and installers is available on AMD Developer Central (https://developer.amd.com/zendnn/).
This release of ZenDNN supports the following Operating Systems (OS) and compilers:
Theoretically, any Linux based OS with GLIBC version later than 2.17 could be supported.
The following prerequisites must be met for this release of ZenDNN:
AOCC is a high performance, production quality code generation tool. AOCC can be downloaded from AMD Developer Central (https://developer.amd.com/amd-aocc/).
ZenDNN compiled with AOCC may provide better performance as compared to the other open-source counterparts.
AMD-BLIS is a portable open-source software framework for instantiating high-performance Basic Linear Algebra Subprograms (BLAS), such as, dense linear algebra libraries. AMD-BLIS is part of AOCL and can be downloaded from AMD Developer Central (https://developer.amd.com/amd-aocl/).
Note: ZenDNN depends only on AMD-BLIS and has no dependency on any other AOCL library.
The following points must be considered while installing AOCC and AMD-BLIS:
<compdir>
in the steps below./home/<user-id>/my_work
.Complete the following steps to setup the AOOC compiled BLIS library:
cd <compdir>
tar -xvf aocl-linux-aocc-3.0-6.tar.gz
cd aocl-linux-aocc-3.0-6
tar -xvf aocl-blis-linux-aocc-3.0-6.tar.gz
cd amd-blis
This will set up the environment for BLIS AOCC path:
export ZENDNN_BLIS_PATH=$(pwd)
For example:
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-aocc-3.0-6/amd-blis
Complete the following steps to setup the GCC compiled BLIS library:
cd <compdir>
.tar -xvf aocl-linux-gcc-3.0-6.tar.gz
cd aocl-linux-gcc-3.0-6
tar -xvf aocl-blis-linux-gcc-3.0-6.tar.gz
cd amd-blis
This will set up the environment for BLIS GCC path:
export ZENDNN_BLIS_PATH=$(pwd)
For example:
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-gcc-3.0-6/amd-blis
Complete the following steps to install AOCC:
cd <compdir>
.tar -xvf aocc-compiler-3.0.0.tar
cd aocc-compiler-3.0.0
This will install the compiler and display the AOCC set up instructions.
bash install.sh
This will set up the environment for the AOCC path:
export ZENDNN_AOCC_COMP_PATH=$(pwd)
For example:
export ZENDNN_AOCC_COMP_PATH=/home/<user-id>/my_work/aocc-compiler-3.0.0
The bashrc file can be edited to setup ZENDNN_AOCC_COMP_PATH environment path. For example, in the case of AOCC compiled AMD-BLIS:
export ZENDNN_AOCC_COMP_PATH=/home/<user-id>/my_work/aocc-compiler-3.0.0
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-aocc-3.0-6/amd-blis
For example, in the case of GCC compiled AMD-BLIS:
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-gcc-3.0-6/amd-blis
ZenDNN has the following runtime dependencies:
Since ZenDNN is configured to use OpenMP, a C++ compiler with OpenMP 2.0 or later is required for runtime execution.
Clone ZenDNN git:
git clone https://github.com/amd/ZenDNN.git
cd ZenDNN
ZENDNN_AOCC_COMP_PATH and ZENDNN_BLIS_PATH should be defined. example:
export ZENDNN_AOCC_COMP_PATH=/home/<user-id>/my_work/aocc-compiler-3.0.0
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-aocc-3.0-6/amd-blis
make clean
source scripts/zendnn_aocc_build.sh
When new terminal is opened, user need to set up environment variables:
source scripts/zendnn_aocc_env_setup.sh
ZENDNN_BLIS_PATH should be defined. example:
export ZENDNN_BLIS_PATH=/home/<user-id>/my_work/aocl-linux-gcc-3.0-6/amd-blis
make clean
source scripts/zendnn_gcc_build.sh
When new terminal is opened, user need to set up environment variables:
source scripts/zendnn_gcc_env_setup.sh
Please note above scripts must be sourced only from ZenDNN Folder.
After the library is built on Linux host, user can run unit tests using:
source scripts/runApiTest.sh
Corresponding tests are located in the tests/api_tests directory. These unit tests don't produce any information/logs in the terminal. Library logs can be enabled with:
ZENDNN_LOG_OPTS=ALL:2 source scripts/runApiTest.sh
Logging is disabled in the ZenDNN library by default. It can be enabled using the environment variable ZENDNN_LOG_OPTS before running any tests. Logging behavior can be specified by setting the environment variable ZENDNN_LOG_OPTS to a comma-delimited list of ACTOR:DBGLVL pairs.
The different ACTORS are as follows:
ACTORS | Usage |
---|---|
ALGO | Logs all algorithms executed |
CORE | Logs all the core ZenDNN library operations |
API | Logs all the ZenDNN API calls |
TEST | Logs used in API tests, functionality tests and regression tests |
PROF | Logs the performance of operations in millisecond |
FWK | Logs all the framework (TensorFlow, ONNXRT, and PyTorch) specific calls |
For example:
The Different Debug Levels (DBGLVL) are as follows:
enum LogLevel {
LOG_LEVEL_DISABLED = -1,
LOG_LEVEL_ERROR = 0,
LOG_LEVEL_WARNING = 1,
LOG_LEVEL_INFO = 2,
};
ZenDNN is licensed under Apache License Version 2.0. Refer to the "LICENSE" file for the full license text and copyright notice.
This distribution includes third party software governed by separate license terms.
3-clause BSD license:
Apache License Version 2.0:
Boost Software License, Version 1.0:
BSD 2-Clause license:
This third party software, even if included with the distribution of the Advanced Micro Devices software, may be governed by separate license terms, including without limitation, third party license terms, and open source software license terms. These separate license terms govern your use of the third party programs as set forth in the THIRD-PARTY-PROGRAMS file.
Please email zendnnsupport@amd.com for questions, issues, and feedback on ZenDNN.
Please submit your questions, feature requests, and bug reports on the GitHub issues page.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。