Skip to content

PR 2/8: hwgraph: Add numa graphs#121

Merged
anisse merged 4 commits into
mainfrom
hwgraph-numa-support
Jul 24, 2026
Merged

PR 2/8: hwgraph: Add numa graphs#121
anisse merged 4 commits into
mainfrom
hwgraph-numa-support

Conversation

@ErwanAliasr1

Copy link
Copy Markdown
Collaborator

This PR is adding per numa domain graphs and heatmaps.

@anisse

anisse commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Looks OK. Let's wait for PR1 to be merged to merge.

@ErwanAliasr1
ErwanAliasr1 force-pushed the hwgraph-numa-support branch from 23bf607 to b34e28b Compare July 16, 2026 10:32
Comment thread graph/graph.py
Comment thread graph/graph.py
Comment thread graph/graph.py Outdated
Comment thread graph/graph.py
anisse and others added 4 commits July 23, 2026 14:59
Add a per-NUMA-domain view of the per-core CPU metrics (frequency, IPC and
core power): instead of hundreds of unreadable per-core lines, plot one
averaged line per NUMA domain. Following the per-core convention, each metric
is rendered as "all_numa" (every core of each domain) and "pinned_numa" (only
the cores pinned during the job, grouped by their domain, dropping domains
with no pinned core; annotated with the pinned range).

This requires the NUMA topology in the trace, which hwbench collected but did
not serialize. cpu.dump() now writes:
  - numa_nodes: {domain: [logical cores]}
  - numa_distances: the inter-node distance matrix (kept for future
    topology-aware features)
Both are parsed from numactl -H; NUMA.get_distances() exposes the matrix that
was previously only used to derive quadrants. Traces predating this change
lack the topology and simply skip the NUMA graphs.

Tests reuse the existing NUMA fixtures: distance-matrix assertions in the
parse tests, a cpu.dump() topology test on the mocked hardware.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Erwan Velu <e.velu@criteo.com>
Complement the per-NUMA-domain line graphs with two heatmaps:

- A per-host NUMA distance heatmap (domain x domain, color = inter-domain
  distance), rendered once per trace in environment/by_host/<host>/, so the
  topology (which domains are close/far) is visible independently of any
  benchmark.

- A per-metric NUMA domain x time heatmap for frequency and IPC, next to the
  corresponding line graph in all_numa/pinned_numa: Y = NUMA domains, X = time
  (as in the line graphs), color = the domain's value at each step. A legend
  box on the left lists each domain's cores condensed via cpu_list_to_range()
  (individually bracketed, right-aligned, centered dash), like the component
  legend of the other graphs.

Graph.render() gains an extra_legend parameter so a manually placed legend is
included in the tight bounding box.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Erwan Velu <e.velu@criteo.com>
@anisse
anisse force-pushed the hwgraph-numa-support branch from b34e28b to 2ced27e Compare July 23, 2026 13:03
@anisse
anisse requested review from Arno500, Keruspe and anisse July 23, 2026 13:45
@anisse
anisse merged commit eed827d into main Jul 24, 2026
3 checks passed
@anisse
anisse deleted the hwgraph-numa-support branch July 24, 2026 08:39
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.

3 participants