API Introduction
This section describes the mstx dotting API. You can customize the sampling period or the start and end time of key functions to identify these functions or iterations and quickly demarcate performance and operator problems.
By default, mstx APIs do not provide any function. You need to call the mstx APIs in the user application and enable the mstx dotting function based on different scenarios, for example, when using the msProf commands to sample data, set --msproftx=on. When using the AscendCL API to sample data, configure ACL_PROF_MSPROFTX. When using the Ascend PyTorch Profiler API to sample data, set mstx=True.
- Path of the libms_tools_ext.so library file: ${INSTALL_DIR}/lib64
- When the header file is used for compilation, the dl library needs to be linked during program compilation. The header file ms_tools_ext.h is stored in ${INSTALL_DIR}/include/mstx.
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.
API List
API Name |
Function Description |
|---|---|
Obtains the ID of the tool that hijacks the mstx API. |
|
Identifies an instantaneous event. |
|
Identifies the start of a time segment event. |
|
Identifies the end of a time segment event. |
|
Creates a custom domain. |
|
Destroys a specified domain. A destroyed domain cannot be re-used. Recreate one if you need to use it. |
|
Marks an instantaneous event in a specified domain. |
|
Identifies the start of a time range event in a specified domain. |
|
Identifies the end of a time range event in a specified domain. |
|
Registers a memory pool. |
|
Registers secondary allocation of a memory pool. |
|
Deregisters secondary allocation of a memory pool. |
|
Deregisters the regions associated with a memory pool when the memory pool is deregistered. |