Analyze the AMD GPU memory hierarchy
Use this after Speed-of-Light points at memory, or when the user asks about
bandwidth, caches, or data movement directly.
Run
rocprof-compute analyze --help
before choosing flags.
Before you start
If
command -v rocprof-compute
finds the tool and
rocprof-compute analyze --debug-verify-deps
passes, skip this section.
On ROCm 10.2, use
instead of
.
Otherwise, check that ROCm and a GPU are present:
If either command fails, ROCm is not installed or no GPU is visible. Stop and
point the user to "Install the ROCm Core SDK" in the
install guide. Installing rocprof-compute
alone does not help.
Check the GPU against
compatible accelerators.
The table lists product families, so match the
that
prints, and use the
name to confirm. If the GPU is not supported, stop and
tell the user.
Then follow "Install the analyze mode dependencies" in the
install guide, which installs
rocprof-compute in a virtual environment of its own. Use the nightly index so the
version matches these skills. Activate that environment with
source <venv>/bin/activate
before you run rocprof-compute, and confirm with
rocprof-compute analyze --debug-verify-deps
. If the application is a Python
script, note the full path of its Python before you activate, and run the
script with that path.
1. Start with the Memory Chart
bash
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> --list-stats
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> --memory-chart
On ROCm 10.2 and earlier, use
instead of
.
The Memory Chart shows the whole hierarchy at once: requests issued, what each
cache level served, and what reached HBM. Read it before opening any single
cache level, because it tells you which level to open.
Always analyze one kernel at a time with
.
If there is no workload yet, collect only the memory blocks:
bash
rocprof-compute profile --name <workload_name> --memory-chart -b vl1d l2 lds -- <application> <args>
The cache aliases differ by architecture; for example, some GPUs name their
caches
and
.
Collect only what the question needs
Never run a full profile. It replays the application once per counter pass and
also runs the roofline benchmarks.
- List what this GPU can collect with
rocprof-compute --list-metrics
, and a
block's metrics with rocprof-compute --list-metrics <alias>
. On ROCm 10.2
and earlier, use and --list-metrics <gfx_arch>
.
Pass only the block aliases, block ids, or metric ids (for example
) the question needs. Aliases differ by architecture.
- collects a predefined topic in one pass.
rocprof-compute profile --list-sets
lists the sets.
- Add when the user names the kernels that matter.
- Unless the question is about roofline, select blocks with and leave out
block 4 (), so the roofline benchmark is skipped.
- spreads counters over repeated dispatches of each
kernel with the same launch parameters, so it only helps when each profiled
kernel runs many times with the same launch parameters. Pair it with .
See Iteration multiplexing in
profile mode.
- Tell the user which analysis panels the narrower profile leaves empty.
2. Open the level the chart points at
bash
# Vector L1 data cache
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b vl1d
# L2 cache
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b l2
# L2 per channel, including Infinity Fabric read and write stalls
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b l2_per_channel
# Local Data Share, including bank conflicts and unaligned stalls
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b lds
# Address processing and data return, for coalescing behaviour
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b tatd
# Scalar L1 data cache
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b sl1d
Aliases are stable; numeric block ids are architecture-specific. List what this
workload actually has with
.
3. Interpret
Each level has its own reference, with the counters, the formulas, and what
they mean:
Client APUs use a different hierarchy; see the
RDNA performance model
for GL0, GL1, and GL2.
Read hit rates and utilizations against the
and
columns the report prints. Do not apply a remembered cutoff such as "L2 hit
rate below 50% is bad"; a streaming kernel with no reuse is supposed to miss.
Judge a rate against what the algorithm should do, the neighbouring kernels,
and a known-good baseline.
What usually follows from what:
| Reading | Usual meaning |
|---|
| High request count, low cache hits | poor locality or no reuse to exploit |
| Many requests per instruction in TA/TD | uncoalesced access |
| Sustained LDS bank conflicts | padding or access reordering needed |
| High fabric read or write stalls | traffic exceeds what the fabric can absorb |
| Near-peak HBM with low cache hits | reduce traffic or add reuse; more bandwidth is not available |
4. Memory bandwidth analysis (experimental, gfx950)
A guided breakdown that walks the bandwidth tree and names the limiting level.
It is experimental and currently shipped for gfx950 only; see
memory bandwidth analysis. It needs
only the memory chart (block 3) and block 30, so profile only those two blocks:
bash
rocprof-compute profile --experimental --membw-analysis --memory-chart -b 30 \
--name <name> -- <application>
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id>
Report the guidance the tool produced rather than substituting your own numbers.
On any other architecture, use the Memory Chart path above.
5. Normalization
For a bandwidth question,
is meaningful and
is not.
applies to the entire report, so switch it only when the user is asking
about bandwidth alone. Leave it at
for a mixed report.