ops-math:基于 CANN 生态的数值计算基础算子库项目

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

Branch4Tags0
FilesLast commitLast update
4 days ago
4 days ago
5 days ago
3 days ago
4 days ago
4 days ago
3 days ago
4 days ago
3 days ago
4 days ago
4 days ago
5 months ago
4 days ago
4 months ago
1 month ago
3 months ago
23 days ago
3 months ago
4 days ago
1 month ago
4 days ago
1 year ago
1 month ago
14 days ago
4 days ago
6 months ago
4 days ago
8 months ago
6 months ago
3 months ago
11 days ago
3 days ago
6 months ago
4 days ago

ops-math

English | 简体中文

CANNcommunity repo license contributing SIG Zread


🔥Latest News

  • [2026/07] Added support for operators and new features of the Huawei Ascend 950 series, covering operators such as CumulativeLogSumExp, MatrixSetDiagV2, DropoutV3Grad, SignBitsUnpack, and ProdVirialSeA; introduced new features such as FLOAT8/FLOAT4 low-precision type support, Philox PRNG random number generation, and Reg API migration.
  • [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, and you can develop and debug them with the CANN Simulator simulation tool. A <<<>>> kernel heterogeneous invocation example is added to the add operator, making it convenient for you to customize and use it. Newly supported operators in multiple categories include concat, lerp, and drop_out_v3.
  • [2025/11] Improved the README descriptions of multiple operators, and improved the operator development sample documents and examples.
  • [2025/10] Added the experimental directory, improved the contribution guide, and enabled developers to debug and contribute custom operators.
  • [2025/09] The ops-math project went online for the first time.

🚀Overview

ops-math is a basic operator library that provides numerical computation in the CANN (Compute Architecture for Neural Networks) operator library. It includes conversion-class, math-class, and random-class operators, covering scenarios such as tensor shape transformation, basic mathematical operations, and random number generation. The position of the sub-library in the architecture diagram 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-math.git
git clone -b 9.0.0 https://gitcode.com/cann/ops-math.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 through GitCode Wiki.

Introduction

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

Customize your domain