rocprof-compute-torch-trace
БесплатноЗапускает вложенные скриптыНе проверенAttributes AMD GPU kernel performance counters back to the PyTorch or Triton operators that launched them, using rocprof-compute ML API tracing. Use when the…
от amd★ 523 звезды на GitHubОб этом скилле
Map GPU kernels to PyTorch operators
Profiling a PyTorch model with counters alone gives kernel names, which say little about the model. Torch tracing annotates the run so each kernel can be traced back to the operator that launched it.
Torch and Triton tracing are experimental. Every command needs
--experimental, and option names can change between releases, so run
rocprof-compute profile --experimental --help first.
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 --verify-deps instead of --debug-verify-deps.
Otherwise, check that ROCm and a GPU are present:
rocminfo
amd-smi list
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 Marketing Name that rocminfo
prints, and use the gfx 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. Check the requirements
Torch tracing needs PyTorch installed against a matching ROCm. PyTorch 2.13
and 2.14 use the prebuilt native collector, which records operators on every
thread, including autograd workers. Other versions, or a missing or unusable
collector, warn and use TorchDispatchMode with reduced coverage on the Python
thread where it is active. Confirm the version and check the loader message
before interpreting missing backward operators as an absence of GPU work.
The workload must be a Python command or Python script; the tracer cannot
annotate a compiled binary. The collector is a generic prebuilt
torch_trace_collector.so and needs no PyTorch or Python development packages
to build. The workload still needs Python-compatible roctx bindings. The
full requirement list is in the Torch trace section of
profile mode.
2. Collect
rocprof-compute profile \
--experimental \
--trace-ml-api torch \
--speed-of-light \
--name <workload_name> \
-- python <script.py> <args>
On ROCm 10.2 and earlier, use -b sol instead of --speed-of-light.
For Triton kernels launched through Triton's Python runtime (@triton.jit):
rocprof-compute profile --experimental --trace-ml-api triton --name <name> -- python <script.py>
torch.compile / Inductor fused kernels use PyTorch's static launcher, so they
do not get |triton ranges. Attribute them with --trace-ml-api torch.
The two combine as --trace-ml-api torch triton. User-defined ROCTx regions
are included with every --trace-ml-api run. A bare --trace-ml-api traces
all supported ML frameworks as well.
On ROCm 10.2 and earlier, use --torch-trace, --triton-trace and
--ml-api-trace instead of --trace-ml-api torch, --trace-ml-api triton and
a bare --trace-ml-api, and use --list-torch-operators,
--list-triton-operators, --torch-operator and --triton-operator instead of
--list-operators torch, --list-operators triton and --operator.
Tracing adds overhead on top of the usual counter replay. Profile a few
iterations of a steady-state model rather than a full training run, and skip
warmup. ROCPROFCOMPUTE_ROCTX_DEEP_TENSOR_WRAPS=0 reduces instrumentation
overhead by dropping the device and layout wraps; see
profile mode for what that costs you.
Tracing cannot be combined with attaching to a running process, and cannot be combined with a PC-sampling-only profile.
Profile preserves each pass's raw marker and counter CSVs with the
ml_api_trace prefix.
Collect only what the question needs
Never run a full profile. It replays the application
Установить rocprof-compute-torch-trace в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rocprof-compute-torch-trace?
Attributes AMD GPU kernel performance counters back to the PyTorch or Triton operators that launched them, using rocprof-compute ML API tracing. Use when the user asks which PyTorch layer or operator is slow, wants to map GPU kernels to model code, profiles a training or inference script, asks about torch.compile and Inductor kernels, or wants to select user-defined ROCTx regions from a traced Python profile. Not for CUDA tools, Windows, compiled non-Python binaries, or starting and stopping a profile at ROCTx ranges.
Как установить скилл rocprof-compute-torch-trace?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rocprof-compute-torch-trace запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic