Verifying the Running of Operators

Overview

The samples repository of the Ascend open-source community provides a range of custom operator functionality verification samples. The main principle is to convert a custom operator into a single-operator offline model file and then load and run the model using AscendCL.

The generation of a single-operator model file requires only the operator implementation file, operator prototype definition, and operator information library, but does not require an operator plugin.

Sample List

The available custom operator verification samples are listed as follows.

Table 1 Custom operator verification samples

Sample

How to Obtain

Description

Instructions

(EP Host)

(Atlas 200 DK)

acl_execute_add

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_add directory.

Verify the functionality of the TBE operator Add in Developing Custom Operators by converting the custom operator to a single-operator offline model file and loading the model file using AscendCL.

Refer to the readme file.

acl_execute_conv2d

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_conv2d directory.

Verify the functionality of the TBE operator Conv2dTik in Developing Custom Operators by converting the custom operator to a single-operator offline model file and loading the model file using AscendCL.

Refer to the readme file.

acl_execute_matmul

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_matmul directory.

Verify the functionality of the TBE operator MatmulTik in Developing Custom Operators by converting the custom operator to a single-operator offline model file and loading the model file using AscendCL.

Refer to the readme file.

acl_execute_reshape

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_reshape directory.

Verify the functionality of the AI CPU operator ReshapeCust in Developing Custom Operators by converting the custom operator to a single-operator offline model file and loading the model file using AscendCL.

Refer to the readme file.

acl_execute_addblockcust

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample in the cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_addblockcust directory.

For AI CPU operator addblockcust in Developing Custom Operators:

Verify the functionality of the operator by converting the custom operator to a single-operator offline model file and then loading and running the model file using AscendCL.

Refer to the readme file.

Download the sample code to any directory in the development environment and ensure that the running user of the development environment has the read and write permissions on the sample directory.