Core Principles
Environment checks must be performed in order, and each step depends on the success of the previous step.
Prerequisite Step: Obtain the Latest Compatibility Requirements (MANDATORY)
Compatible versions may be updated, so the latest official documentation must be obtained first.
MANDATORY - READ ENTIRE PAGE: Access and read the official online documentation in full https://triton-ascend.readthedocs.io/zh-cn/latest/quick_start.html and https://triton-ascend.readthedocs.io/zh-cn/latest/installation_guide.html,获取最新的:
- Python version requirements
- torch / torch_npu version requirements
- triton-ascend version requirements
- CANN version requirements
- Version correspondence among components
The version requirements in the documentation shall prevail, and update the version numbers in the subsequent steps accordingly.
The following version correspondence is for reference only (as of 2026-03-26); the online documentation shall prevail:
| Triton-Ascend Version | CANN Version | Release Date |
|---|---|---|
| 3.2.0 | 8.5.0 (Recommended) | 2026/01/16 |
| 3.2.0rc4 | 8.3.RC2 | 2025/11/20 |
torch_npu version (for reference only): 2.7.1
⚠️ If the versions in the online documentation are inconsistent with the table above,the online documentation must prevail。
Environment Check and Configuration Process
1. CANN Environment Configuration (First Step)
The CANN environment must be checked first
- Execute
npu-smi info, and check whether the driver is loaded successfully - Then execute
which bisheng, and check whether the CANN environment is loaded successfully and the npuir compiler is obtained; a path should be output - If there is no output, try to load the CANN environment:
- Preferred:
source /usr/local/Ascend/cann/set_env.sh - Alternative:
source /usr/local/Ascend/ascend-toolkit/set_env.sh
- Preferred:
- Execute steps 1 and 2 again for the check. If it is still unsuccessful, the user needs to check and resolve the CANN environment configuration; you can remind them to go tohttps://www.hiascend.com/cann/download to download and install CANN
2. Python Version Check
If you encounter Python issues, the top priority is to use miniconda to create an environment to resolve them
- Check the path of the current python:
which python3 - If it fails, try to execute:
export PATH="/usr/bin:$PATH" - Execute step 1 for the check again. If it is still unsuccessful, remind the user to install Python; for the installation method, give priority to the miniconda method below
- If python3 exists, check the Python version:
python3 --version, subject to the requirements in the official quick_start.md documentation
3. Python Environment Installation (As Needed)
- If the user needs to install a Python environment, first use
conda init bashto check whether a conda environment exists. If yes, skip to step 5; if not, execute step 2 for installation - Execute
uname -mto confirm the current system architecture If the system architecture is aarch64, execute:wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.shIf the system architecture is x86_64, execute:wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - Execute the installation script:
bash Miniconda3-latest-Linux-x86_64.shorbash Miniconda3-latest-Linux-aarch64.sh, install according to the prompts, and then activate the miniconda environment - Check whether the miniconda environment is installed successfully:
conda init bash - Create a Python environment and execute:
conda create -n triton python=<官方要求版本> - Activate the Python environment and execute:
conda activate triton
4. torch Configuration
All previous steps must be successful
- Execute:
pip list | grep "torch" - Check the torch / torch_npu versions, and use the requirements in the official documentation as the standard
- If the versions do not meet the requirements, install according to the versions in the documentation:
- First install torch:
pip install torch==<官方要求版本> - If an error is reported
ERROR: No matching distribution found for torch==2.7.1+cpu, try:pip install torch==2.7.1+cpu --index-url https://download.pytorch.org/whl/cpu - Then install torch_npu:
pip install torch_npu==<官方要求版本>
- First install torch:
- Check whether the torch environment is configured successfully:
python3 -c "import torch; print(torch.__version__)" - Run a simple torch code to check whether the npu device is loaded successfully:
python3 -c "import torch; a = torch.randn(2, 3); print(a)", the output should be similar to:tensor([[2.86, 1.0406, 1.5811], [0.8329, 1.0024, 1.3639]])
5. triton-ascend configuration
- Execute:
pip list | grep "triton" - Community Triton and Triton-Ascend cannot coexist:
- If the native triton is installed, it must be uninstalled first:
pip uninstall triton - If triton-ascend is also installed, it also needs to be uninstalled first, then reinstalled
- If the native triton is installed, it must be uninstalled first:
- Install the latest triton-ascend package:
pip install triton-ascend - If you need to install the nightly version, refer to:https://triton-ascend.readthedocs.io/zh-cn/latest/installation_guide.html#nightly-build
Environment verification (MANDATORY)
Used to confirm that the current terminal environment can normally execute triton operators.
MANDATORY - READ ENTIRE FILE: Before performing verification, you must fully read scripts/01-vector-add.py。
Perform verification:
python3 <skill-dir>/scripts/01-vector-add.py
After executing this operator example, if a result similar to this appears, it indicates that its computation meets expectations, and if difference is 0.0, it is considered verification passed:
tensor([0.8329, 1.0024, 1.3639, ..., 1.0796, 1.0406, 1.5811], device='npu:0')
tensor([0.8329, 1.0024, 1.3639, ..., 1.0796, 1.0406, 1.5811], device='npu:0')
The maximum difference between torch and triton is 0.0
Troubleshooting
| Symptom | Action |
|---|---|
| torch installation failed: No matching distribution found for torch==2.7.1+cpu | Try installing from the official PyTorch source:pip install torch==2.7.1+cpu --index-url https://download.pytorch.org/whl/cpu |
| Both native triton and triton-ascend are installed | First uninstall native triton:pip uninstall triton, then reinstall triton-ascend |
| C++ compiler not found | Install the compiler:apt-get install g++ |
| Missing dependencies when compiling from source is required | Install system libraries:sudo apt install zlib1g-dev clang-15 lld-15(recommended clang >= 15, lld >= 15) |
| Retried according to the table above but still failed | Keep the complete terminal error and the sequence of executed commands for local or subsequent troubleshooting |
Anti-pattern checklist (NEVER)
- ❌ Skip reading the official online documentation to obtain the latest matching requirements
- ❌ Skip the CANN environment check and directly configure Python
- ❌ Use Python / torch versions that do not meet the official requirements
- ❌ Install native triton and triton-ascend at the same time
- ❌ Start development without performing environment verification
- ❌ Execute step by step in different terminal sessions (must be in the same terminal)
Checklist
- Have you read the official online documentation to obtain the latest matching requirements?
- Is the CANN environment loaded successfully (npu-smi info and which bisheng have output)?
- Does the Python version meet the official requirements?
- Do the torch / torch_npu versions meet the official requirements?
- Is triton-ascend installed (native triton uninstalled)?
- Has environment verification passed (01-vector-add.py ran successfully)?
Notes
- If there are still problems after the above process, you can check the official online documentation to see whether there are new matching requirements:https://triton-ascend.readthedocs.io/zh-cn/latest/quick_start.html