Skip to content

[AIPROFVIS-865] Compute view revamp: one Kernel Details workspace with box layouts and inline compare - #1163

Open
dhingora-amd wants to merge 17 commits into
mainfrom
dhingora/compute-inline-compare
Open

dhingora-amd wants to merge 17 commits into
mainfrom
dhingora/compute-inline-compare

Conversation

@dhingora-amd

Copy link
Copy Markdown
Contributor

Motivation

The compute view split one kernel's analysis across six tabs, and comparing two kernels happened in its own tab, away from the charts. This PR merges them into one resizable workspace where you can see the memory chart, roofline and metrics side by side, and compare kernels across workloads.

Technical Details

  • One workspace: ComputeView drops its tab bar for a single ComputeKernelDetailsView. Summary and the Compute Tester become floating windows, and the toolbar holds Layout, Panels and Presets.
  • Box layouts: eight templates of resizable boxes, each showing one panel: Memory Chart, Roofline, Metric Tables, ISA or Workload Details. Boxes can be swapped by dragging, or maximized. The layout is saved in AppWindowSettings and presets (new compute_layout component).
  • Kernel rail: every workload's kernels, as a list or as the full kernel table. Both modes share the same sort and filters. KernelMetricTable fetches each workload and merges the rows.
  • Inline compare: A is the selection and B is any kernel from any workload. The roofline plots both, the metric tables add A / B / Δ / Δ% columns, the memory chart shows A, B or B − A (same GPU architecture only), and ISA and Workload Details switch between A and B. The old Comparison tab is removed.
  • Metric tables: now a panel with opt-in tables, chosen from a Tables picker, under collapsible headers. Compare pairs metrics by ID, then by name, across architectures. Pins compare too.
  • Memory chart: Fit-to-view, an auto-compact overview for small boxes, and stretching to the box height.
  • Roofline: switches between single-kernel and compare at runtime, and keeps zoom and pan when maximized.
  • Selection: a workload change selects its busiest kernel. Select(workload, kernel) changes both at once.
  • View menu: new Compute Profiler Panels toggles.
  • System trace toolbar: the Advanced search button's padding now matches the compute toolbar, so the file tabs no longer shift when switching views.
  • No changes to the data provider, model or controller.

Reworks the compute view around a single Kernel Details workspace
with user-arranged panels, and fixes several crashes found along the
way.

- Summary moves out of the tab bar into a floating window under
  View > Show Summary, matching the rocpd trace view.
- Kernel Details, Table View and ISA View merge into one Kernel
  Details tab: a kernel rail on the left (List / Table tabs) and a
  resizable workspace of panels (Memory Chart, Roofline, Metric
  Tables, ISA).
- Box layouts: eight templates (Single, Side by Side, Stacked,
  Main + Two Below/Right, Three Columns, Main + Three Below,
  2 x 2 Grid) chosen from a thumbnail Layout menu. Each box header
  has a drag handle (drop on another box to swap), a panel picker,
  maximize / restore (fills the tab and hides the kernel rail;
  double-click toggles) and hide. Empty boxes offer the panels not
  shown.
- Layout persists in AppWindowSettings, saves with user presets, and
  stays in sync with View > Compute Profiler Panels and the Panels
  checklist.
- Metric Tables are opt-in: pick tables from a searchable list, each
  in a collapsing header; Speed-of-Light is shown by default and
  pinned metrics have their own section.
- Memory chart draws at actual size, stretched to its box and
  scrolled; a Fit toggle shrinks it to fit, and small boxes show a
  fitted overview automatically.
- Thinner splitters (3 px) and scrollbars (8 px) in the workspace.

Fixes:
- Workload view: EndChild was skipped on one path, unbalancing the
  ImGui window stack.
- Summary: pie tooltip used the wrong metric; guard divide-by-zero
  on empty pies.
- Roofline: guard zero-length projections and missing intensity.
- Kernel metric table: parse ids with strtoul instead of throwing.
- Comparison: guard null workloads.

