msobjdump

This tool is used to parse and decompress the executable and linkable format (ELF) files generated after operator build in kernel launch projects (NPU mode) and standard custom operator projects, as well as simple custom operator projects. It displays the results in a readable format, helping you obtain kernel file information easily.

  • The ELF file is a file format used for binary files, executable files, object code, shared libraries, and core dumps, such as *.a and *.so files. An ELF file typically consists of the following parts:
    • ELF header: describes the structure of the entire file, including the file type, machine type, and version number.
    • Program header table: describes various segments in the file, including information about how a program is loaded to the memory for execution.
    • Section header table: describes the information about each section in the file, including the code, data, and symbol table of the program.
  • If the following faults occur during the use of the tool, analyze and rectify the faults based on the log information:
    • No ELF file is found.
    • The ELF file permission is incorrect.
    • The ELF file exists but cannot be parsed or decompressed.

Applicability

Product

Supported

Atlas 350 Accelerator Card

√

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

√

Tool Installation

  1. Install the msobjdump tool.

    The tool is released with the CANN software package. (For details about how to install the CANN software package, see Environment Setup). The default path is ${INSTALL_DIR}/tools/msobjdump. 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.

  2. Set environment variables.

    • Install the Ascend-CANN-Toolkit package as the root user:
      source /usr/local/Ascend/cann/set_env.sh
    • Install the Ascend-CANN-Toolkit package as a non-root user:
      source ${HOME}/Ascend/cann/set_env.sh

  3. Check whether the tool is successfully installed.

    Run the following command. If --help or -h is displayed, the tool environment is normal and the functions are normal.
    msobjdump -h

Command Format

Table 4 ELF file parsing fields (kernel launch project)

Field

Description

Required (Yes/No)

Printing Description

VERSION

Version number.

Yes

If --verbose is not set, the file is printed by default.

TYPE COUNT

Number of kernel files contained in the ELF file.

Yes

If --verbose is not set, the file is printed by default.

ELF FILE ${id}

Name of a kernel file contained in the ELF file. ${id} indicates the sequence number of the kernel file.

The kernel file naming rule is as follows:

A kernel file name is in the format of ${sec_prefix}_${file_index}_${kernel_type}.o, where ${sec_prefix} indicates the section name (which is obtained by the tool based on the .ascend.kernel keyword), ${file_index} indicates the file number, and ${kernel_type} indicates the kernel type.

Yes

If --verbose is not set, the file is printed by default.

KERNEL LEN

Length of the current kernel file.

Yes

If --verbose is not set, the file is printed by default.

KERNEL TYPE

Type of a kernel file. The mapping is {0 : 'mix', 1: 'aiv', 2: 'aic'}.

No

If --verbose is not set, the file is printed by default.

ASCEND META

Inter-core synchronization, ratio of Cube Cores to Vector Cores (task_ration), and other information during operator execution.

If the information is not obtained, None is displayed by default.

No

If --verbose is not set, the file is printed by default.

elf header infos

Information such as the ELF header, section headers, key to flags, program headers, and symbol tables.

No

If --verbose is set, full information printing is enabled.

Table 5 ELF file parsing fields (standard/simple custom operator project)

Field

Description

Required (Yes/No)

Printing Description

.ascend.meta. ${id}

Kernel function name of an operator. ${id} indicates the index value of the meta information.

Yes

If --verbose is not set, the file is printed by default.

VERSION

Version number.

Yes

If --verbose is not set, the file is printed by default.

DEBUG

Debugging information, including the following two parts:

debugBufSize: memory size required for debugging information.

debugOptions: status of the debugging switch. The options are as follows:

0: The debugging function is disabled.

1: Debugging is performed through DumpTensor and printf.

2: Debugging is performed through the assert function.

4: Debugging is performed through timestamp marking.

8: Debugging is performed through memory overwriting detection.

No

If --verbose is not set, the file is printed by default.

DYNAMIC_PARAM

Whether to enable dynamic parameters for the operator's kernel function. The options are as follows:

0: The dynamic parameter mode is disabled.

1: The dynamic parameter mode is enabled.

No

If --verbose is not set, the file is printed by default.

OPTIONAL_PARAM

Optional parameter information, including the following two parts:

optionalInputMode: Indicates whether an optional input needs to occupy a placeholder in the operator's kernel function. The options are as follows:

