Profiling AI Tasks When They Are Running

Function

msprof supports profiling of AI tasks when they are running. After the profiling, it automatically parses the profile data and flush corresponding files to disks.

Command Format

For Ascend EP, log in to the operating environment and run the command in any directory.
msprof [options] <app>
For Ascend RC, log in to the operating environment, go to the /var directory where msprof is installed, and run the command.
./msprof [options] <app>

app is mandatory. For details about the parameters, see app Parameters. For details about the options, see Command-line Options.

Command-line Options

Example

For Ascend EP, log in to the operating environment and run the following command in any directory:
msprof --output=/home/projects/output --ascendcl=on --runtime-api=on --task-time=on --aicpu=on --ai-core=on /home/projects/MyApp/out/main

Find the PROF_XXX directory generated in the directory specified by --output to store the automatically parsed profile data. For details about the result files, see Profile Data File References.

For Ascend RC, log in to the operating environment, go to the /var directory where msprof is installed, and run the following command:
./msprof --output=/home/projects/output --ascendcl=on --runtime-api=on --task-time=on --aicpu=on --ai-core=on /home/projects/MyApp/out/main

The PROF_XXX directory is generated in the directory specified by --output. The files in this directory cannot be viewed without being parsed. You need to upload the PROF_XXX directory to the development environment for data parsing. For details, see Using the msprof Command to Parse, Query, and Export the Profile Data.