Enable ZenDNN in WeGO TensorFlow 2
ZenDNN is disabled by default. Set export
ZENDNN_INFERENCE_ONLY=1
to enable it.
Environment Variables
You must export the following environment variables explicitly to enable
ZenDNN working properly in WeGO TensorFlow 2.
Name | Description |
---|---|
OMP_DYNAMIC | Set it to FALSE explicitly when ZenDNN is enabled. |
OMP_NUM_THREADS | Set it explicitly to achieve a better performance. See tuning guidelines for more details. |
ZENDNN_GEMM_ALGO | Default is 3. You can set [0, 1, 2, 3] to tune different GEMM ALGO path. |
ZENDNN_TENSOR_POOL_LIMIT | Default is 32. See tuning guidelines for more details. |
ZENDNN_TENSOR_BUF_MAXSIZE_ENABLE | Default is 0.
|
ZENDNN_INFERENCE_ONLY | Default is 0. Set 1 to enable ZenDNN. |
Tuning Guidelines
Set OMP_NUM_THREADS
as per the core number of
user system. Xilinx 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 will use default memory allocation instead of tensor pool
once it hits the pool limit with ZEN_TENSOR_POOL_LIMIT
.