This document is relevant for: Inf2, Trn1, Trn2, Trn3
Unified Trace Viewer (Developer Preview)#
Note
The Unified Trace Viewer is a Developer Preview feature. The System Trace Viewer, Device Trace Viewer, and Hierarchy Viewer are still available.
A performance problem often crosses layers. A slow training step can start as a framework operation, pass through Neuron Runtime calls, and end as idle time on a device engine. With separate viewers, you have to line up the System Trace Viewer and the Device Trace Viewer yourself to connect host events to device events. The Unified Trace Viewer combines the System Trace Viewer, the Device Trace Viewer, and the Hierarchy Viewer into one widget with a single time axis. Framework operations, Neuron Runtime calls, host CPU and memory usage, and device events such as instructions, DMA transfers, and collectives all appear on the same timeline. You can follow a performance gap from the framework down to the hardware without switching views.
Note
Host and device events are recorded with separate clocks. Neuron Explorer aligns them on one time axis using the clock synchronization data captured with the profile. The alignment is best effort, so host and device events that look simultaneous might be slightly offset. Use the alignment to correlate activity across the stack, not to measure exact host-to-device latency.
Supported events#
The Unified Trace Viewer shows all the events in a profile on one timeline. The timeline shows whichever events the profile includes. If a profile has only system events or only device events, the viewer shows only those tracks.
System events: framework operations, Neuron Runtime calls, hardware events, and system-level metrics such as host CPU and memory usage. See System events.
Device events: instructions, DMA transfers, and collectives. Device events appear under the instance and process they belong to. See Device events.
Enable the Unified Trace Viewer#
While the Unified Trace Viewer is in Developer Preview, it isn’t the default timeline. You can turn it on in any of the following ways:
From the announcement. The first time you open Neuron Explorer, an announcement introducing the Unified Trace Viewer appears. Choose Make default to replace the timeline viewers on the current page with the Unified Trace Viewer. Default layouts that you load after that also open with it. Choose Not now to keep the existing viewers. The announcement doesn’t appear again after you choose either option.
From Settings. Open Settings, select Unified Timeline, and turn on Use the Unified Timeline Viewer by default. The setting takes effect the next time you load a default layout. It doesn’t change viewers that are already open or layouts that you saved. To turn it off, use the same toggle.
For the current profile. To try the viewer on a profile that’s already open, without changing your default, click Add Widget and select the Unified Timeline tile. The viewer opens in a new Unified Timeline tab, and the timeline viewers that are already open stay open. You can drag the tab to move it, or close the viewers you no longer need. See Adding Widgets.
To go back to the separate viewers on a page, close the Unified Timeline tab and add the System Trace Viewer or Device Trace Viewer widget.
Profiles captured with Neuron Runtime 2.33 or later#
Profiles captured with Neuron Runtime 2.33 or later include the clock synchronization data that lines up host and device events on the same time axis. They open in the Unified Trace Viewer with no extra steps.
Profiles captured before Neuron Runtime 2.33#
Profiles captured before Neuron Runtime 2.33 don’t include that data, so Neuron Explorer adds a Profile Warnings notification for the profile, which you can open from the notification icon:
If the system profile has its own synchronization data, Neuron Explorer aligns the device events from it on a best-effort basis. The warning reads:
Clock synchronization between host and device was derived from the system profile (best effort), so device and system events may be slightly misaligned. Recapture with Neuron Runtime 2.33 or later for best results.
If no synchronization data is available, device events don’t line up with system events. The warning reads:
Clock synchronization data between host and device is missing, so device events will not line up with system events. Recapture with Neuron Runtime 2.33 or later to enable it.
To align host and device events, recapture the profile with Neuron Runtime 2.33 or later.
Track layout#
Tracks are grouped from the instance and process down to the hardware, so you can start from the process you’re investigating and expand only the device activity under it. The left side of the viewer lists tracks as a tree, which you can expand and collapse (see Track actions). Hover the info icon next to a track name to see a description of the track.
System events#
For system events, the tree starts at System Profile and is grouped as follows:
Instance: <instance_id> — one group per instance in the workload.
PID: <process_id> — one group per process on the instance. Each process lists its event sources in order from the framework down to the hardware:
CPU — framework operator dispatch events, one track per thread (
TID: <thread_id>).Stream — framework device interaction events, one track per stream (
Stream: <stream_id>).neuron_rt — Neuron Runtime events, one track per logical NeuronCore (
NC: <nc_idx>).neuron_hw — Neuron hardware events such as
nc_exec_running, grouped by worker (Worker <worker_gid>).Device: NC <neuroncore_idx> — the device profile captured for this process, one group per logical NeuronCore the process ran on. See Device events and Logical NeuronCore configuration.
System Metrics — host and device metrics for the instance:
HBM Usage — device memory usage over time, one track per HBM.
CPU Utilization — an Average track and one track per CPU core. Requires
ProfileMode.CPU_UTILduring capture. See Visualizing Host CPU Utilization.Host-Device Transfers —
Host-to-DeviceandDevice-to-Hosttransfer events and transfer bandwidth. See Visualizing Host Device Transfers.
For the meaning of the system events on these tracks, see System Profile.
Device events#
Each device group contains the same tracks as the Device Trace Viewer, organized into groups:
Hierarchy — the framework layers, HLO operations, and NKI kernels that the Hierarchy Viewer shows, aligned with the instructions below them. This group starts collapsed and loads its data the first time you expand it. See Hierarchy Viewer.
nc<N> — one group per physical NeuronCore in the logical NeuronCore, where N is the physical NeuronCore’s index within the logical NeuronCore. With LNC=1 there is a single nc0 group. With LNC=2 there are two, nc0 and nc1. See Logical NeuronCore configuration. The first NeuronCore starts expanded. Each NeuronCore group contains:
Errors — hardware error and warning events reported by the NeuronCore, such as out-of-bounds (OOB) accesses or NaN values, drawn as point events at the time they occurred. See the Error table in the profile schema reference.
DMA — DMA engine tracks, including host-device DMA tracks. See DMA tracks and Host-device DMA tracks.
Instructions — one track per engine. See Instruction tracks.
Memory — State Buffer Usage and PSUM Usage.
Throttling, Semaphores, and Pending DMA.
DMA Throughput — DMA Throughput and Cumulative DMA Throughput.
Utilization — Estimated Instant MFU, Estimated Cumulative MFU, Estimated Instant HFU, and Estimated Cumulative HFU.
Vector Throughput Utilization — Instant Vector Throughput Utilization and Estimated Cumulative Vector Throughput Utilization for the Vector engine.
Vector Partition Dimension — the partition dimension of each Vector engine instruction in flight, colored by its performance mode.
CC Instructions — collective communication instructions, one track per collective core (
CC-core <N>). An overlay of CC boxes is drawn over the CC-core tracks, one box per collective operation, such as AllReduce or AllGather.HBM Throughput — HBM Throughput and Cumulative HBM Throughput.
Device Trace Viewer settings, such as DMA Aggregation and Separate Sequencer and Compute Engine Timelines, also apply to the device tracks in the Unified Trace Viewer.
For more about device events and what each device track shows, see Device Trace Viewer.
Filter tracks#
A profile with many instances, processes, and devices can have more rows than you can scan. Filtering lets you hide the rows you don’t need and focus on the events you’re investigating.
Click Tracks above the track list to choose which rows the viewer shows. The filter applies only to this viewer and doesn’t change the profile data.
Show all, System only, and Device only show every row, only the system event rows, or only the device event rows. System only and Device only appear when the viewer shows both kinds of rows.
Toggle the checkbox next to a track to show or hide it. Toggle a group to show or hide all the tracks under it.
Track actions#
Use these actions to keep the tracks you’re analyzing in view.
Expand or collapse a group — click its caret. Collapse the groups you don’t need to keep the timeline focused. Neuron Explorer remembers which groups you expanded for each profile.
Pin — click the pin icon next to a track to keep it at the top of the viewer while you scroll. This is useful for keeping a host track, such as a framework thread, in view while you scroll through device tracks.
Open in a new viewer — click the open-in-new-viewer icon on a device profile group to open that device profile in its own Unified Trace Viewer. The new viewer is placed in a separate widget group, so selections in it don’t drive the original viewer.
Resize the track list — drag the edge of the track list.
Action toolbar#
Use the action toolbar to zoom in and out or back to the full profile, return to a view you looked at earlier, and look up the viewer’s controls. It’s in the top right corner of the viewer, next to the time axis. From left to right, it has the following buttons.
Button |
Description |
|---|---|
Toggle Box Selection Mode |
Turns box selection on or off. While it is on, the button is highlighted and dragging in the timeline draws a box instead of zooming. Clicking and hovering over events are also off in this mode. When you finish dragging, the totals for the events in the box appear in the Box Selection Summary. Turning the mode off keeps the box and its summary, so you can zoom and pan around the selection. Press Esc to clear the box. |
Zoom In |
Zooms in to half of the visible time range, centered on the middle of the viewer. |
Zoom Out |
Zooms out to twice the visible time range, centered on the middle of the viewer. |
Reset Zoom |
Zooms out to show the full time range of the profile. |
View history |
Opens a menu of the views you have visited. See View history. |
Help |
Opens the Unified Trace Viewer help, which lists the mouse, trackpad, and keyboard controls for navigation, events, box selection, annotations, the Device Hierarchy, and the track list. It also includes the dependency color legend. |
View history#
The viewer records the views you visit as you zoom and jump around the timeline, so you can return to an earlier one. Zooming, resetting the zoom, and jumping to an event add a view to the history. Panning updates the current view instead of adding a new one.
Click View history to open the menu. It lists the views from newest to oldest. Each row shows where the view sits within the full profile and its zoom level relative to the full profile, for example 16×. Rows can also carry a label: Full profile for a view of the whole profile, Start for the view you opened the profile with, Event for a jump to an event, and Search result for a step through search results. The current view is shown in the list but you can’t select it. Click an earlier view to go back to it.
The button is unavailable until the history has an earlier or later view to go to. To step through the history with the keyboard, press Z for the previous view and Shift+Z for the next view.
Working with events#
Because host and device events share one timeline, flow events connect across the stack. For example, click an nc_exec_running hardware event to draw an arrow to the Neuron Runtime event it is linked to and list the chain in the Dependency Chain Viewer, then expand the device profile below to see the instructions that ran at the same time.
Hover an event to see its details in a tooltip.
Click an event to select it, show its properties in the Event Details widget, and highlight its flow events and dependencies. Click outside an event to clear the selection.
Ctrl + click (Windows/Linux) or Cmd + click (macOS) an event to go to its source code in the Code Viewer. See Source Code Viewer.
Press Alt+H or Alt+Left (Windows/Linux), or Option+H or Option+Left (macOS), to add the closest upstream instruction of the clicked instruction to the Dependency Chain Viewer’s chain and go to it. Press Alt+L or Alt+Right, or Option+L or Option+Right, for the closest downstream instruction. The Dependency Chain Viewer must be open.
Press Esc to clear the box selection, and then the selection and highlights.
Hierarchy#
The hierarchy maps device time back to the framework layers, HLO operations, and NKI kernels that produced it, so you can tell which part of your model a slow stretch of instructions belongs to. In the Hierarchy group of a device profile:
Click an operator to drill into it.
Right-click an operator to highlight its instructions.
Use the expand and collapse icons on a level to show or hide the next level, or on the hierarchy to expand or collapse all levels.
Connected widgets#
Connected widgets enable you to dive deeper when investigating a selected event, such as viewing its properties, following its dependency chain, or finding the source code line that produced it. The Unified Trace Viewer supports the same widgets that you’re already familiar with in the System Trace Viewer and Device Trace Viewer:
Event Details — shows the properties of the selected event.
Dependency Chain Viewer — click an entry to scroll the viewer to that event and select it. See Dependency Chain Viewer.
Search — searches the tracks on screen and highlights matching events. Use Focus in the Search Results Table to jump to a match. See Search.
Annotations — right-click the timeline to add an annotation marker, and drag a marker to move it. See Annotations.
Box Selection Summary — click the box selection icon in the toolbar, then drag over a region to see its totals. Press Esc to clear the box selection. See Box Selection Summary.
Code Viewer — click a source line to highlight the instructions it generated.
Region Highlighter — check a region to highlight the instructions it selects. See Region Highlighter.
Memory Viewer — click an allocation to highlight the system profile events that share its trace ID. See Memory Viewer Integration.
Limitations#
The Unified Trace Viewer is still in Developer Preview, and some features are a work in progress. If a feature you rely on isn’t available yet, use the System Trace Viewer, Device Trace Viewer, or Hierarchy Viewer.
For profiles captured with Neuron Runtime versions earlier than 2.33, device events may be misaligned with host events. See Profiles captured before Neuron Runtime 2.33.
This document is relevant for: Inf2, Trn1, Trn2, Trn3