rocprof-compute-memory
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnalyze the AMD GPU memory hierarchy
分析 AMD GPU 内存层级
Use this after Speed-of-Light points at memory, or when the user asks about
bandwidth, caches, or data movement directly.
Run before choosing flags.
rocprof-compute analyze --help当 Speed-of-Light 指向内存问题,或用户直接询问
带宽、缓存或数据移动时,使用本流程。
在选择 flag 前运行 。
rocprof-compute analyze --helpBefore you start
开始之前
If finds the tool and
passes, skip this section.
On ROCm 10.2, use instead of .
command -v rocprof-computerocprof-compute analyze --debug-verify-deps--verify-deps--debug-verify-depsOtherwise, check that ROCm and a GPU are present:
bash
rocminfo
amd-smi listIf 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.
Marketing NamerocminfogfxThen 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
before you run rocprof-compute, and confirm with
. If the application is a Python
script, note the full path of its Python before you activate, and run the
script with that path.
source <venv>/bin/activaterocprof-compute analyze --debug-verify-deps如果 找到了该工具,且
通过,则跳过本节。
在 ROCm 10.2 上,使用 代替 。
command -v rocprof-computerocprof-compute analyze --debug-verify-deps--verify-deps--debug-verify-deps否则,检查是否安装了 ROCm 并存在 GPU:
bash
rocminfo
amd-smi list如果任一命令失败,说明未安装 ROCm 或没有可见的 GPU。停止操作,
并将用户引导至安装指南中的“安装 ROCm Core SDK”。
单独安装 rocprof-compute 没有帮助。
根据
兼容的加速器检查 GPU。
该表列出的是产品系列,因此应匹配 输出的 ,
并使用 名称进行确认。如果 GPU 不受支持,请停止并
告知用户。
rocminfoMarketing Namegfx然后按照安装指南中的“安装 analyze 模式依赖项”操作,
该步骤会将 rocprof-compute 安装在独立的虚拟环境中。使用 nightly 索引,
确保版本与这些 skill 匹配。运行 rocprof-compute 前,使用
激活该环境,并通过
进行确认。如果应用是 Python
脚本,请先记下其 Python 的完整路径,再激活环境,并使用该路径运行
脚本。
source <venv>/bin/activaterocprof-compute analyze --debug-verify-deps1. Start with the Memory Chart
1. 从 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-chartOn ROCm 10.2 and earlier, use instead of .
-b memchart--memory-chartThe 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 .
-kIf 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 .
gl0gl2bash
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> --list-stats
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> --memory-chart在 ROCm 10.2 及更早版本上,使用 代替 。
-b memchart--memory-chartMemory Chart 会同时显示整个内存层级:已发出的请求、每个
缓存级别所服务的内容,以及到达 HBM 的内容。在打开任何单个
缓存级别之前先读取它,因为它会告诉你应该查看哪个级别。
始终使用 一次分析一个 kernel。
-k如果还没有 workload,请仅采集内存 block:
bash
rocprof-compute profile --name <workload_name> --memory-chart -b vl1d l2 lds -- <application> <args>缓存别名因架构而异;例如,某些 GPU 会将其缓存命名为
和 。
gl0gl2Collect 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 , and a block's metrics with
rocprof-compute --list-metrics. On ROCm 10.2 and earlier, userocprof-compute --list-metrics <alias>and--list-blocks <gfx_arch>. Pass--list-metrics <gfx_arch>only the block aliases, block ids, or metric ids (for example-b) the question needs. Aliases differ by architecture.2.1.0 - collects a predefined topic in one pass.
--set <set_name>lists the sets.rocprof-compute profile --list-sets - Add when the user names the kernels that matter.
-k <kernel_name> - Unless the question is about roofline, select blocks with and leave out block 4 (
-b), so the roofline benchmark is skipped.roof - 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
--iteration-multiplexing. See Iteration multiplexing in profile mode.-k - Tell the user which analysis panels the narrower profile leaves empty.
绝不运行完整 profile。它会为每个 counter pass 重放一次应用程序,
并且还会运行 roofline benchmark。
- 列出该 GPU 可采集的内容:,以及 某个 block 的 metrics:
rocprof-compute --list-metrics。在 ROCm 10.2 及更早版本上,使用rocprof-compute --list-metrics <alias>和--list-blocks <gfx_arch>。 仅通过--list-metrics <gfx_arch>传入问题所需的 block 别名、block ID 或 metric ID(例如-b)。别名因架构而异。2.1.0 - 在一次 pass 中采集一个预定义主题。
--set <set_name>会列出这些 set。rocprof-compute profile --list-sets - 当用户指出重要的 kernel 名称时,添加 。
-k <kernel_name> - 除非问题涉及 roofline,否则使用 选择 blocks,并排除 block 4 (
-b),从而跳过 roofline benchmark。roof - 会将 counters 分散到使用相同 launch 参数对每个 kernel 的重复 dispatch 中,因此只有在每个被分析的 kernel 都以相同 launch 参数运行多次时才有帮助。将其与
--iteration-multiplexing配合使用。 有关 Iteration multiplexing,请参阅 profile 模式。-k - 告知用户缩小后的 profile 会使哪些分析面板保持为空。
2. Open the level the chart points at
2. 打开图表所指向的级别
bash
undefinedbash
undefinedVector L1 data cache
Vector L1 data cache
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b vl1d
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b vl1d
L2 cache
L2 cache
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b l2
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b l2
L2 per channel, including Infinity Fabric read and write stalls
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
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b l2_per_channel
Local Data Share, including bank conflicts and unaligned stalls
Local Data Share, including bank conflicts and unaligned stalls
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b lds
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b lds
Address processing and data return, for coalescing behaviour
Address processing and data return, for coalescing behaviour
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b tatd
rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b tatd
Scalar L1 data cache
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 `--list-metrics`.rocprof-compute analyze --path ./workloads/<name>/<gpu_model> -k <kernel_id> -b sl1d
别名是稳定的;数字 block ID 因架构而异。使用 `--list-metrics` 列出
此 workload 实际包含的内容。3. Interpret
3. 解释
Each level has its own reference, with the counters, the formulas, and what
they mean:
- Vector L1 cache
- L2 cache
- Local Data Share
- Infinity Fabric transactions
- Vector memory operation counting
- LDS examples
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.
Percent of PeakPeakWhat 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 |
每个级别都有自己的参考资料,其中包含 counters、公式及其含义:
Client APU 使用不同的层级;有关 GL0、GL1 和 GL2,请参阅
RDNA 性能模型。
将命中率和利用率与报告输出的 和
列进行对照。不要套用凭记忆设定的阈值,例如“L2 命中率低于 50% 就表现不佳”;
没有数据复用的 streaming kernel 本来就应当未命中。应根据算法应有的行为、
相邻 kernel 以及已知良好的 baseline 来判断某个比率。
Percent of PeakPeak| 指标读数 | 常见含义 |
|---|---|
| 请求数高、缓存命中数低 | 局部性不佳,或没有可利用的数据复用 |
| TA/TD 中每条指令产生大量请求 | 访问未合并(uncoalesced access) |
| 持续出现 LDS bank conflict | 需要进行 padding 或调整访问顺序 |
| Fabric 读或写 stall 较高 | 流量超出 Fabric 的承载能力 |
| HBM 接近峰值且缓存命中数低 | 减少流量或增加复用;无法获得更多带宽 |
4. Memory bandwidth analysis (experimental, gfx950)
4. 内存带宽分析(实验性,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.
该功能会引导你逐层分析带宽树,并指出受限级别。
它仍处于实验阶段,目前仅随 gfx950 提供;请参阅
内存带宽分析。它只需要 Memory Chart(block 3)和 block 30,因此只 profile 这两个 block:
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>报告工具生成的指导结果,而不是替换为你自己的数值。
在任何其他架构上,使用上述 Memory Chart 流程。
5. Normalization
5. 归一化
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.
-n per_secondper_cycle-nper_kernel对于带宽问题, 有意义,而 没有意义。
应用于整个报告,因此仅当用户只询问带宽时才切换它。
对于混合报告,保持为 。
-n per_secondper_cycle-nper_kernel