Custom Operators

View Source On Gitee

When built-in operators cannot meet requirements during network development, you can use MindSpore's custom operator functionality to integrate your operators. Currently, MindSpore provides two approaches for integrating custom operators:

Interface Comparison

Custom Primitive

CustomOpBuilder

Supported Modes

Graph Mode and PyNative Mode

PyNative Mode

Interface Functions

Provides a unified Custom Primitive that calls user interfaces at various stages of operator execution.

Compiles and loads custom operator modules online, which can be directly applied to networks.

Advantages

Supports both Graph and PyNative mode , with operator scheduling and execution processes consistent with built-in operators, ensuring high performance.

Enables operator development based on C++ tensors, offering a more intuitive custom execution process.

Disadvantages

Has more interface restrictions, and the operator execution process is not visible to users.

Involves multiple interfaces for operator development; currently lacks a concise and efficient C++ API, making the development of high-performance operators challenging.

Feature Level

STABLE

BETA