mindstudio_monitor Interfaces
mindstudio_monitor Module
Provides inter-process communication (IPC) interfaces and the capability of independently controlling MSPTI Monitor to collect and obtain profile data.
- IPC control channel: The profiler backend obtains the profiler configuration from the dynolog daemon.
- IPC data channel: MSPTI Monitor sends profile data to the dynolog daemon.
- Lightweight profile data collection
- Starts or stops MSPTI Monitor to collect data.
- Obtains the profile data collected by MSPTI Monitor online.
- Exports the profile data collected by MSPTI Monitor to the local PC in Excel format.
PyDynamicMonitorProxy API
Communicates with the dynolog daemon through IPC, and sends registration requests and profiler configuration parameters to the dynolog daemon. You do not need to directly call this API.
init_dynosends registration requests the dynolog daemon.- Input: npu_id(int)
- Return: None
poll_dynoobtains profiler control parameters from the dynolog daemon.- Input: None
- Return: str, control parameter.
enable_dyno_npu_monitorenables MSPTI monitoring.- Input: cfg_map(Dict[str,str]) parameter configuration
- Return: None
finalize_dynoreleases resources and threads in mindstudio_monitor.- Input: None
- Return: None
update_profiler_statusreports the profiler status.- Input: status(Dict[str,str])
- Return: None
Monitor Feature APIs
ActivityKind Enumeration Class
This enumeration class defines the types of the data can be collected by MSPTI Monitor and is used to configure the monitor module. Each enumerated value corresponds to a data type.
- ActivityKind.Marker: collects mstx dotting data and returns the marker data structure.
- ActivityKind.Kernel: collects the time consumption data of compute operators and returns the kernel data structure.
- ActivityKind.Communication: collects the time consumption data of communication operators and returns the communication data structure.
- ActivityKind.API: collects the time consumption data of operator API calls and returns the API data structure.
- ActivityKind.AclAPI: collects the time consumption data of ACL API calls and returns the API data structure.
- ActivityKind.NodeAPI: collects the time consumption data of Node API calls and returns the API data structure.
- ActivityKind.RuntimeAPI: collects the time consumption data of Runtime API calls and returns the API data structure.
Monitor API
startstarts monitor to collect data.- Input: kinds(List[ActivityKind]) data type list
- Return: None
stopstops monitor to collect data.- Input: None
- Return: None
get_resultobtains the profile data collected by monitor.- Input: None
- Return: Dict[ActivityKind, List[ActivityData]], profile data
savesaves the profile data collected by monitor.- Input: file_path(str) file path
- Return: None
ActivityData Data Structure
Defines the profile data structure collected by monitor.
Marker Structure Fields
name(str): mstx dotting message contentsourceKind(str): message source type, which can beHostorDevicedomain(str): name of the domain to which the message belongsid(int): message IDstartNs(int): mstx dotting start time, in nanosecondsendNs(int): mstx dotting end time, in nanosecondspid(int): process ID whensourceKindisHost, or0whensourceKindisDevicetid(int): thread ID whensourceKindisHost, or0whensourceKindisDevicedeviceId(int): ID of the device to which the marker belongs whensourceKindisDevice, or0whensourceKindisHoststreamId(int): ID of the stream to which the marker belongs whensourceKindisDevice, or0whensourceKindisHost
Kernel Structure Fields
name(str): name of a compute operatorstartNs(int): operator execution start time, in nanosecondsendNs(int): operator execution end time, in nanosecondsdeviceId(int): ID of the device where the operator is executedstreamId(int): ID of the stream where the operator is executedcorrelationId(int): operator execution correlation ID, which is used to associate with API datatype(str): operator type, for example,KERNEL_AICORE,KERNEL_AIVEC, orKERNEL_AICPU
Communication Structure Fields
name(str): name of a communication operatorstartNs(int): operator execution start time, in nanosecondsendNs(int): operator execution end time, in nanosecondsdeviceId(int): ID of the device where the operator is executedstreamId(int): ID of the stream where the operator is executedcount(int): data volume transmitted by the operatordataType(str): data type transmitted by the operator, for example,FP32orINT8commName(str): name of the communicator to which the operator belongsalgType(str): communication algorithm type of the operator, for example,RINGorMESHcorrelationId(int): operator execution correlation ID, which is used to associate with API data
API Structure Fields
name(str): API namestartNs(int): API call start time, in nanosecondsendNs(int): API call end time, in nanosecondspid(int): ID of the process that calls the APItid(int): ID of the thread that calls the APIcorrelationId(int): API call correlation ID, which is used to associate with kernel/communication data
Installation
For details about how to install the mindstudio_monitor module, see msMonitor Installation Guide.