Device Information Acquisition

Tool Introduction

After profile data collection is complete, you can use the get_msprof_info.py script tool to obtain device information from the device_{id} or host directory under the PROF_XXX directory. The following table describes the functionality and path get_msprof_info.py.

Table 1 Script description

Script Name

Functionality

Path

get_msprof_info.py

Obtaining device information

${INSTALL_DIR}/tools/profiler/profiler_tool/analysis/interface. Replace ${INSTALL_DIR} with the actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest.

Procedure

  1. Log in to the environment where the Ascend-CANN-Toolkit is located as the running user.
  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 actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest.

    Quick tip: Create an alias for the msprof.py script with the command alias msprof_analysis='python3 msprof.py_script_directory' as the running user. Then, you can start profiling with the shortcut msprof_analysis in any directory. This operation takes effect only in the current window.

  3. Run the get_msprof_info.py script. An example command is as follows:
    • Non-cluster scenario
      python3 get_msprof_info.py -dir /home/1/PROF_000001_20220129014731273_KEDKPORHMAGPGD/device_0
    • Cluster scenario
      python3 get_msprof_info.py -dir /home/1/
    Table 2 Command-line options

    Option

    Description

    Required/Optional

    -dir, --collection-dir

    Directory of collected profile data. In a non-cluster scenario, set this parameter to the host or device_{id} directory under PROF_XXX. In a cluster scenario, set this parameter to the parent directory of PROF_XXX.

    Required

    -h, --help

    Help information.

    Optional

  4. View the output.

    In a non-cluster scenario, the output is displayed on a screen, as shown in Figure 1. Table 3 describes corresponding fields. In a cluster scenario, the /query/cluster_info.json file is generated in the directory specified by -dir to store information about each node, as shown in Figure 2. Table 4 describes corresponding fields.

    Figure 1 Device information (non-cluster scenario)
    Table 3 Field description (non-cluster scenario)

    Field

    Description

    collection_info

    Information collection.

    Collection end time

    End time of information collection.

    Collection start time

    Start time of information collection.

    Result Size

    Size of the information data, in MB.

    device_info

    Device information.

    AI Core Number

    Number of AI Cores.

    AI CPU Number

    Number of AI CPUs.

    Control CPU Number

    Number of Ctrl CPUs.

    Control CPU Type

    Ctrl CPU Type.

    Device Id

    Device ID.

    TS CPU Number

    Number of TS CPUs.

    host_info

    Host information.

    cpu_info

    Host CPU information.

    CPU ID

    Host CPU ID.

    Name

    Host CPU name.

    Type

    Host CPU type.

    Frequency

    Host CPU frequency.

    Logical_CPU_Count

    Number of logical CPUs on the host.

    cpu_num

    Number of Host CPUs.

    Host Computer Name

    Host device name.

    Host Operating System

    Host OS.

    model_info

    Model information.

    Device Id

    Device ID.

    iterations

    Iteration statistics.

    Iteration Number

    Number of iterations.

    Model Id

    Model ID, which is displayed based on the number of models.

    version_info

    Version information.

    analysis_version

    Parsing version information.

    collection_version

    Collection version information.

    drv_version

    Driver version information.

    Figure 2 Device information (cluster scenario)
    Table 4 Field description (cluster scenario)

    Field

    Description

    Rank Id

    Node ID that uniquely identifies a device in the cluster scenario.

    Device Id

    Device ID, which is not the unique identifier of a device in the cluster scenario.

    Prof Dir

    In the cluster scenario, the current rank ID corresponds to the PROF_XXX directory on the device.

    Device Dir

    device_{id} directory in the PROF_XXX directory in the cluster scenario.

    Models

    Model information, including all model IDs of the device corresponding to the current rank ID and the number of iterations in the model.