Operator Information Library Definition

Principle

The operator information library is one of the deliverables for operator development. It mainly describes the implementation specifications of an operator on the Ascend AI Processor, including the input and output types and names of the operator. During network execution, basic verification is performed based on the operator information in the operator information library, in addition to operator mapping.

Description

Go to the cpukernel/op_info_cfg/aicpu_kernel directory and configure the operator information library file reshape_cust.ini. You need to modify the reshape_cust.ini file automatically generated by MindStudio. The following shows the operator information library definition of the modified ReshapeCust operator.

[ReshapeCust]
opInfo.engine=DNN_VM_AICPU
opInfo.flagPartial=False
opInfo.computeCost=100
opInfo.flagAsync=False
opInfo.opKernelLib=CUSTAICPUKernel
opInfo.kernelSo=libcust_aicpu_kernels.so
opInfo.functionName=RunCpuKernel
opInfo.workspaceSize=1024

Table 1 describes the parameters. The following table lists only the common configuration options of the operator information library. For details about other configuration options, see "Operator Development > Operator Information Library Definition > AI CPU Operator Information Library" in the Operator Development Guide.

Table 1 Operator information library definition of the ReshapeCust operator

Information

Configuration Option

Description

[OpType]

[ReshapeCust]

Operator type, which is included in brackets to mark the start of operator information. The operator type is ReshapeCust according to Operator Analysis.

opInfo.engine

DNN_VM_AICPU

Operator engine.

Fixed to DNN_VM_AICPU for AI CPU custom operators.

opInfo.flagPartial

False

Reserved, fixed to False.

opInfo.computeCost

100

Reserved, fixed to 100.

opInfo.flagAsync

False

Reserved, fixed to False.

opInfo.opKernelLib

CUSTAICPUKernel

kernelLib called by the operator.

Fixed to CUSTAICPUKernel for AI CPU custom operators.

opInfo.kernelSo

libcust_aicpu_kernels.so

Name of the .so file generated after the AI CPU operator is built.

opInfo.functionName

RunCpuKernel

Name of the kernel function called by the custom operator.

Fixed to RunCpuKernel for AI CPU custom operators.

opInfo.workspaceSize

1024

Reserved.

Memory space used for temporary operator computation.

The unit is KB, and the value range is 0–1048576 (1 GB).

Recommended value: 1024