Instructions

Zooming In on the Function Stack Flame Graph and Memory Line and Block Graph

MindStudio Insight allows you to left-click to drag select and zoom in on the selected part of the graph. The zoom-in function is enabled by default.

In Function Stack Flame Graph or Memory Request/Release Line Graph & Memory Block Graph, if the button in the upper right corner is in blue, the zoom-in function is enabled. You can left-click to drag select an area and release the mouse to zoom in on the area (the area in Function Stack Flame Graph and Memory Request/Release Line Graph & Memory Block Graph will be zoomed in at the same time), as shown in Figure 1. You can click to restore the graph to the original state.

You can click to dim the legends above Memory Request/Release Line Graph & Memory Block Graph to hide the selected line and memory block. You can also click the dimmed legends to show the line and memory block.

Figure 1 Selecting an area to zoom in
  • You can click in the upper right corner of the graph to dim the button. The line graph & block graph is locked and cannot be zoomed in by clicking and dragging the mouse. You can click the button to turn it blue to enable the zoom-in function. The zoom-in function is enabled by default.
  • You can click in the upper right corner of the line graph & block graph to restore the graph to the initial state.

Displaying the Memory Details Disassembly Diagram

When you move the cursor to Function Stack Flame Graph or Memory Request/Release Line Graph & Memory Block Graph, a time line is displayed. In the Memory Request/Release Line Graph & Memory Block Graph area, click the timeline. The memory details at the corresponding time point are displayed under Memory Request/Release Line Graph & Memory Block Graph, allowing you to view the memory usage. The content displayed in Memory Details Disassembly Diagram varies depending on the selected type.

To view a specified memory layer, click the layer bar below Memory Details Disassembly Diagram.

  • If Type is set to HAL, Memory Details Disassembly Diagram displays only the memory data of the CANN layer, as shown in Figure 2.
    Figure 2 CANN-layer memory details disassembly diagram
  • If Type is set to a value other than HAL, Memory Details Disassembly Diagram displays the memory type and layer of the memory pool on the corresponding framework. For example, if Type is set to PTA, Memory Details Disassembly Diagram displays only the memory information of the PTA framework, as shown in Figure 3.
    Figure 3 Memory details disassembly diagram of the PTA framework

You can drag the Memory Details Disassembly Diagram leftward, rightward, upward, and downward, and zoom in or out the diagram.

  • Place the cursor on the diagram and hold down the left mouse button to drag the diagram left, right, up, or down.
  • On the Memory Details Disassembly Diagram, you can use the mouse wheel to zoom in or out the diagram. Alternatively, you can select a memory block and left-click to zoom in on the selected memory layer.

Linked Zooming Between Function Stack Flame Graph and Memory Request/Release Line Graph & Memory Block Graph

When you double-click a block in Function Stack Flame Graph, the stack diagram is zoomed in based on the start time and end time of the block to display all stack information in the time period. At the same time, Memory Request/Release Line Graph & Memory Block Graph is zoomed in to display all memory blocks in the time period.

When you double-click a memory block in Memory Request/Release Line Graph & Memory Block Graph, the memory block diagram is zoomed in based on the start time and end time of the memory block to display all memory blocks in the time period. At the same time, all stacks in the time period in Function Stack Flame Graph are zoomed in and the corresponding Thread ID is automatically matched, as shown in Figure 4.

To restore the graph to the initial state, click in the upper right corner of the graph.

If no stack data is collected for the Thread ID corresponding to the memory block, the Function Stack Flame Graph area is empty.

Figure 4 Linked zooming

Displaying Memory Details

The Memory Details Table area displays memory details by Block View and Event View. By default, all memory information is displayed.

You can sort and search fields displayed in the table. You can click next to a field name to search for the required information.

