Compare performance reports in TraceLens#
2026-07-22
3 min read time
This topic shows how to compare multiple performance reports that you’ve already
generated with generate_perf_report_pytorch.py, using the
compare_perf_reports_pytorch.py script
(TraceLens/Reporting/compare_perf_reports_pytorch.py). The result is a single
workbook with side-by-side metrics and per-metric diffs.
Note
This topic covers comparing generated reports (the .xlsx or .csv outputs).
To compare raw traces by their morphological tree structure, see
Compare two traces in TraceLens, which also documents the
SDK-based TraceDiff workflow.
Before you begin#
TraceLens installed (see Install TraceLens).
At least two reports (
.xlsx) generated with TraceLens_generate_perf_report_pytorch.
What it takes in#
Input |
Description |
|---|---|
|
TraceLens reports you want to compare. Provide at least two. |
Optional |
Human-readable tags for each report. If omitted, the script falls back to the base filenames. |
How to call it#
python compare_perf_reports.py \
baseline.xlsx \
candidate.xlsx \
--names baseline candidate \
--sheets all \
-o comparison.xlsx
Alternatively, you can call the entry point directly after installing TraceLens, which avoids needing to know the script’s path:
TraceLens_compare_perf_reports_pytorch \
baseline.xlsx \
candidate.xlsx \
--names baseline candidate \
--sheets all \
-o comparison.xlsx
Common flags:
Flag |
Default |
Purpose |
|---|---|---|
|
|
Name of the merged workbook. |
|
|
Custom tags (must match the number of reports). |
|
|
Limit processing to a subset: |
What comes out#
The script writes one workbook (comparison.xlsx unless you override it)
containing multiple sheets:
Sheet |
When you get it |
What it shows |
|---|---|---|
|
|
End-to-end GPU activity by type ( |
|
|
Per-op aggregates keyed on |
|
|
Kernel-level summary for rocprof reports, keyed on |
|
|
Three sheets per variant tag: |
|
|
Same intersect / only-baseline / only-variant breakdown for each roofline group: |
Hidden columns stay in the file (for power users) but are invisible in Excel by default.
Diff math#
For every metric you ask it to track (diff_cols in the code), the script
computes:
metric__<tag>_diff # variant - baseline
metric__<tag>_pct # 100 * diff / baseline
Design decisions to know#
Outer merge, never inner: if an op vanished, you’ll see it.
Baseline is the first report: choose its order deliberately.
Column prefixing: every metric becomes
<tag>::metric, so you can safely concatenate arbitrary reports.Sheet-specific pruning: the script aggressively hides noise (for example
median,UID) to keep the output readable. You can always unhide these in Excel if you need them.Excel 31-char rule: sheet names are truncated to fit; no data loss, just shorter labels.
Note
A planned enhancement is morphology-aware diffing: understanding the call-stack
tree and comparing at the lowest common call-stack level. For example, if a
baseline leaf op is cudnn_convolution and the variant is miopen_convolution,
the diff would recognize that the lowest common level is convolution and
compare the two there.