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. In the example, --output is optional, which is used to specify the path for storing the collected profile data. $HOME/projects/MyApp/out/main is the operator executable file.
msprof op --output=$HOME/projects/output $HOME/projects/MyApp/out/main
The following is an example of some profile data files:
For details about the fields and tool usage, see on-board profile data collection.
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 two visualization modes are supported:
- Google Chrome
Enter the chrome://tracing address in the address box of Google Chrome, drag the instruction pipeline file (trace.json) generated by msprof op simulator to the blank area, and press the shortcut keys on the keyboard (W: zoom in; S: zoom out; A: move left; D: move right) to view the file.

- The instruction pipeline can be visualized on the MindStudio Insight tool. MindStudio Insight provides the running status of instructions on the Ascend AI Processor in a sequence diagram. Users can identify the sequence optimization points of micro instructions by analyzing the instruction details, instruction execution time, call stack of the code associated with the instruction, and synchronization lines between instructions and pipelines in the sequence diagram.
Figure 2 Timeline page