Filter is supported for the Size, Malloc Timestamp, and Free Timestamp fields in Block View, and the Timestamp field in Event View. After you click , you can enter integers between 0 and the value displayed in the table to set the minimum and maximum values of the filter range.

  • Block View: displays details about memory blocks, as shown in Figure 5. Table 1 describes the fields.

    When Device ID and Type are set in Memory Request/Release Line Graph & Memory Block Graph, the memory block view is updated accordingly. When an area in Memory Request/Release Line Graph & Memory Block Graph is selected, the memory block view is also updated accordingly, showing information about all memory blocks in the selected time period.

    To filter inefficient memory blocks, you can click Filter Inefficient Graphics Memory in the upper right corner of the Block View table, and set thresholds for early request, delayed release, or long idle period.

    Figure 5 Block View
    Table 1 Fields in the Block View table

    Field

    Description

    ID

    Unique ID of a memory block.

    Addr

    Memory block address, which corresponds to the address of the memory request, release, or access event.

    Size(bytes)

    Size of the memory block, which corresponds to the memory request event. The unit is bytes.

    Malloc Timestamp(ns)

    Time when the memory block is requested, which corresponds to the memory request event. The unit is nanoseconds.

    Free Timestamp(ns)

    Time when the memory block is released, which corresponds to the memory release event. The unit is nanoseconds.

    Owner

    Memory block owner.

    Process ID

    Memory block process ID, which corresponds to the process ID of the memory request or release event.

    Thread ID

    Memory block thread ID, which corresponds to the thread ID of the memory request or release event.

    First Access Timestamp(ns)

    Time of the first access event.

    Last Access Timestamp(ns)

    Time of the last access event.

    Max Access Interval(ns)

    Maximum interval of access events.

    Attr

    Extended attributes:

    • allocation_id: ID for the request, access, or release sequence of a memory block. It uniquely identifies a group of memory events.
    • lazy_used: early request. The value can be true or false. true indicates that the scenario has been detected.
    • delayed_free: delayed release. The value can be true or false. true indicates that the scenario has been detected.
    • long_Idle: long idle period. The value can be true or false. true indicates that the scenario has been detected.
    • If the imported data is collected by the msLeaks tool of a version earlier than MindStudio 8.2.RC1 or no access event is collected, allocation_id is displayed as 0, First Access Timestamp(ns) and Last Access Timestamp(ns) are displayed as -1, and Max Access Interval(ns) is displayed as 0.
    • Currently, the msLeaks tool can collect memory access events only in the ATB and Ascend Extension for PyTorch operator scenarios. Therefore, First Access Timestamp(ns), Last Access Timestamp(ns), and Max Access Interval(ns) are available only in these scenarios. In other scenarios, First Access Timestamp(ns) and Last Access Timestamp(ns) are displayed as -1, and Max Access Interval(ns) is displayed as 0.
  • Event View: displays details about memory events, as shown in Figure 6. Table 2 describes the fields.

    When Device ID is selected in Memory Request/Release Line Graph & Memory Block Graph, the memory event view is updated accordingly. When an area in Memory Request/Release Line Graph & Memory Block Graph is selected, the memory event view is also updated accordingly, showing all memory events in the selected time period.

    Figure 6 Event View
    Table 2 Fields in the Event View table

    Field

    Description

    ID

    Event ID, which, together with Process ID, uniquely identifies an event.

    Event

    Event recorded by msLeaks.

    Event Type

    Event subtype.

    Name

    Event name, which is related to the value of Event.

    Timestamp(ns)

    Time when a memory event occurs.

    Process ID

    Process ID.

    Thread ID

    Thread ID.

    Addr

    Memory address.

    Attr

    Memory event attribute. Each event type has its own attribute.

    Call Stack(Python)

    Python call stack.

    This field is displayed only when the information is collected.

    Call Stack(C)

    C call stack.

    This field is displayed only when the information is collected.

    For details about the values of the Event, Event Type, and Name fields, see the description of the leaks_dump_{timestamp}.csv result file in .