Performance Report Analysis Tool
This tool analyzes performance traces from Metal operations, providing insights into throughput, bottlenecks, and optimization opportunities.
Installation
This tool can be installed from PyPI:
pipx install tt-perf-report
Installing with pipx will automatically create a virtual environment and make the tt-perf-report command available.
Generating Performance Traces
- Build Metal with performance tracing (enabled in default build):
./build_metal
- Run your test in TT-Metal with the tracy module to capture traces:
python -m tracy -r -p -v -m pytest path/to/test.py
This generates a CSV file containing operation timing data.
Using Tracy Signposts
Tracy signposts mark specific sections of code for analysis. Add signposts to your Python code:
import tracy
# Mark different sections of your code
tracy.signpost("Compilation pass")
model(input_data)
tracy.signpost("Performance pass")
for _ in range(10):
model(input_data)
The tool uses the last signpost by default, which is typically the most relevant section for a performance test(e.g., the final iteration after compilation / warmup).
Common signpost usage:
--start-signpost NAME: Analyze ops after the specified signpost--end-signpost NAME: Analyze ops before the specified signpost--ignore-signposts: Analyze the entire trace--print-signposts: Prints any signposts within the window defined when using the start/end signpost arguments
Filtering Operations
The output of the performance report is a table of operations. Each operation is assigned a unique ID starting from 1. You can re-run the tool with different IDs to focus on specific sections of the trace.
Use --id-range to analyze specific sections:
# Analyze ops 5 through 10
tt-perf-report trace.csv --id-range 5-10
# Analyze from op 31 onwards
tt-perf-report trace.csv --id-range 31-
# Analyze up to op 12
tt-perf-report trace.csv --id-range -12
This is particularly useful for:
- Isolating decode pass in prefill+decode LLM inference
- Analyzing single transformer layers without embeddings/projections
- Focusing on specific model components
Output Options
--min-percentage value: Dim ops below specified % of total time (default: 0.5)--color/--no-color: Force colored/plain output--csv FILENAME: Output the table to CSV format for further analysis or inclusion into automated reporting pipelines. Values are written unrounded, without the units the terminal table puts in each cell, so columns with a unit carry it in the header instead: Total [%], Device Time [μs], Op-to-Op Gap [μs], DRAM [GB/s], DRAM [%], FLOPs [TFLOPs], FLOPs [%] and Overlap [μs], following the stacked report CSV. A blank cell means no value. Rounding a CSV value to the table's precision gives the printed figure.--no-advice: Show only performance table, skip optimization advice--active-experts K: Use K active experts per input batch group forttnn.sparse_matmulrows whose CSV attributes do not include numericnnz--arch ARCH: Override architecture/SKU detection. Usep100for Blackhole P100 traces because profiler CSVs identify the chip family but not the card SKU.
Upgrading from 1.4.x: the eight
--csvcolumns listed above gained a bracketed unit in their header, and the percentage columns dropped the%from their name (DRAM %is nowDRAM [%]), so a reader that looks columns up by name must use the new names. The stacked report CSV'sTotal % [%]column is nowTotal [%]. Column order is unchanged in both files. With--no-merge-devicesthe stacked report's rows, printed and in its CSV, are now grouped by device, each device's rows in descending device time; the CSV was previously sorted by device time across all devices. Blank datatype and Global Call Count cells are now written empty rather than asnan, and Global Call Count as a whole number (1024, not1024.0).
Understanding the Performance Report
The performance report provides several key metrics for analyzing operation performance:
Core Metrics
- Device Time: Time spent executing the operation on device (in microseconds)
- Op-to-op Gap: Time between operations, including host overhead and kernel dispatch (in microseconds). A negative gap means the operation started before its predecessor finished, which is what concurrent subdevices look like; it is shown as reported but adds nothing to the gap total or to Total %. It need not match Overlap for the same op: the gap is measured against the previous op only, while Overlap is how much of this op any earlier op on the device covered
- Total %: This operation's share of the report's summed device time and op-to-op gaps. The shares always sum to 100%. When operations overlap, that sum is larger than the wall-clock time, so a share of summed time is not a share of elapsed time (see Overlap)
- Overlap: On a run partitioned into subdevices, how much of this operation's device time was already covered by an earlier operation on the same device, i.e. the ops ran concurrently on disjoint core ranges. It is blank when there is no overlap, and blank throughout on a run that is not partitioned. The terminal table only shows the column when some op overlapped;
--csvalways emits it.- When ops overlap, the total row's Device Time is the wall-clock busy time, its Overlap is the overlapped op time, and its Total % reads
100%*: the op shares add up to 100% of summed op time, not of elapsed time, and a footnote under the total row says so and gives both times. Merged devices ran in parallel, so busy time, overlap and idle time are those of the slowest device, measured on that device's own timeline, and whether ops overlapped at all is judged on each device's timeline. The merged rows each take one device's timing, so their Overlap cells need not add up to the total row's. With--no-merge-devicesthe devices ran in parallel, so busy time is summed over them and is not elapsed time either. The overall DRAM roofline (both its GB/s and its DRAM %) is then computed against busy time. The tracing-savings estimate counts only idle time no op covered: a gap another subdevice was busy through is not time tracing could save. Total % and the stacked report's Device Time Sum and percentages stay based on summed op time. Their column names do not say so, so a note printed alongside the stacked report, and a caption in its PNG title, give the summed and busy times; the CSV files carry no such marker, but Overlap in--csvshows which ops overlapped. - Each op is placed in time as the interval ending at
DEVICE FW END CYCLEand lasting its kernel duration. Cycles are converted with a ratio read from the file (DEVICE FW DURATION [ns]), and ops on different devices are never compared, because device clocks are not synchronised. The anchoring is empirical: raw FW start-to-end spans overlap even on sequential runs, while these intervals do not on any sequential capture tested. - Overlap needs
DEVICE FW START CYCLEandDEVICE FW END CYCLE. Ops whose counters are missing, or whose end does not follow their start, are not measured and count in full; when only some ops are measured the report says how many. - On a partitioned capture, a long negative op-to-op gap does not by itself mark an op's duration as invalid: it does only when the op would have started before the previous op on its device did, as in corrupt trace captures.
- Ops running concurrently still share one memory system, so their DRAM % figures can add up to more than 100% of the chip, and so can the overall DRAM %.
- With
--id-range, overlap is measured among the ops in the range only, so an op is not shown as overlapping one the range left out.
- When ops overlap, the total row's Device Time is the wall-clock busy time, its Overlap is the overlapped op time, and its Total % reads
- Cores: Number of compute cores used by the operation. DRAM-sharded matmuls use the architecture's DRAM-interface workers: 12 on Wormhole, 8 on Blackhole P150, and 7 on Blackhole P100.
- Available Cores: Worker cores the operation could have used, read per operation from newer profiler CSVs. On a run that partitions the chip into subdevices this is that subdevice's own budget; otherwise it is the full worker grid the profiler reports. When the whole column is absent it falls back to the architecture's registered grid (e.g. 64 on Wormhole, 110 on Blackhole, 20 on
bh20andn1); when only an individual cell is blank or malformed, it falls back to the largest budget the file does report, which on a partitioned run may be another subdevice's. Grid-size advice and the Cores coloring are measured against this value rather than against the whole chip; FLOPs % is unaffected, since utilization is based on the cores the operation actually used - Sub Device ID: Subdevice the operation ran on. Blank means the full worker grid only when the input carries the
SUB DEVICE IDcolumn. On a capture that predates that column every cell is blank because no id was recorded, so a blank there means unknown rather than full-grid — including on a run whose differing Available Cores budgets show the chip was partitioned. The terminal table hides the column in that case, but--csvalways emits it, so downstream consumers should read an entirely blank column as absent data, not as confirmed full-grid operation
Sub Device ID appears in the terminal table only when the run reports subdevices, and Available Cores only when subdevices or differing core budgets are reported — otherwise they would be columns of blanks or of one repeated value. Both are always present in --csv output, whose column set and order do not vary with the input.
Performance Metrics
-
DRAM: Memory bandwidth achieved (in GB/s)
-
DRAM %: Percentage of theoretical peak DRAM bandwidth (288 GB/s on Wormhole, 512 GB/s on Blackhole P150, or 448 GB/s on Blackhole P100)
-
Overall DRAM roofline: The total row reports modeled DRAM bandwidth and DRAM % across the visible report window
-
FLOPs: Compute throughput achieved (in TFLOPs)
-
FLOPs %: Percentage of theoretical peak compute for the given math fidelity
-
Bound: Performance classification of the operation:
DRAM: Memory bandwidth bound (>65% of peak DRAM)FLOP: Compute bound (>65% of peak FLOPs)BOTH: Both memory and compute boundSLOW: Analysed, but neither DRAM nor FLOPs explains the duration (both below 65%)HOST: Operation running on host CPU
DRAM,FLOP,BOTHandSLOWare only derived for matmuls. A blank Bound, DRAM % or FLOPs % does not mean the op is fine: for most op types those figures are never modelled.--csvrecords which model ran in Bound Analysis, so read that before concluding an op is not a bottleneck.
Classification Fields
Added to the per-op --csv output; the terminal table is unchanged. The stacked report's Op Category uses the same values.
- Op Category: The operation's category, as used by the stacked report. One of:
Compute: Matmuls, convolutions, eltwise, normalisation, attention and reductions. Ops that fuse a collective with real compute (for exampleAllGatherMatmul,RMSAllGather) are counted here.CCL: Collective communication between devices over the fabric (all-gather, reduce-scatter, all-reduce, all-to-all, broadcast, send/receive, and the DeepSeek MoEDispatch/Combinepair)DM: Data movement within a device (sharding, copies, halo)TM: Tensor manipulation (reshape, transpose, slice, concat, tilize)Host: Operations running on the host CPU ((torch)ops)Other: Not yet classified. The tool prints a warning naming each such op- Blank for signposts
- Bound Analysis: Which roofline model produced DRAM %, FLOPs % and Bound:
full: DRAM and FLOPs (matmuls). Either figure can still be blank when the trace lacks the inputs the model needsflops_only: FLOPs only (convolutions), so DRAM % is always blank and Bound is never setnone: Not analysed; DRAM % and FLOPs % are blank whatever the op's real behaviour, and so is Bound, exceptHOSTfor host ((torch)) ops
Additional Fields
- Math Fidelity: Precision configuration used for matrix operations. Utilization is based on the operation's actual core count. Blackhole-family per-core peaks use phase divisors (HiFi4=/4, HiFi3=/3, HiFi2=/2, LoFi=/1). Wormhole uses published chip peaks; HiFi3 is HiFi4×4/3 (LoFi is empirical). Full-chip reference peaks are:
HiFi4: Highest precision — Wormhole 74 TFLOPs, Blackhole ~166 TFLOPsHiFi3: High precision — Wormhole ~98.7 TFLOPs, Blackhole ~221 TFLOPsHiFi2: Medium precision — Wormhole 148 TFLOPs, Blackhole ~332 TFLOPsLoFi: Lowest precision — Wormhole 262 TFLOPs, Blackhole ~664 TFLOPs
The tool automatically highlights potential optimization opportunities:
- Red op-to-op times indicate high host or kernel launch overhead (>6.5μs)
- Red core counts indicate underutilization (fewer than 10 cores, and less than half of the cores the operation was given), excluding DRAM-sharded matmuls
- Green core counts indicate either all the cores the operation was given — the subdevice's budget on a partitioned run — or a DRAM-sharded matmul, which runs on a fixed set of DRAM-interface workers rather than on a grid it could grow into
- Green DRAM % and FLOPs % indicate good utilization of available resources
- Yellow metrics indicate room for optimization
Examples
Note:
trace.csvin the examples below refers to your input CSV file (the performance trace you want to analyze).
Typical use:
tt-perf-report trace.csv
Merge traces captured on multiple machines from the same workload run:
tt-perf-report trace_host0.csv trace_host1.csv trace_host2.csv
Build a table of all ops with no advice:
tt-perf-report trace.csv --no-advice
View ops 100-200 with advice:
tt-perf-report trace.csv --id-range 100-200
Export the table of ops and columns as a CSV file:
tt-perf-report trace.csv --csv my_report.csv
Metadata
Release files for tt-perf-report 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tt_perf_report-1.5.0.tar.gz | 104.2 kB | With provenance | Details for tt_perf_report-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tt_perf_report-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for tt_perf_report-1.5.0-py3-none-any.whl |
Total release size: 168.0 kB
Release files / tt_perf_report-1.5.0.tar.gz
| Download URL | tt_perf_report-1.5.0.tar.gz |
|---|---|
| Size | 104.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee5912e09a3d63e2ca1f89e75ef36c3f862061d811431ffaf76d06b50dc3c2f3
|
|
BLAKE2b-256 checksum How to use checksums |
c1888db19b4b8e4e0732276cfed55654b22fe5ec42a133ba024815eb4230b936
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / tt_perf_report-1.5.0-py3-none-any.whl
| Download URL | tt_perf_report-1.5.0-py3-none-any.whl |
|---|---|
| Size | 63.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ffd2c33a9f3ec3dd0cee3e9400ce0af4a7ac3307bac0aea8c5718c320559e41
|
|
BLAKE2b-256 checksum How to use checksums |
1b218c96117c362f700d11e02d577c9019054e74e7456093ec9b887500bb4e23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for tt-perf-report 1.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tt_perf_report-1.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.