api_statistic (API Duration Statistics)
The timeline information of API duration statistics is displayed at the CANN layer in the msprof_*.json file, and the summary information is summarized in the api_statistic_*.csv file to collect statistics on the API execution duration at the CANN layer, including AscendCL, Runtime, Node, Model, and Communication 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.
- Communication: Collective communication operators.
Availability
Atlas 200/500 A2 Inference Product
Atlas Inference Series Product
Atlas Training Series Product
Atlas A2 Training Series Product/Atlas 800I A2 Inference Product
Atlas A3 Training Series Product
Data at the CANN Layer in msprof_*.json
Data at the CANN layer in the msprof_*.json file mainly displays the time consumed by APIs running in the current thread, as shown in the following figure.

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.
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 |
Layer, which is AscendCL currently. |
api_statistic_*.csv File
The file content is formatted as follows.

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. For example, a lower variance indicates more stable operator execution. Operators are considered stable when the minimum and maximum values are close to the average, with no significant outliers.
Field |
Description |
|---|---|
Device_id |
Device ID. For data collected from the host, the value is host. |
Level |
Layer to which the API belongs. |
API Name |
API name. |
Time(us) |
Total duration, in μs. |
Count |
Number of calls. |
Avg(us) |
Average time consumption, in μs. |
Min(us) |
Minimum time consumption, in μs. |
Max(us) |
Maximum time consumption, in μs. |
Variance |
Time consumption variance. |