ZenDNN in WeGO TensorFlow 2 - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 English

Enable ZenDNN in WeGO TensorFlow 2

ZenDNN is disabled by default. Set export TF_ENABLE_ZENDNN_OPTS=1 to enable it.

Environment Variables

You must export the following environment variables explicitly to enable ZenDNN to work correctly in WeGO TensorFlow 2.
Table 1. Environment Variables
Name Description
OMP_DYNAMIC Set it to FALSE explicitly when ZenDNN is enabled.
OMP_NUM_THREADS Set it explicitly to achieve better performance. See tuning guidelines for more details.
ZENDNN_GEMM_ALGO The default value is 3. You can set [0, 1, 2, 3, 4] to tune different GEMM ALGO paths.
ZENDNN_TENSOR_POOL_LIMIT The default value is 32. See tuning guidelines for more details.
ZENDNN_TENSOR_BUF_MAXSIZE_ENABLE Default is 0.
  • 0: Enable reduced memory pool tensor.
  • 1: Enable increased memory pool tensor.
TF_ENABLE_ZENDNN_OPTS The default value is 0. Set it to 1 to enable ZenDNN.

Tuning Guidelines

Set OMP_NUM_THREADS per the core number of the user system. AMD recommends setting a small number like 1 or 2.

In some cases, set ZENDNN_TENSOR_POOL_LIMIT to a small number like 1, so some layers use default memory allocation instead of the tensor pool once it hits the pool limit with ZENDNN_TENSOR_POOL_LIMIT.