0: The optional input does not occupy a placeholder.

1: The optional input occupies a placeholder.

optionalOutputMode: Indicates whether an optional output needs to occupy a placeholder in the operator's kernel function. The options are as follows:

0: The optional output does not occupy a placeholder.

1: The optional output occupies a placeholder.

No

If --verbose is not set, the file is printed by default.

KERNEL_TYPE

Core type at the kernel function runtime. For details about the values, see Table 6.

No

If --verbose is not set, the file is printed by default.

CROSS_CORE_SYNC

Hardware synchronization (syncall) type.

USE_SYNC: Hardware synchronization is used.

NO_USE_SYNC: Hardware synchronization is not used.

No

If --verbose is not set, the file is printed by default.

MIX_TASK_RATION

Ratio of Cube Cores to Vector Cores (core allocation type) at the kernel function runtime.

No

If --verbose is not set, the file is printed by default.

DETERMINISTIC_INFO

Whether the operator performs deterministic computation.

0: non-deterministic computation.

1: deterministic computation.

No

If --verbose is not set, the file is printed by default.

BLOCK_NUM

Number of cores used to execute the operator. This field is not supported currently. Only the default value 0xFFFFFFFF is printed.

No

If --verbose is not set, the file is printed by default.

FUNCTION_ENTRY

TilingKey value of the operator.

No

If --verbose is not set, the file is printed by default.

elf header infos

Information such as the ELF header, section headers, key to flags, program headers, and symbol tables.

No

If --verbose is set, full information printing is enabled.

Table 6 Kernel type information

KERNEL_TYPE

Description

AICORE

This parameter is reserved and is not supported in the current version.

Only the AI Cores are started during operator execution. For example, if blocknum is set to 5 on the host, 5 AI Cores are started.

AIC

Only the Cube Cores on the AI Cores are started during operator execution. For example, if blocknum is set to 10 on the host, 10 Cube Cores are started.

AIV

Only the Vector Cores on the AI Cores are started during operator execution. For example, if blocknum is set to 10 on the host, 10 Vector Cores are started.

MIX_AIC_MAIN

In the scenario of mixing AIC and AIV, if the kernel function type is set to MIX, the Cube and Vector Cores on the AI Cores are started at the same time during operator execution. For example, you can set blocknum to 10 and task_ration to 1:2 on the host. In this case, 10 Cube Cores and 20 Vector Cores are started.

MIX_AIV_MAIN

In the scenario of mixing AIC and AIV, when multi-core control instructions are used and the kernel function type is set to MIX, the Cube and Vector Cores on the AI Cores are started at the same time during operator execution. For example, you can set blocknum to 10 and task_ration to 1:2 on the host. In this case, 10 Vector Cores and 20 Cube Cores are started.

AIC_ROLLBACK

When the operator is executed, the AI Cores and Vector Cores are started at the same time. In this case, the AI Cores are used as the Cube Cores.

AIV_ROLLBACK

When the operator is executed, the AI Cores and Vector Cores are started at the same time. In this case, the AI Cores are used as the Vector Cores.

Example (Kernel Launch Operator Project)

Take the MatmulInvocationNeo operator as an example (NPU mode). Assume that ${cmake_install_dir} is the root directory of the operator's CMake build artifacts. The directory structure is as follows (for reference only), in a style similar to that in Compiling the CMake Build Configuration File.

out
├── lib
│   ├── libascendc_kernels_npu.so
├── include
│   ├── ascendc_kernels_npu
│           ├── aclrtlaunch_matmul_custom.h
│           ├── aclrtlaunch_triple_chevrons_func.h
......

To parse and decompress the library files (such as *.so and *.a files) generated after compilation, run the following the commands:

Example (Standard/Simple Custom Operator Project)

Take the following operator project as an example (for reference only). Assume that ${cmake_install_dir} is the root directory of the operator's CMake build artifacts. The directory structure is as follows, in a style similar to that in Operator Building.

├── op_api
│   ├── include
│       ├── aclnn_acos_custom.h
│       ├── aclnn_matmul_leakyrelu_custom.h
│       ├── .........
│   ├── lib
│       ├── libcust_opapi.so

To parse and decompress the library files (such as *.so and *.a files) generated after compilation, run the following the commands: