Querying Profile Data File Information

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

Queries profile data file information, including the iteration ID and model ID.

Precautions

Before calling the query API, call the import command to parse the profile data. Otherwise, the query result is meaningless.

Command Format

python3 msprof.py query -dir <dir> 

Command-line Options

Table 1 Command-line options

Option

Description

Optional/Required

-dir, or --collection-dir

Directory of collected profile data. The value must be PROF_XXX or the parent directory of PROF_XXX.

Example: /home/profiler_data/PROF_XXX.

Required

--data-type

Type of data to be profiled. This parameter is used for interconnection with MindStudio and does not need to be configured. Possible values are as follows:

  • 0: cluster scenario. You can query whether the current data is collected in the cluster scenario.
  • 1: iteration trace data, that is, detailed data of each iteration, including the FP/BP elapsed time, iteration refresh hangover time, and iteration interval.
  • 2: calculation amount, that is, the number of floating-point operations on the AI Core.
  • 3: data preparation, including training data sending to the device and training data reading on the device.
  • 4: parallelism optimization suggestion.
  • 5: parallelism data, including the pure communication duration and computation duration.
  • 6: slow card and slow link data and optimization suggestion.
  • 7: communication matrix data and optimization suggestion.
  • 8: CPU and memory performance metrics of the system and processes on the host.
  • 9: communication duration with critical path analysis.
  • 10: communication matrix with critical path analysis.

Optional

--id

Rank ID of a cluster node in the cluster scenario, and device ID in the non-cluster scenario.

This parameter is used for interconnection with MindStudio and does not need to be configured.

Optional

--model-id

Model ID.

This parameter is used for interconnection with MindStudio and does not need to be configured.

Optional

--iteration-id

Iteration ID for graph-based statistics collection. (The iteration ID is incremented by 1 each time a graph is executed. When a script is compiled into multiple graphs, the iteration ID is different from the step ID at the script layer.) The default value is 1.

This parameter is used for interconnection with MindStudio and does not need to be configured.

Optional

-h or --help

Help information.

Optional

Example

  1. Log in to the environment where the Toolkit package is installed.
  2. Switch to the directory where the msprof.py script is located.

    ${INSTALL_DIR}/tools/profiler/profiler_tool/analysis/msprof. Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.

  3. To query the profile data information, run the following command.
    python3 msprof.py query -dir /home/profiler_data/PROF_XXX

Output Description

After the command for querying profile data is executed, the results will be printed and displayed.

Table 2 describes the information obtained by the query function of the msprof tool.

Table 2 Profile data file information

Field

Description

Job Info

Job name.

Device ID

Device ID.

Dir Name

Folder name.

Collection Time

Profiling time.

Model ID

Model ID.

Iteration Number

Total number of iterations.

Top Time Iteration

Top five iterations with the longest time consumptions.

Rank ID

Node ID in the cluster scenario.