Overview
Ascend 310 provides a deep-learning framework that converts models under open-source frameworks such as Caffe and TensorFlow into models supported by Ascend 310. During model conversion, if operators in the models are not implemented in the built-in operator library, an error is reported during the conversion. In this case, the operators that are not implemented need to be customized. The custom operators can be added to the custom operator library to allow successful model conversion. You can also optimize existing operators in the current model, add the optimized operators to the custom operator library, and load the optimized operators for model conversion.
Ascend 310 provides the Tensor Engine (TE) operator development framework for developing custom operators. TE is a custom operator development framework based on the Tensor Virtual Machine (TVM). It provides the DSL language based on the Python syntax for developing custom operators. Custom TE operators can run on the AI CPU and AI Core.
This document describes the development process of a custom Tensor Engine (TE) operator in command line interface (CLI) mode by using the custom caffe_reduction_layer operator (which is an extended built-in reduction operator in the Caffe network model LeNet-5) as an example. The process includes how to develop a custom TE operator, verify the operator, register the operator, and load the custom operator for model conversion.
Table 1 describes the custom TE operator development modes supported by Ascend 310. This document describes only the development in command line interface (CLI) mode.
Development Mode |
Tool Dependency |
Description |
Compilation Mode |
Reference Document |
---|---|---|---|---|
CLI |
This mode does not depend on Mind Studio. It only requires the device development kit (DDK) installation.
NOTE:
The DDK provides the NPU-based digital development kit that contains project code samples and integrates related dependent libraries and header files. You can compile project files by using Makefile. |
There is no UI or automatically generated framework code. The implementation code of all operators and operator plug-in code need to be developed by users or modified based on code samples in the DDK. |
The Makefile file is compiled based on the DDK code sample. |
TE Custom Operator Development Guide |
Mind Studio |
This mode depends on Mind Studio. The following figure shows the operation entry. |
The framework code is automatically generated based on the model file imported during project creation and selected operators. You only need to pay attention to the operator implementation code. |
The Makefile file does not need to be compiled because it is generated based on the configurations on Mind Studio. |
Ascend 310 TE Custom Operator Development Guide (Mind Studio) |

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot