api_statistic (API Duration Statistics)

The timeline information of API duration statistics is displayed at the CANN level in the msprof*.json file, and the summary information is summarized in the api_statistic_*.csv file to collect statistics on the execution time of APIs at the CANN level, including AscendCL, Runtime, Node, Model, and HCCL APIs.

  • AscendCL: AscendCL APIs, namely C language API library for developing DNN applications on the Ascend platform.
  • Runtime: Runtime APIs, namely CANN Runtime APIs.
  • Node: CANN operators.
  • Model: Used for internal analysis and can be ignored.
  • HCCL: Collective communication operators.

Availability

Atlas 200/300/500 Inference Product

Atlas Training Series Product

Data at CANN Level in msprof_*.json

Data at the CANN level in the msprof_*.json file mainly displays the time consumed by APIs running in the current thread, as shown in the following figure.

Figure 1 CANN layer data

By observing the timeline blocks in the figure, you can identify APIs with longer response time. Additionally, you can click to select the API with the longest response time to access its detailed information, as shown in the following figure.

Table 1 Field description

Field

Description

Title

Name of an API.

Start

Start point on the timeline, which is automatically aligned with that in chrome trace (ms).

Wall Duration

Time taken by the calls to an API (ms).

Self Time

Execution time of the current API (ms).

Mode

AscendCL API type, which can be ACL_OP (single-operator model API), ACL_MODEL (model API), and ACL_RTS (Runtime API).

level

Level. At the AscendCL level currently.

api_statistic_*.csv File

The file content is formatted as follows.

Figure 2 api_statistic_*.csv

In the preceding figure, operators are sorted in descending order based on the Time column. You can find the top N operators with the longest time consumptions, and determine whether the operators run stably or whether a call takes a long time based on the maximum, minimum, and average time consumptions, and variance.

Table 2 Field description

Field

Description

Device_id

Device ID.

Level

API level

API Name

API name.

Time(us)

Total duration (μs).

Count

Number of calls.

Avg(us)

Average time consumption (μs).

Min(us)

Minimum time consumption (μs).

Max(us)

Maximum time consumption (μs).

Variance

Time consumption variance.