Installation¶
This page covers the hardware and software prerequisites for Triton-distributed-ascend, and how to prepare your environment before building from source.
Triton-distributed-ascend currently has no prebuilt wheels published, so installation means building from source. Work through this page first, then follow Build from Source.
Hardware requirements¶
Triton-distributed-ascend targets Ascend products:
Ascend 950PR&950DT products
Atlas A3 products
Atlas A2 products
Distributed kernels need at least two NPUs visible to the host, since every tutorial and test launches one process per device. A single-device machine is enough to build the project, but not to run the communication examples.
Software requirements¶
Component |
Version |
Notes |
|---|---|---|
CANN |
9.1.0 or later |
Provides the toolkit, the Bisheng compiler, and |
Python |
3.8 or later |
A virtual environment or conda env is recommended |
PyTorch |
2.0 or later |
|
torch_npu |
Matched to your PyTorch and CANN version |
|
CMake |
3.19 or later |
Required by the C++/MLIR build |
GLIBC |
2.28 or later |
Older distributions cannot load the prebuilt LLVM |
libstdc++ |
3.4.30 or later |
Older distributions cannot load the prebuilt LLVM |
Note
The PyTorch and torch_npu versions must match. A torch_npu release is built against one specific PyTorch minor version and will fail to import against any other.
The pinned pair in requirements.txt (torch 2.7.1 with torch-npu 2.7.1.post8) is the
combination this project is tested with.
Install CANN¶
The Bisheng compiler is a built-in component of CANN and is distributed together with the CANN package without a standalone installer. The compiler takes AscendNPU IR as input and, after compilation and optimization, outputs executable binaries for Ascend NPUs, providing core support for this project’s build.
Go to the CANN quick installation page and follow the instructions to complete the installation.
Note: You must install the
toolkitdevelopment package, not just the runtime package. Thetoolkittargets development and compilation scenarios and supports the development and compilation of operators and applications; the runtime package targets inference and deployment scenarios and does not support source compilation.
After installation, source the environment script. The default root is /usr/local/Ascend:
source /usr/local/Ascend/ascend-toolkit/set_env.sh
This sets ASCEND_HOME_PATH, which later build steps rely on. Run the following command to
verify that the environment variable is set correctly:
echo $ASCEND_HOME_PATH
If the variable is empty, the script did not run correctly and the AscendNPU-IR and shmem builds will fail. You need to source this script in every new shell, so consider adding it to your shell profile.
Verify the driver can see your NPUs:
npu-smi info
Install PyTorch and torch_npu¶
Install a PyTorch build and the matching torch_npu plugin for your environment. See the Ascend Extension for PyTorch documentation for the compatibility matrix and installation options.
Install Python dependencies¶
From the repository root:
pip install -r requirements.txt
This installs the pinned torch and torch-npu pair, pybind11 for the Python bindings, and
the Python packages CANN itself expects (attrs, cython, numpy, decorator, sympy,
cffi, pyyaml, pathlib2, psutil, protobuf, scipy, requests, absl-py).
Note
requirements.txt pulls torch from the CPU wheel index. Device support comes from
torch_npu rather than from a device-specific torch build, so this is expected.
Verifying the environment¶
Before moving on, check that the base stack imports and sees your hardware:
python -c "import torch, torch_npu; print(torch.__version__, torch_npu.__version__); print(torch.npu.device_count())"
A device count of zero means torch_npu cannot reach the driver. Recheck npu-smi info and
confirm you sourced set_env.sh in the current shell.
Next steps¶
Build from Source to compile Triton-distributed-ascend and its dependencies.
Quick Start to run your first distributed kernel.