Adaptation After Hardware Change

Context

This mode involves only TBE custom operators. AI CPU custom operators are independent from the Ascend AI Processor version.

If you have implemented a TBE custom operator that can work with Ascend AI Processor, you need to adapt the operator if the hardware is changed to a new version.

For example, the version of Ascend AI Processor was A and is changed to B.

Development Workflow

In this scenario, you need to modify the operator deliverables based on the original operator project. The following adaptation steps assume the CANN software environment and the original operator project are ready.

Figure 1 Hardware-based operator adaptation

An operator plugin maps operators developed based on a third-party framework to equivalents adapted to Ascend AI Processor, which is irrelevant to Ascend AI Processor version and requires no modification.

Table 1 Operator development workflow

Action

Description

See Also

Development preparations

Operator analysis

The major differences of the Ascend AI Processor versions are reflected in the following aspects:

  • Support for the compute APIs
  • Data type support and parameter denotations (if a compute API is supported)

Perform detailed analysis based on the compute APIs used during operator implementation.

See the corresponding description in API Reference.

Operator deliverable adaptation

Modify operator prototype definition

Modify operator prototype definition based on the differences between compute APIs obtained through operator analysis. Skip this step if the compute APIs of Ascend AI Processors are the same.

Operator Prototype Definition

Modify the operator implementation file

Modify the operator implementation file based on the differences between compute APIs obtained through operator analysis. Skip this step if the compute APIs of Ascend AI Processors are the same.

Operator Code Implementation (TBE DSL)

Operator Code Implementation (TBE TIK)

Add the operator information library

Add the operator information library corresponding to Ascend AI Processor.

Implement the operator information library file, which registers the operator information to the operator information library, including input and output data types, formats, and input shape of the operator.

TBE Operator Information Library

Operator build and deployment

Build the custom operator project to generate a custom OPP, install the OPP, and deploy the custom operators to the operator library.

Operator Building and Deployment

Operator ST

Perform ST to test the operator functionality in real-device environment.

Operator ST

Operator verification on network

Load the custom operator to a network model and execute it for verification.

Operator Verification on Network