Obtaining Profile Data

Before performance optimization, you need to obtain accurate profile data, understand the performance status, and analyze the optimization direction. Ascend C provides multiple performance test methods, including board profiling and the pipeline chart for single-operator performance simulation.

Profiling on the Board

The following command is an example of collecting profile data on the board for an operator. You can flexibly combine the configuration parameters as required.

msprof --output="./out" --ai-core=on --aic-metrics="PipeUtilization" add_custom_npu 

The following is an example of some profile data files:

Figure 1 Example of the op_summary_{}.csv file

For details about the fields and tool usage, see Performance Tuning Tool User Guide .

Operator Simulation Pipeline

The msProf tool supports profile data collection and automatic parsing in a simulation environment. For details about how to obtain the simulation pipeline by using the msProf tool, see Instruction Pipeline.

The following figure is an example of the simulation instruction pipeline. Enter chrome://tracing in the address box of the Chrome browser, drag the trace.json pipeline file generated by the tool to the blank area, and press the shortcut keys (W: zoom in; S: zoom out; A: move left; D: move right) on the keyboard to view the pipeline.
Figure 2 trace.json summary file
Figure 3 trace.json subfile

In this document, the operator simulation pipelines displayed in some examples may be different from those actually displayed on the browser. However, the key fields in the pipelines are consistent. You can view the meanings of specific fields in the Instruction Pipeline.