Rocm profiler analysis

From wenyi-li/awesome-agent-kernel-skills · View interactive version

Rocm profiler analysis is an AI agent skill from the GitHub repository wenyi-li/awesome-agent-kernel-skills. Analyze SGLang and vLLM profiler traces on AMD ROCm systems, especially MI355X/gfx950 nodes. Adapted from the SGLang torch-profiler workflow: triage kernel breakdown, overlap headroom, and fuse opportunities, then write structured artifacts that can be attached to amdpilot experiments, trials, and d

How to use this skill

Skill file

ROCm Profiler Analysis

Use this skill when you need to turn a profiling run into structured optimization evidence

instead of a raw trace file.

This skill is the AMD/ROCm/MI355X adaptation of SGLang's torch-profiler analysis workflow. It is

designed for our current amdpilot stack:

Why This Exists

Raw traces are not good enough for agents or dashboards. They tell you that time was spent

somewhere, but they do not directly answer:

  1. Which kernel families dominate prefill or decode on ROCm?
  2. Which kernels still have overlap headroom?
  3. Which hotspots map back to Python or operator-level code paths?
  4. Which results are actually relevant to gfx950 / MI355X, and which are only generic?
  5. Which profiling outputs should be written into our canonical experiment/trial schema?

This skill standardizes that path.

Main Workflow

Preserve the same four subcommands as the upstream SGLang profiler skill:

For normal agent use, default to triage.

`triage`

Use this when you want one compact answer with three main outputs:

`breakdown`

Use this when you need one-trace category share analysis without overlap reasoning.

`overlap`

Use this when you have both:

and need to tie overlap headroom back to code paths.

`perfetto-fix`

Use this only when Perfetto renders overlapped lanes incorrectly and you need a repaired trace for

human inspection.

Recommended Inputs

This skill supports two input shapes:

  1. Existing trace directory / trace file
  1. Live server / live experiment

For amdpilot integration, prefer the second path for optimization-stage profiling and the first

path for post-hoc investigation.

AMD / ROCm Adaptation Rules

1. Use ROCm-native kernel categories

Do not reuse CUDA/H100/B200 assumptions. On our nodes, category tables should explicitly account

for ROCm-specific paths:

See references/rocm-kernel-categories.md.

2. Keep hardware relevance explicit

Every profiling result must declare whether it is truly relevant to our MI355X node:

Do not hide gfx942 vs gfx950 differences.

3. Treat profiling as structured artifacts

Do not stop at stdout tables. Write stable artifacts that can be attached to an experiment or

trial. Minimum recommended outputs:

See references/artifact-contract.md.

Canonical Metadata Contract

profile_metadata.json should contain enough information to tie profiling results back to the

dashboard and DB.

Minimum fields:

This is the difference between "a useful local notebook" and "a reusable profiling artifact".

Dashboard / DB Integration

The intended downstream path is:

  1. run profile
  2. emit structured artifacts
  3. attach artifacts to experiment / trial
  4. surface the summary and tables in dashboard

This skill should feed:

See references/dashboard-integration.md.

MI355X / gfx950 Specific Guidance

On our node, prefer profiling plans that stay grounded in actual machine facts:

When you compare profiles across runs, never compare them without also checking:

Otherwise the comparison is not trustworthy.

Suggested Rollout

Phase A: Analysis adaptation

Make the kernel classification and overlap heuristics ROCm-aware.

Phase B: Artifactization

Write the profiling outputs into stable JSON + Markdown artifacts.

Phase C: Live integration

Trigger profiling from real optimization stages and surface the artifacts in dashboard.

Relationship to Other AMD Skills

Use that skill when you need low-level AMD hardware counters or kernel-level bottleneck data.

Use this skill when you need SGLang/vLLM trace triage tied back to Python/operator semantics.

Run env-probe before profiling if you suspect hidden runtime defaults are skewing results.

Use crash-debug when the run is failing. Use this skill when the run is healthy enough to

generate profiling evidence.

Reviewer Checklist

Before calling this skill "done", verify:

  1. It is explicitly MI355X / gfx950 / ROCm-aware
  2. It produces structured artifacts, not just console output
  3. It carries experiment/trial linkage fields
  4. It distinguishes arch_match programmatically
  5. It can be attached to dashboard and DB without ad-hoc parsing
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.