Installation and Deployment

The ATB is integrated in CANN's neural network acceleration library (NNAL) package. Install the Ascend NPU driver and CANN software (including the toolkit, ops, and NNAL packages) and configure environment variables following the instructions in CANN Quick Installation.

Before running the ATB, ensure that the process-level environment variable script set_env.sh has been configured. The script automatically becomes invalid after the user process ends. For details, see Environment Variables. The following example command uses the default path after installation as a non-root user:
1
source ${HOME}/Ascend/nnal/atb/set_env.sh

Note the following requirements for running the NNAL ATB:

  • The glibc version must be 2.17 or later when you run the NNAL ATB. You can run the ldd --version command to query the glibc version (Mainstream Linux OSs meet the requirement of glibc versions. If the requirement is not meet, you are advised to reinstall the system of a new version. You are not advised to directly upgrade glibc, which may cause system breakdown).
  • The running of the torch_atb plugin depends on PyTorch and TorchNPU. Install the software listed in Table 1 as instructed in Ascend Extension for PyTorch Configuration and Installation. In addition, before running the torch_atb plugin, ensure that the ops operator package has been installed to adapt to the running of TorchNPU.
    Table 1 torch_atb plug-in dependency list

    PyTorch Version

    2.9.0

    TorchNPU Version

    v7.2.RC1.alpha003-pytorch2.9.0

    Python Version

    3.10.x or 3.11.x

  • Note: Starting from CANN 9.1, the dependent PyTorch version changes from PyTorch 2.1.0 to PyTorch 2.9.0 because PyTorch 2.1 reaches End of Support (EOS). The glibc version required by torch_atb is 2.38. However, older versions of the torch_atb plugin can still work with the new nnal software package. Method:
  • The following uses CANN 9.1 (AArch) and torch_atb in CANN 9.0 as an example. Decompress the nnal software package of CANN 9.0 and then use pip to install torch_atb.
    # Decompress the nnal software package.
    ./Ascend-cann-nnal_9.0.0_linux-aarch64.run --extract=<path_nnal> --noexec
    cd <path_nnal>/run_package
    # Decompress the ATB software package.
    ./Ascend-cann-atb_9.0.0_linux-aarch64.run --extract=<path_atb> --noexec
    cd <path_atb>/whl
    # Select the cp310 or cp311 wheel package based on the Python version.
    pip3 install torch_atb-0.0.1-cp310-none-any.whl
    pip3 install torch_atb-0.0.1-cp311-none-any.whl