Obtaining Device Information

Applicability

Product

Supported

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Atlas 350 Accelerator Card

Function

After the profiling 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

Obtains device information.

${INSTALL_DIR}/tools/profiler/profiler_tool/analysis/interface. 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.

Command Format

python3 get_msprof_info.py -dir <dir> [-help]

Command-line Options

Table 2 Command-line options

Option

Description

Optional/Required

-dir, or --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 or --help

Help information.

Optional

Example

  1. Log in to the environment where the tool is located as the running user.
  2. Switch to the directory where the get_msprof_info.py script is located.
  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 3 Command-line options

    Option

    Description

    Optional/Required

    -dir, or --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 or --help

    Help information.

    Optional

Output Description

In the non-cluster scenario, the output is printed on the screen, as shown in Figure 1. Table 4 describes corresponding fields. In the 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 5 describes corresponding fields.

Figure 1 Device information (non-cluster scenario)
Table 4 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 5 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.