Enabling oneDNN and ACL Acceleration
oneDNN and ACL acceleration enables oneDNN and ACL as the backend computing libraries of PyTorch to provide optimal performance for tasks such as deep learning. Replace the example paths provided in the following procedure with the actual ones.
- Obtain the ACL source code.
- Download the ACL source code.
https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz
- Use an SFTP tool to upload the source package to the server.
If the server is connected to the Internet, you can run the wget command on the server to download the source package.
wget https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz --no-check-certificate
- Download the ACL source code.
- Decompress the ACL source package.
tar -xzvf v23.08.tar.gz
- Go to the /path/to/ComputeLibrary-23.08 directory.
cd /path/to/ComputeLibrary-23.08
- Build scons.
scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv8a build=native
- Set ACL environment variables.
export ACL_ROOT_DIR=/path/to/ComputeLibrary-23.08
- Verify the installation.
- Go to the build directory.
cd build
- Set the environment variable of the ACL dynamic library.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/ComputeLibrary-23.08/build/
- Run the example test case.
./examples/neon_cnn

- Go to the build directory.
- (Optional) If PyTorch has been installed, clear the existing compilation files.
- Go to the /path/to/pytorch directory.
cd /path/to/pytorch
- Delete the build directory.
rm -rf ./build
- Go to the /path/to/pytorch directory.
- Install PyTorch by following instructions in Basic Installation. Add the following items to the Step 5 environment variable:
export USE_MKLDNN=1 export USE_MKLDNN_ACL=1
USE_MKLDNN: Set this parameter to 1, indicating that the oneDNN library is enabled to optimize inference computing.
USE_MKLDNN_ACL: Set this parameter to 1, indicating that ACL is enabled in addition to USE_MKLDNN.
- Check the installation.
- Check whether the directory contains the oneDNN static library file.
ls build/lib | grep dnnl
The command output shows that the directory contains the oneDNN static library file:

- Check whether the soft link of libtorch.so contains the SO file of ACL.
ldd build/lib/libtorch.so | grep compute
The command output shows that the soft link contains the SO file of ACL:
libarm_compute.so => /path/to/ComputeLibrary-23.08/build/libarm_compute.so (0x0000ffff9ca99000) libarm_compute_graph.so => /path/to/ComputeLibrary-23.08/build/libarm_compute_graph.so (0x0000ffff9c9b7000) libarm_compute_core.so => /path/to/ComputeLibrary-23.08/build/libarm_compute_core.so (0x0000ffff9c996000)
- Check whether the directory contains the oneDNN static library file.