Loading...
Loading...
Verify and build the required environment for Triton operator development on the Ascend platform, including configurations of dependencies such as CANN, Python/torch/torch_npu/triton-ascend and PATH environment variables. This is used when users need to configure the Triton operator development environment, check the installation of CANN/torch/triton-ascend, or verify whether the environment is available.
npx skill4agent add ascend/agent-skills triton-operator-env-config| 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 |
npu-smi infowhich bishengsource /usr/local/Ascend/cann/set_env.shsource /usr/local/Ascend/ascend-toolkit/set_env.shwhich python3export PATH="/usr/bin:$PATH"python3 --versionconda init bashuname -mwget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.shwget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shbash Miniconda3-latest-Linux-x86_64.shbash Miniconda3-latest-Linux-aarch64.shconda init bashconda create -n triton python=<official required version>conda activate tritonpip list | grep "torch"pip install torch==<official required version>ERROR: No matching distribution found for torch==2.7.1+cpupip install torch==2.7.1+cpu --index-url https://download.pytorch.org/whl/cpupip install torch_npu==<official required version>python3 -c "import torch; print(torch.__version__)"python3 -c "import torch; a = torch.randn(2, 3); print(a)"tensor([[2.86, 1.0406, 1.5811], [0.8329, 1.0024, 1.3639]])pip list | grep "triton"pip uninstall tritonpip install triton-ascendscripts/01-vector-add.pypython3 <skill-dir>/scripts/01-vector-add.pytensor([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| Symptom | Action |
|---|---|
| torch installation failed: No matching distribution found for torch==2.7.1+cpu | Try installing from the official PyTorch source: |
| Both native triton and triton-ascend are installed | Uninstall native triton first: |
| C++ compiler not found | Install the compiler: |
| Missing dependencies when compiling from source | Install system libraries: |
| Still failed after retrying according to the above table | Keep complete terminal error messages and the sequence of executed commands for local or subsequent troubleshooting |
npu-smi infowhich bisheng01-vector-add.py