Tests and docs: compute UI tests follow the new Kernel Details
structure; .agents/UI.md describes the box-layout model.
# Conflicts:
#	src/view/src/compute/rocprofvis_compute_memory_chart.cpp
#	src/view/src/compute/rocprofvis_compute_memory_chart.h
#	src/view/src/compute/rocprofvis_compute_roofline.cpp
#	src/view/src/compute/rocprofvis_compute_roofline.h
Moves kernel comparison out of its own tab and into the Kernel Details
workspace: A is the selected kernel, B is chosen from the kernel rail,
and every panel shows the pair in place. Two kernels only.

- Kernel rail is the one place kernels are picked. The compute toolbar
  drops its workload / kernel combos, and the Compare button is gone.
  Each rail tab has a B slot (a faint B on hover) and a context menu
  item "Compare with this kernel (B)"; the Table's rows have the same
  menu item.
- Compare card above the rail: A and B with their workloads, Follow A
  (B follows A's kernel name across workloads), Swap, the two GPU
  architectures (warned when they differ) and Stop. Selecting B as A
  swaps them.
- Memory chart: A / B / B - A header buttons. B - A needs the same
  GPU architecture; across architectures B uses its own chart layout.
  Delta colors, tooltips and legend.
- Roofline: main's compare mode, switched inline. It plots when only
  one kernel has data (with a note) and keeps its zoom and position
  when maximized (stable plot id).
- Metric Tables: A, B, delta and delta % columns, matched by id then
  name, with unmatched rows and change highlighting; the options and
  the columns shown are saved in presets.
- ISA: A / B header buttons (no delta); B shows the compare target's
  ISA and A follows the selection.
- Kernel table lists every workload's kernels: each workload is
  fetched in turn with the same query, then merged and sorted
  client-side, with a Workload column. The sort holds across queries
  and the selection scrolls back into view; B's row is tinted.
- The rail's List mirrors the Table: same rows, same sort, same
  filters. The List groups by workload, or names the workload on each
  tab when a sort mixes them; a note shows the Table's sort and
  filters, with Clear.
- ComputeSelection::Select(workload, kernel) sends one change; picking
  a workload selects its busiest kernel.
- Removes the Baseline Comparison tab, rocprofvis_compute_comparison.*
  and its preset entry.

Fixes:
- Compare card: B's name was blank (ElidedText child id collision).
- Memory chart: retry a metrics fetch refused while one is in flight.
- Kernel table headers: PushID per column, as in TableHeadersRow.

Tests and docs: UI tests for inline compare (same and cross workload),
roofline zoom on maximize, the multi-workload kernel table and its sort,
the List following the Table, and ISA A/B. Opt-in screenshots via
ROC_OPTIQ_TEST_CAPTURE_DIR (GL back-buffer capture;
IMGUI_TEST_ENGINE_ENABLE_CAPTURE in CMake). .agents/UI.md updated.
- Workload Details is a Kernel Details panel (ComputePane::kWorkloadDetails,
  appended), shown from Panels or View > Show Workload Details. It shows the
  selected kernel's workload; while comparing, A / B header buttons (no
  delta) switch it to B's workload, as the ISA panel does.
- Kernel Details is the whole compute view: ComputeView renders it directly
  and drops its tab container. The dev-only Compute Tester moves to a
  floating window (Developer Options > Show Compute Tester).
- UI tests reach Kernel Details through ComputeViewTestPeer::KernelDetailsPtr();
  new tests cover the panel following the selection and its A / B sides.
  .agents/UI.md updated.
…ne-compare

# Conflicts:
#	.agents/UI.md
#	CMakeLists.txt
#	src/app/test/app_tests.cpp
#	src/app/test/test_main.cpp
#	src/view/src/compute/rocprofvis_compute_isa_view.cpp
#	src/view/src/compute/rocprofvis_compute_isa_view.h
#	src/view/src/compute/rocprofvis_compute_memory_chart.cpp
#	src/view/src/compute/rocprofvis_compute_view.cpp
#	src/view/src/compute/rocprofvis_compute_workload_view.cpp
#	src/view/src/widgets/rocprofvis_compute_widget.cpp
#	src/view/src/widgets/rocprofvis_compute_widget.h
#	src/view/src/widgets/rocprofvis_split_containers.h
Kernel Details' layout controls now sit beside Presets, with spacing restored for the toolbar. The trace search's Advanced button uses the toolbar padding so both toolbars are the same height and tabs no longer shift.
Remove dead code and duplicated logic across Kernel Details, the metric tables, the memory chart and the compute settings, and cut per-frame allocations. Reset layout now turns off Fit on B's memory chart too, and compare tables take deltas from the values as printed so sub-0.005 noise is no longer shaded as a change.
…ne-compare

