/hpc-assistant-skills:profilingfrom hpc-assistant-skills
Profiles HIP/ROCm applications on AMD GPUs using rocprofv3. Covers application tracing (HIP, HSA, kernel, memory), kernel counter collection, and Perfetto visualization.
Ships in hpc-assistant-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
rocprofv3 is a CLI tool for profiling and tracing HIP/ROCm applications on AMD GPUs without source changes. It supports application tracing (API and kernel execution) and kernel counter collection. It is backward compatible with rocprof and is installed with ROCm (typically under /opt/rocm/bin).
See references/examples.md for rocprofv3 usage patterns (runtime/kernel trace, performance counters, MPI, and SLURM).
General form:
rocprofv3 [options] -- <application_path> [application_args]
Options come before --; everything after -- is the application and its arguments.
Help and version:
rocprofv3 -h
rocprofv3 --version
Tracing records execution times of API calls and GPU activities (kernels, memory copies). Use one or more trace options before --.
Common trace options:
| Option | What is traced |
|---|---|
--hip-trace | HIP API only (runtime + compiler); does not enable kernel or memory tracing |
--kernel-trace | Kernel dispatches |
--memory-copy-trace | Memory copies (e.g. hipMemcpy) |
--memory-allocation-trace | Allocations/frees |
--marker-trace | ROCTx/roctx markers |
--runtime-trace | HIP runtime, markers, kernels, memory (no HSA, no HIP compiler API) |
--sys-trace | All of the above plus HIP compiler API and full HSA API |
Examples:
# HIP API trace only (CSV output)
rocprofv3 --hip-trace --output-format csv -- ./myapp
# Kernel and memory copy trace
rocprofv3 --kernel-trace --memory-copy-trace --output-format csv -- ./myapp
# Shorthand: runtime trace (typical first-step profiling)
rocprofv3 --runtime-trace --output-format csv -- ./myapp
# Full system trace (HIP + HSA + kernels + memory)
rocprofv3 --sys-trace --output-format csv -- ./myapp
Default output format is rocpd (SQLite). Other formats: csv, json, pftrace (Perfetto), otf2.
Post-processing: Use --stats for per-API statistics; use -S or --summary to print a summary after the run. Combine with a trace option, e.g. rocprofv3 --stats --hip-trace --output-format csv -- ./myapp.
Collect hardware performance counters for kernel executions. First list available counters for your GPU:
rocprofv3 --list-avail
Then request counters by name. Counters are GPU-specific; requesting too many at once may require multi-pass (multiple runs).
Command line:
rocprofv3 --pmc SQ_WAVES GRBM_COUNT GRBM_GUI_ACTIVE --output-format csv -- ./myapp
Input file (YAML/JSON): Use -i input.yaml to specify counters and other options. Text input (e.g. pmc: SQ_WAVES per line) can define multiple pmc rows for multi-pass collection.
Extra counters: Define custom counters in a YAML file and pass it with -E / --extra-counters, then reference them in --pmc.
| Option | Purpose |
|---|---|
-i FILE / --input FILE | Input config (YAML/JSON for full config; text for PMC lists) |
-o FILE / --output-file FILE | Output file name |
-d DIR / --output-directory DIR | Output directory (default uses %hostname%/%pid%) |
--output-format csv|json|pftrace|otf2|rocpd | Output format (default: rocpd) |
Output names can use placeholders such as %pid%, %hostname%, %job% (SLURM_JOB_ID), %rank% (MPI/SLURM rank).
Profile an already running process by PID without restarting it:
rocprofv3 -p <PID> --hip-trace --output-format csv -- <application_path>
# or
rocprofv3 --attach <PID> --kernel-trace -- ./myapp
Data is collected for the configured duration (see collection period in docs).
Generate a trace viewable in Perfetto (e.g. ui.perfetto.dev):
rocprofv3 --sys-trace --output-format pftrace -- ./myapp
For counter data over time:
rocprofv3 --pmc SQ_WAVES GRBM_COUNT --output-format pftrace -- ./myapp
With aggregate options like --runtime-trace or --sys-trace, turn off individual trace types by setting them to False:
rocprofv3 --runtime-trace --scratch-memory-trace=False -- ./myapp
rocprofv3 --sys-trace --hsa-trace=False -- ./myapp
YAML or JSON input can define one or more jobs with tracing and counter options. Example (YAML):
jobs:
- runtime_trace: true
kernel_rename: true
summary: true
summary_per_domain: true
output_format: [pftrace, json]
output_directory: "out"
Run with:
rocprofv3 -i input.yaml -- ./myapp
rocprofv3 --runtime-trace -S --output-format csv -- ./myapprocprofv3 --kernel-trace --output-format csv -- ./myapprocprofv3 --list-avail then rocprofv3 --pmc <counters> --output-format csv -- ./myapprocprofv3 --sys-trace --output-format pftrace -- ./myapprocprofv3 -p <pid> --kernel-trace -- ./myappShort patterns for using rocprofv3 with Python, containers, and SLURM on LUMI-style systems. Full runnable examples: references/examples.md.
When the GPU workload runs in a Python process that uses HIP/ROCm (e.g. PyTorch with ROCm). The executable is python; script and args go after --. The environment must provide a ROCm/HIP-backed GPU stack for kernels to appear.
rocprofv3 --runtime-trace -S --output-format csv -d ./prof_out -- python script.py
Run rocprofv3 inside the container (image must include ROCm and rocprofv3). Bind project/scratch with full paths.
singularity exec -B /scratch/project_xxx:/scratch/project_xxx -B /project/project_xxx:/project/project_xxx image.sif rocprofv3 --runtime-trace --output-format csv -d ./prof_container -- mycommand
When profiling inside a batch or interactive job. Use -d and -o with %j so output is per job; set --account and partition (e.g. small-g for GPU) as in the Slurm skill.
srun rocprofv3 --runtime-trace -S --output-format csv -d ./prof_%j -o prof_%j -- ./my_gpu_app
select_gpu wrapper.rocprof issue, GCD binding, per-rank output paths, Apptainer and a full-node job example are in references/frontier.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub silogen/hpc-assistant --plugin hpc-assistant-skills8 skills in this plugin
/energy-profilingUse when profiling GPU job energy or power consumption on AMD systems with Omnistat. Handles Omnistat/VictoriaMetrics setup, Slurm job instrumentation, report-card interpretation, and troubleshooting. Covers LUMI and Frontier. Do NOT use for rocprofv3 kernel/API performance profiling./frontier-frequency-power-cappingUse when running GPU frequency-cap or power-cap experiments on Frontier (AMD MI250X). Covers the power cap in the job header (#SBATCH --gpu-power-cap, one job per cap), the max frequency changed at runtime with /usr/bin/set_gpu_max_sclk, the sclk min/max range (#SBATCH --gpu-srange), checking which caps were applied, sysfs/pm_counters telemetry, sweep planning and submission, and runtime/energy/EDP analysis. Do NOT use for rocprofv3 kernel profiling (profiling) or general Omnistat setup (energy-profiling)./frontier-resource-managementCheck Frontier allocations, storage, and project access./frontier-slurm-job-managementSubmit, monitor, and debug Slurm jobs on Frontier./geak-optimizationInstall and run GEAK (GPU Energy-Aware Kernel optimizer) on HPC clusters with AMD Instinct GPUs. Covers kernel_workflow (single kernel) and e2e_workflow (whole-model serving). Use only when the user explicitly asks for GEAK, kernel_workflow, e2e_workflow, or to submit a kernel or model to the GEAK optimizer. Do not use for ordinary rocprof, HIP, or Triton performance advice./lumi-resource-managementCheck LUMI project quotas and allocations using lumi-workspaces, lumi-quota, lumi-allocations, lumi-check-quota, lumi-ldap-userinfo, and lumi-ldap-projectinfo. Use when the user asks about quota, billing units, allocations, or project/user info on LUMI.Other plugins' skills for the same job