ops-nn_9495:基于 CANN 生态的神经网络高阶算子库项目

本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。

Branch15Tags16
FilesLast commitLast update
3 days ago
1 day ago
2 days ago
1 day ago
3 days ago
1 day ago
1 day ago
3 days ago
1 day ago
1 day ago
3 days ago
1 day ago
1 day ago
1 day ago
1 day ago
1 day ago
1 day ago
1 day ago
1 day ago
3 days ago
3 days ago
1 day ago
1 day ago
3 months ago
2 months ago
2 months ago
3 days ago
3 months ago
3 days ago
25 days ago
17 days ago
3 days ago
1 year ago
2 months ago
1 month ago
3 days ago
3 months ago
3 days ago
8 months ago
8 months ago
4 days ago
2 days ago
22 days ago
3 days ago
3 months ago
1 month ago
7 days ago

ops-nn

English | 简体中文

CANNcommunity repo license contributing SIG Zread


🔥Latest News

  • [2026/05] Optimized the kernel compilation configuration items and reduced the simplified_key and ascendc_config configuration files (!3330).
  • [2026/05] Introduced ops-tensor, optimized Cube-class operators based on a layered structure, reduced offset computation, and simplified instruction parameters (!5036).
  • [2026/05] Released the accuracy acceptance criteria for ecosystem operators (!4572).
  • [2026/03] Open-source operators support the next-generation chip: Ascend950PR (!450).
  • [2026/03] Added operator development samples for <<<>>> (!620).
  • [2026/03] Low-bit operators and fused operators support more data types, such as fp8/mxfp8/hifp8/mxfp4, and support different quantization modes and combinations, including pertensor/perchannel/pertoken/pergroup/perblock: full quantization fused operator: quant_batch_matmul_v4, pseudo-quantization fused operator: weight_quant_batch_matmul_v2.
  • [2026/03] Supported the new homogeneous programming operator implementation for SIMD/SIMT: [MapIndex] (#660), [ScatterSub] (#710).
  • [2026/01] Added QuickStart, which guides beginners to get started with operator project deployment from scratch (Docker environment supported) and with the operator development and contribution workflows.
  • [2025/12] Open-source operators support the Ascend 950PR&950DT products/KirinX90, and you can develop and debug them with the NPU Simulator simulation tool. Optimization guide documents are improved, focusing on the operator development guide, clarifying the minimum deliverables and key sample code, and providing guidance for migrating operators from the Ascend/samples repository to this project. The newly supported sparse 4:2 quantization matmul operator enables hardware acceleration for sparse matrices.
  • [2025/11] Newly supported operators: index_fill, masked_scatter, scatter, tf_scatter_add, fused_cross_entropy_loss_with_max_sum.
  • [2025/10] Added the experimental directory and improved the contribution guide, so that developers can debug and contribute custom operators.
  • [2025/09] The ops-nn project went online for the first time, with open-source operators supporting the Atlas A2/A3 products.

🚀Overview

ops-nn is a high-level operator library in the CANN (Compute Architecture for Neural Networks) operator library that provides neural network computation capabilities. It includes matmul-class, activation-class, and other operators. The architecture of the operator library is as follows:

Architecture diagram

📌Version Compatibility

The source code of this project is released together with CANN software versions. For the mapping between CANN software versions and the tags of this project, refer to the corresponding version notes in the release repository. Note that to ensure smooth custom development based on the source code, select a compatible CANN version and GitCode tag source code. Using the master branch may cause version mismatch risks.

🛠️Environment Preparation

Environment deployment is a prerequisite for experiencing the capabilities of this project. Install the NPU driver and CANN package first, and ensure the environment works properly.

⬇️Source Code Download

After the environment is ready, download the branch source code that matches the CANN version. The general command is as follows, where ${tag_version} is replaced with the branch tag name. The following uses the download of the 9.0.0 branch source code as an example:

# General command: git clone -b ${tag_version} https://gitcode.com/cann/ops-nn.git
git clone -b 9.0.0 https://gitcode.com/cann/ops-nn.git

Note: If the matching branch source code already exists in the environment, you can skip this step. For example, CANNLab provides the source code corresponding to the latest CANN version by default.

📖Learning Tutorials

  • Quick start: Quickly experience the core basic capabilities of the project from scratch, covering source code compilation, operator invocation, development, debugging, and other operations.
  • Advanced tutorials: If you need to deeply understand project compilation and deployment, operator invocation, development, debugging and tuning, and other capabilities, go to the documentation center for detailed guidance.

PS: The features and documentation of this project are continuously updated and improved. Stay tuned for the latest version.

  • Issue feedback: Submit issues through GitCode Issues.
  • Community interaction: Join discussions through GitCode Discussions.
  • Technical column: Read technical articles, such as serial tutorials and best practices, through GitCode Wiki.

Introduction

本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。

Customize your domain