# Conflicts:
#	src/view/src/compute/rocprofvis_compute_kernel_details.cpp
#	src/view/src/compute/rocprofvis_compute_kernel_metric_table.h
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

drchen-amd

This comment was marked as resolved.

@trangvu-amd trangvu-amd changed the title Compute view revamp: one Kernel Details workspace with box layouts and inline compare [AIPROFVIS-865] Compute view revamp: one Kernel Details workspace with box layouts and inline compare Nov 11, 2026
Keep pinned metrics and table headers in view, tint changed A/B cells, and list metrics only B has in id order as their own pins, which keep naming the same metric across Swap. Match B's kernel table highlight to A's, align the compare card rows, scale pane titles with the display, and give each panel its own minimum size, shrunk to fit so gutters can still move.
Each panel now owns its header buttons, actions, body, minimum size and compare behaviour behind a common interface, so Kernel Details only handles layout, the kernel rail and the comparison. Also drop imgui_internal from Kernel Details, share the case-insensitive search helper, and fix the two CodeQL alerts.
Pinned metrics can now go in their own panel, so they stay in view while the metric tables scroll or are in another box. Turn it on from the View menu, the Panels menu or an empty box's picker; it is off by default. It shares the metric tables' pins, so pinning, compare columns and Swap work the same in both, and the pinned header leaves Metric Tables while the panel is shown.
drchen-amd

This comment was marked as resolved.

@drchen-amd

This comment was marked as resolved.

- Keep compare table columns in order and keep scroll: one ImGui table per
  column layout, tables updated in place instead of recreated.
- Send the DB value name ("Avg", not "Avg A") to the kernel table.
- Show the pivot table's invalid filter error again.
- Kernel name tooltip: only over the ellipsis, capped in length.
- Remove the Panels toolbar menu and View pane toggles; an empty box offers
  a panel dropdown.
- Make the Kernel Details layout per compute view instead of global; presets
  still save and restore it.
- Fix header button padding so icon buttons match text buttons and do not
  clip against the divider.
…ne-compare

# Conflicts:
#	src/view/src/compute/rocprofvis_compute_comparison.cpp

@drchen-amd drchen-amd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new critical findings; some minor defects, organizational things, and subjective comments.

  • Memory chart has different tool tips when on slot A vs slot B.
20261119-1824-06.4225717.mp4

