Sample Reference

Sample Obtaining and Using

Feature

How to Obtain

Availability

Constructing a graph and building it into an offline model

Click Gitee or Github to obtain the sample. For details, see the README execution sample.

Atlas 200/300/500 Inference Product: supported

Atlas Training Series Product: supported

Constructing a graph and directly building and running the graph

Click Gitee or Github to obtain the sample. For details, see the README execution sample.

Atlas 200/300/500 Inference Product: not supported

Atlas Training Series Product: supported

Modifying the Tile+Concat graph structure to the Concat+Tile+Concat graph structure using a custom pass

Click Gitee to obtain the sample. For details, see the README execution sample.

Atlas 200/300/500 Inference Product: supported

Atlas Training Series Product: supported

Modifying the MatMul+Add graph structure to the GEMM graph structure using a custom pass

Click Gitee to obtain the sample. For details, see the README execution sample.

Atlas 200/300/500 Inference Product: supported

Atlas Training Series Product: supported

Modifying a subgraph using a custom pass

Click Gitee to obtain the sample. For details, see the README execution sample.

Atlas 200/300/500 Inference Product: supported

Atlas Training Series Product: supported

Precautions for Using the Build Script

The sample provides a build script, which requires only few manual tweaks to the following variables.

  • ASCEND_PATH: /ascend-toolkit/latest/ in the Ascend-CANN-Toolkit installation path.
  • INCLUDES: header files to be included. Append new header files (if any) to the existing lines. Do not delete the existing lines. If the network contains a custom operator, include the header file of its prototype definition.
  • LIBS: libraries to be linked. Append new libraries (if any) to the existing lines. Do not delete the original lines.

    Do not link with other .so files in the runfile, as this may cause compatibility problems during version upgrade.

Environment Variables for Running an Application

After the CANN software is installed, when you build and run your application as the CANN running user, log in to the environment as the CANN running user and run the source ${install_path}/set_env.sh command to set environment variables. {install_path} indicates the CANN installation path, for example, /usr/local/Ascend/ascend-toolkit.

This section only provides the environment variables required for running applications. For the full list of environment variables, see Environment Variables.