AscendC Operator Code Generator

•
99
•

Generates high-performance AscendC operator implementations and PyTorch framework adaptations from design specifications.

This skill automates the transition from operator design to implementation for Huawei Ascend NPUs. By parsing a standardized design document, it intelligently selects optimal templates for various operator types—including Elementwise, Row-based, and Index-based operations—to generate both host-side tiling logic (op_host) and device-side kernel code (op_kernel). It also streamlines the framework integration process by automatically updating PyTorch registration schemas, C++ headers, and CMake configurations, ensuring developers can move quickly from mathematical design to a compiled and testable NPU operator.

主要功能

01Automated generation of op_host and op_kernel C++ source code
02Template-driven logic for Elementwise, Row, Index, Sorting, and Pooling operators
03Automatic PyTorch framework registration and schema declaration
04Hardware-aware tiling using official Ascend platform APIs for core and UB management
0599 GitHub stars
06Standardized precision handling for FP16/BF16 via FP32 up-casting templates

使用场景

01Rapidly implementing custom deep learning operators for Huawei Ascend hardware
02Integrating proprietary NPU kernels into the PyTorch ecosystem with minimal boilerplate
03Standardizing NPU operator development workflows across large AI engineering teams