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
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.
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 |
Level. At the AscendCL level 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.
|
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. |