(In slot A, HBM Rd says "The total number of L2 requests..." . After inverting comparison and checking slot B, same metric says "The time-averaged number of cycles...".

  • Summary should use the PopUpStyle like systems trace side.
  • Copying pivot table workload cell puts the kernel cell on clipboard. Workload column also not included if whole row is copied.
  • I think how the "Kernel Rail" and the pivot table are coupled is clunky in terms of usability. The UI is presented like they are two views of the same thing, but actually they are two separate widgets that were glued together. Ex:
    • Sorting the pivot table affects the rail, but there is no way to change it from the rail.
    • The rail's filter does not apply to the pivot table. The pivot table filter applies to the rail but cannot be edited from the rail. It can only be cleared from the rail.

Comment on lines +1446 to +1453
std::vector<ListedKernel> shown = ListedKernels();
const bool any_listed = !shown.empty();
shown.erase(std::remove_if(shown.begin(), shown.end(),
[this](const ListedKernel& item) {
return !contains_ignore_case(item.kernel->name,
m_kernel_filter);
}),
shown.end());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kernel list is built and searched every frame. At most it only needs to be refreshed when the table side changes it or a keystroke in the search bar occurs.

Comment on lines +74 to +84
void
ComputeKernelDetailsPane::OnWorkloadSelected(uint32_t)
{}

void
ComputeKernelDetailsPane::OnKernelSelected(uint32_t)
{}

void
ComputeKernelDetailsPane::OnMetricsFetched(uint64_t)
{}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some widgets get their workload/kernel updated externally by this wrapper class, while other widgets register for the selection changed event directly and update themselves:

  • Memory chart, roofline: Externally updated by wrapper class.
  • Table view, Isa: Internally update themselves.

This difference is preexisting, but I think it made more sense with old layout because each of the tabs in the old layout already registered for selection event. Instead of every widget inside a tab registering for selection event, they exposed some setters (SetKernel/SetWorkload...etc) and relied on tab to propagate event. Memory chart and roofline always shared a tab with other widgets, so they used this scheme. Table view and ISA on the other hand were their own tabs, hence they must update themselves by directly registering for selection event.

In new layout, every widget is inside a ComputeKernelDetailsPane, so I think it makes more sense if every widget updated the same way; event register is done by wrapper class with widget exposing setters that wrapper calls to signal event.

Comment on lines +193 to +204
ComputeMemoryChartPane::ComputeMemoryChartPane(
const IKernelCompare& compare, DataProvider& data_provider,
std::shared_ptr<ComputeSelection> compute_selection)
: ComputeSidedPane(compare)
, m_chart(data_provider, compute_selection)
, m_chart_b(data_provider, compute_selection)
, m_chart_b_workload(ComputeSelection::INVALID_SELECTION_ID)
{
// B's chart never follows the selection.
m_chart_b.SetSource(ComputeSelection::INVALID_SELECTION_ID,
ComputeSelection::INVALID_SELECTION_ID);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving these widget specific implementations to source of the widget they are for instead of all being pooled in this file. The base ones can stay here.

…nel rail

- Move each concrete pane into its widget's files; the kernel details view
  forwards events to the widgets, which no longer subscribe themselves
- Drop pivot-table responses that arrive after a newer query is requested
- Look up memory chart tooltips in the chart's own workload (fixes B)
- Use PopUpStyle for the compute Summary window
- Copy the workload name from the workload column
- Kernel rail list keeps a fixed duration order, independent of the
  table's sort and filters
- Update tests and .agents/UI.md
…ne-compare

# Conflicts:
#	src/view/src/rocprofvis_appwindow.cpp
"filters {}",
workload_id, m_sort_column_index,
m_sort_order == kRPVControllerSortOrderAscending ? "ASC" : "DESC",
filter_map.size());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fetch the same metric ids for all workloads, so it will not handle conflicting metric ids:

image image

The controller interface only supports metric ids, and I don't want this PR to get even bigger modifying it to take metric names.

If we really want this pivot table to support multiple kernels at once, then this widget needs to take the metric name the user picked, search for it in all workloads, and fetch with the workload's specific metric id.

Alternatively, I think it would be fine and simpler if this pivot widget gets reverted back to only supporting one workload at a time, in which case it could become another movable pane that can go into a layout slot on the right side.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest will still break if you send any metric from different workload via table view context menu afterwards.

20261125-0118-21.4985261.mp4

Metric ids differ between GPU architectures, so each workload's pivot query now
uses its own ids for the picked metrics; ones it lacks show N/A, a filter on one
skips the workload, and a sort on one falls back to duration.
@amokiche-amd

Copy link
Copy Markdown
Contributor
image Tabs behave inconsistently when there is no data for them. For instance, if there is no data for "ISA," that view cannot be selected from the list; yet, if there is no data for "rooflime," it remains selectable. In my view, the policy for displaying available views should be consistent across the board: either we show everything, or we hide everything that lacks data. image

@amokiche-amd

Copy link
Copy Markdown
Contributor

Does it make any sense to display empty tabs? Wouldn't it be better if, upon clicking the 'X' (or "empty this box"), the corresponding tab disappeared—for instance, having a view like [] [] automatically switch to something like [ ]?


void
KernelMetricTable::HandleNewData()
KernelMetricTable::StartFetchCycle()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StartFetchCycle() overwrites metric.entry with the selected workload's name-matched entry, so its ID can change. Nothing updates m_metrics_params, which is only written when a metric is added or removed.
BuildWorkloadQuery() then compares the resolved ID against that already-remapped ID. For the selected workload they always match, so it reuses the stale string (2.1.3:Avg).
Other workloads get a freshly generated string, so only the selected workload's rows are wrong.
Filters and sort use the same column, so they are affected too

Comment on lines +3048 to +3069
ComputeMemoryChartPane::ApplyCompare(bool target_changed)
{
if(m_compare.IsComparing())
{
const uint32_t workload_id = m_compare.CompareWorkloadId();
if(target_changed)
{
if(workload_id != m_chart_b_workload)
{
m_chart_b.LoadWorkloadLayout(workload_id);
m_chart_b_workload = workload_id;
}
m_chart_b.SetSource(workload_id, m_compare.CompareKernelId());
m_chart_b.FetchMemChartMetrics();
}
if(m_side == CompareSide::kDelta && !m_compare.DeltaAvailable())
{
m_side = CompareSide::kA;
}
}
m_chart.SetDeltaTarget(ShownSide() == CompareSide::kDelta ? &m_chart_b : nullptr);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart B loads and remaps its own layout against B's workload (memory_chart.cpp:3057), and its value map is keyed by B's own dotted IDs (memory_chart.cpp:1139-1142).
DeltaValues() looks up A's ref string in that map with no name matching, so both failure modes follow: a missing delta, or B.Y − A.X.
DeltaAvailable() only compares gpu_arch strings, and two empty strings count as equal.
The empty-arch case is narrower than the finding implies: with no arch there is no embedded layout, so it only matters when both workloads carry a database-blob layout or the override file is present.

Comment on lines +1801 to +1823
ComputeKernelDetailsView::SwapCompare()
{
const uint32_t a_workload = m_compute_selection->GetSelectedWorkload();
const uint32_t a_kernel = m_compute_selection->GetSelectedKernel();
const uint32_t b_workload = m_compare.workload_id;
const uint32_t b_kernel = m_compare.kernel_id;
if(!m_data_provider.ComputeModel().GetKernelInfo(b_workload, b_kernel))
{
return;
}
m_compare.workload_id = a_workload;
m_compare.kernel_id = a_kernel;
// Recorded as A already, so the selection notifications below do not re-run
// the follow rule against the new B.
m_compare.baseline_workload_id = b_workload;
m_compare.baseline_kernel_id = b_kernel;
for(const std::unique_ptr<ComputeKernelDetailsPane>& pane : m_panes)
{
pane->OnCompareSwapping();
}
m_compute_selection->Select(b_workload, b_kernel);
ApplyCompare(true);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SwapCompare() calls OnCompareSwapping() on every pane; the trade-places branch in OnBaselineChanged() does not, and nothing else remaps m_pinned_metrics.
The ordering caveat is also right. SwapComparePins() reads A from the current selection, which by then is already the old B, and m_compare_workload_id is still the old B. Calling it there would remap B against itself.
It only has a visible effect when A and B are in different workloads with differing IDs, or when B-only pins exist

i++;
}
}
if(!m_widget.m_enabled_tables.empty())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToJson() omits tables when the set is empty, and FromJson() only touches m_enabled_tables when the key exists. LoadPreset does not reset components first.
If the preset has pins, FromJson() calls Reset(), which re-enables the default table. So the "pins with all tables hidden" case restores with one table shown, regardless of prior state.
If the preset has no pins, the previous selection is left as is

}

void
KernelMetricTable::Render()

@amokiche-amd amokiche-amd Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already was the huge function but you did it larger from 576 lines to 701 lines. Now it dificult to read and looks messy, Separate it to smaller function, at least the new functionality.

}

void
ComputeKernelDetailsView::RenderKernelTab(const KernelInfo& kernel, uint32_t workload_id,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also giant messy function for 152 lines, it can be mor nit, if it will be separated for smaller functions

…lity

- Kernel table: build each workload's query from its matched metric, keep
  stored queries in sync, and spot duplicates by name
- Memory chart B - A: find B's value by name; unknown arch never matches
- Remap compare pins when selecting B swaps A and B
- Save empty pin and table lists in metric table presets
- Hide panels the database has no data for (Roofline, Memory Chart,
  Metric Tables, Pinned Metrics, as ISA already was)
- Split KernelMetricTable::Render and RenderKernelTab into helpers
- Update tests and .agents/UI.md

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants