aclGenGraphAndDumpForOp

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Builds a graph of a single-operator, dumps the graph, and generates a .txt file. The graph refers to the structure of the intermediate representation (IR) operator. During the build, the graph refreshes continuously due to fusion and partitioning in order to adapt the graph expressed by the user to AI processor for higher performance.

Application scenario: You can call this API to build a graph of a single-operator and dump the graph to a .txt file as one of the input data sources for operator tuning.

Prototype

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
aclError aclGenGraphAndDumpForOp(const char *opType,
int numInputs,
const aclTensorDesc *const inputDesc[],
const aclDataBuffer *const inputs[],
int numOutputs,
const aclTensorDesc *const outputDesc[],
aclDataBuffer *const outputs[],
const aclopAttr *attr,
aclopEngineType engineType,
const char *graphDumpPath,
const aclGraphDumpOption *graphDumpOpt)

Parameters

Parameter

Input/Output

Description

opType

Input

Pointer to the operator type name.

numInputs

Input

Number of input tensors.

inputDesc

Input

Pointer array of the operator input tensor description. For details about the type definition, see aclTensorDesc.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

The array length must be consistent with numInputs. The elements in the inputs array must match those in the inputDesc array with ordering preserved.

inputs

Input

Pointer array of the operator input tensor. For details about the type definition, see aclDataBuffer.

Call aclCreateDataBuffer to create data of the aclDataBuffer type in advance.

The array length must be consistent with numInputs. The elements in the inputs array must match those in the inputDesc array with ordering preserved.

numOutputs

Input

Number of output tensors.

outputDesc

Input

Pointer array of the operator output tensor description. For details about the type definition, see aclTensorDesc.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

The array length must be consistent with numOutputs. The elements in the outputs array must match those in the outputDesc array with ordering preserved.

outputs

Input

Pointer array of the operator output tensor. For details about the type definition, see aclDataBuffer.

Call aclCreateDataBuffer to create data of the aclDataBuffer type in advance.

The array length must be consistent with numOutputs. The elements in the outputs array must match those in the outputDesc array with ordering preserved.

attr

Input

Pointer to the operator attributes. For details about the type definition, see aclopAttr.

Call aclopCreateAttr to create data of the aclopAttr type in advance.

engineType

Input

Operator execution engine. For details about the type definition, see aclopEngineType.

graphDumpPath

Input

Pointer to the path for saving the dumped single-operator graph (.txt). For details about the type definition, see aclGraphDumpOption.

The path must be created in advance. If the file name is not specified in the path, the file name is specified by the API.

If you specify the same directory, including the file name, for multiple dump operations, the latest file overwrites the previous file.

graphDumpOpt

Input

Pointer to the dump option of the single-operator graph.

Reserved. You can only pass nullptr to this parameter.

Returns

0 on success; else, failure. For details, see aclError.