triton-lang/triton-ascend
概要
Triton language and compiler for Huawei Ascend NPU
言語・ランタイム計測したスター増加
- 24時間
- 0
- 7日間
- +3
- 15日間
- +10
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルTriton Ascend
| Official Documentation | Operator Development User Journey | Community Meetings | About Huawei Ascend |
🔥 Latest News
- [2026.10.29] Triton Ascend 3.6.0.post2 official releases are now available
- [2026.10.15] Triton Ascend 3.2.2.post2 and 3.6.0 official releases are now available
- [2026.07.31] Triton Ascend 3.2.2 official release is now available
- [2026.04.30] Triton Ascend 3.2.1 official release is now available
- [2026.01.20] Triton Ascend 3.2.0 official release is now available
More latest news
- [2025.11.14] Triton Ascend 3.2.0rc4 pre-release is now available:
- Extended the tt.fp_to_fp interface to add FP8 type conversion support
- Added the scatter_ub_to_out interface to support efficient data scatter operations from UB to GM - [2025.09.30] Improved Scan/Sort Triton Python APIs, supporting non-contiguous memory access, and completed adaptation of key Triton operators in vLLM and SGLang open-source repositories
- [2025.09.19] Supported Triton Ascend nightly package extraction
- [2025.08.15] Improved Atomic-class Triton Python API support, completed adaptation of key Triton operators in the FlagGems open-source repository, and provided reference examples for high-performance implementations of simple operators such as Matmul
- [2025.06.30] Supported 85% of Triton Python APIs, supporting contiguous memory access, covering basic usage scenarios
- [2025.05.20] Triton Ascend is open-sourced, Gitcode repository is alive.
Introduction
Triton Ascend is an optimized version of Triton adapted for Huawei Ascend processors. It is used for efficient automatic kernel tuning, operator compilation, and deployment. By remaining compatible with Triton's core syntax while being deeply optimized for Huawei Ascend NPU features, it helps users quickly develop and deploy high-performance computing tasks on the Huawei Ascend platform.
📖 Quick Installation
Environment Preparation
Hardware Requirements
Supported operating systems: Linux (aarch64/x86_64)
Supported Huawei Ascend products: Atlas A2 products/Atlas A3 products/Ascend 950PR&950DT products
Minimum hardware configuration: single card with 32GB memory (recommended)
Software Dependencies
Determine and install the Python, CANN, and TorchNPU software versions. This step must be completed before both package installation and source code compilation installation.
Python version selection: py3.10-py3.13 are all supported.
CANN version selection: You can visit the Huawei Ascend community website and follow the community software installation guide to complete the CANN installation and configuration. It is recommended to download and install version 9.2.0.
TorchNPU version selection: The currently bundled TorchNPU version is 2.10.0.post7.
Accessing Huawei Ascend NPU
If you need to access Huawei Ascend NPU computing resources for development or testing, please visit the HiDevLab - Online Development page on the HiDevLab platform to apply for free access.
Quick Installation
# Taking the installation of triton-ascend 3.6.0 as an example
pip install triton-ascend --extra-index-url=https://mirrors.huaweicloud.com/ascend/repos/pypi
Nightly Build Installation
We provide weekly-updated nightly test packages. Use the command below to install:
pip install triton-ascend --extra-index-url=https://mirrors.huaweicloud.com/ascend/repos/pypi/nightly
Note: If a release version of
triton-ascendis already installed, pip may reportRequirement already satisfiedand keep the old version. Uninstall it first (pip uninstall -y triton-ascend triton) or pin the nightly version explicitly.
All nightly packages can be found in the package list.
Note: Nightly builds are for testing only and not intended for production.
Source Installation
More source installation
Install Dependencies
apt update
# Supported clang versions: clang-15, clang-17, clang-20.1.8
apt install zlib1g-dev clang-15 lld-15
apt install ccache # optional
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100
pip install ninja cmake wheel pybind11 # build-time dependencies
Build Triton Ascend
git clone https://github.com/triton-lang/triton-ascend.git && cd triton-ascend
git checkout main
pip install -e . --extra-index-url=https://repo.huaweicloud.com/repository/pypi/simple
Tip: Pass
--no-build-isolationtopip installto make nop builds faster.
Custom LLVM Build (Optional)
# If you need to customize the LLVM build process, you can execute this step first before compiling Triton Ascend
# Check out the specified version of LLVM source code and apply patches
git clone --no-checkout https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout f6ded0be897e2878612dd903f7e8bb85448269e5
wget https://raw.githubusercontent.com/triton-lang/triton-ascend/main/third_party/ascend/patch/llvm_patch_f6ded0b.patch
git apply llvm_patch_f6ded0b.patch
export LLVM_INSTALL_PREFIX=/path/to/llvm-install
# Build a custom LLVM version
cd {PATH_TO}/llvm_project
mkdir build
cd build
cmake ../llvm \
-G Ninja \
-DCMAKE_C_COMPILER=/usr/bin/clang-15 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 \
-DCMAKE_LINKER=/usr/bin/lld-15 \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS="mlir;llvm;lld" \
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" \
-DLLVM_ENABLE_LLD=ON \
-DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL_PREFIX}
ninja install
# Compile Triton Ascend
git clone https://github.com/triton-lang/triton-ascend.git && cd triton-ascend
LLVM_SYSPATH=${LLVM_INSTALL_PREFIX} \
TRITON_BUILD_WITH_CCACHE=true \
TRITON_BUILD_WITH_CLANG_LLD=true \
TRITON_BUILD_PROTON=OFF \
TRITON_WHEEL_NAME="triton-ascend" \
TRITON_APPEND_CMAKE_ARGS="-DTRITON_BUILD_UT=OFF" \
python3 setup.py install
Verify the Installation
Run:
python3 -c "import triton.backends.ascend as ascend;print('triton-ascend version:', ascend.__version__)"
If the output is:
triton-ascend version: <version>
Triton Ascend is installed successfully.
Docker Image Usage
More Docker image usage
We provide a Dockerfile to help you install the Docker environment image. The build process uses the
quay.io/ascend/cannpre-built image as the base image, skipping the CANN installation step and significantly speeding up the build.You need to specify the
CANN_BASE_IMAGEparameter via--build-argto select the appropriate CANN base image for your machine. Available CANN base image tags can be found at quay.io/ascend/cann.You can check the NPU model on your system using the npu-smi command.
git clone https://github.com/triton-lang/triton-ascend.git && cd triton-ascend
docker build \
--build-arg CANN_BASE_IMAGE=quay.io/ascend/cann:9.1.0-a3-ubuntu22.04-py3.12 \
-t triton-ascend-image:latest -f ./docker/Dockerfile .
- To start a container from this image, you can refer to the following command:
docker run -u 0 -dit --shm-size=512g --name=triton-ascend_container \
--security-opt seccomp=unconfined \
--device=/dev/davinci0 \
--device=/dev/davinci_manager \
--device=/dev/devmm_svm \
--device=/dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/sbin/npu-smi:/usr/local/sbin/npu-smi \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /home:/home \
-v /etc/ascend_install.info:/etc/ascend_install.info \
triton-ascend-image:latest \
/bin/bash
# Enter the container
docker exec -u root -it triton-ascend_container /bin/bash
✏️ Documentation Entry
🏘️ Community Activities
🤝 Community and Contribution
Welcome to participate in Triton Ascend development and code contribution. For details, please refer to the Contribution Guide
Please report any bugs you encounter via Issue.
関連プロジェクトを探す
読み込み中…