Skip to main content
skill CX Codex

tracelens-analysis-orchestrator — Claude Code skill: PyTorch trace

A skill that runs the agentic TraceLens workflow over PyTorch Profiler traces and writes a prioritized analysis.md.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add amd/skills --skill tracelens-analysis-orchestrator -a claude-code
Open on GitHub

What tracelens-analysis-orchestrator does

The skill lays out the whole pipeline. It starts by asking for the platform, trace path, analysis mode (training or inference) and environment setup, then generates a performance report and runs a trace-quality gate. If the trace fails that gate, a deterministic fallback analysis takes over. Category data comes next: GPU utilization, top ops, tree data, multi-kernel data.

Analysis splits into two parallel tracks. System-level work covers CPU and idle time, kernel fusion, collective communication and memcpy, writing into system_findings/. Separate subagents handle compute kernels — GEMM, SDPA, elementwise — and write into category_findings/. The orchestrator runs everything else itself, including aggregating findings into priority_data.json.

Subagents are launched only where the procedure calls for them: the Task tool in Claude and Cursor, spawn_agent under Codex. Steps 7, 8 and 10 are the only ones that need a subagent primitive; the rest goes through the command prefix in <output_dir>/cache/cmd_prefix.txt. The deliverable is <output_dir>/analysis.md.

What it helps with

  • analyze a single PyTorch Profiler trace and get a prioritized report
  • compare two traces side by side
  • separate system-level bottlenecks from slow compute kernels
  • check trace quality before trusting the numbers
  • merge subagent findings into one analysis.md

Example prompts for the agent

  • analyze profile.pt.trace.json with the analysis orchestrator
  • compare run_a.json and run_b.json in training mode
  • run the agentic trace analysis and produce analysis.md

How to install tracelens-analysis-orchestrator

1Skills CLI (Vercel)

npx skills add amd/skills --skill tracelens-analysis-orchestrator -a claude-code

2Manually: put the files in place

~/.claude/skills/tracelens-analysis-orchestrator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tracelens-analysis-orchestrator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about tracelens-analysis-orchestrator

How do I install tracelens-analysis-orchestrator in Claude?

Run npx skills add amd/skills --skill tracelens-analysis-orchestrator -a claude-code. The skill lands at ~/.claude/skills/tracelens-analysis-orchestrator/SKILL.md.

What does tracelens-analysis-orchestrator do?

It orchestrates PyTorch Profiler trace analysis with TraceLens: generates a perf report, prepares category data, runs system-level and compute-kernel subagents in parallel, and writes analysis.md.

What do I need to run the subagents?

Your runner's subagent primitive — the Task tool in Claude and Cursor, spawn_agent under Claude. It is used only in steps 7, 8 and 10; the orchestrator handles the rest.

Source text

SKILL.md · MIT
---
name: tracelens-analysis-orchestrator
description: >-
  Orchestrates modular PyTorch profiler trace analysis with TraceLens: generates perf
  reports, prepares category data, runs system-level and compute-kernel subagents in
  parallel, validates outputs, and writes a prioritized stakeholder report (analysis.md).
  Use when the user asks to follow the analysis orchestrator, run the agentic analysis
  workflow, analyze a trace, compare two traces, or mentions standalone or comparative
  TraceLens analysis.
license: MIT
---

<!--
Copyright (c) 2026 Advanced Micro Devices, Inc. All rights reserved.

See LICENSE for license information.
-->

# Analysis orchestrator

Coordinate **system-level** analysis (CPU/idle, kernel fusion, multi-kernel / comm / memcpy) and **compute-kernel** analysis (GEMM, SDPA, elementwise, etc.): one trace load, shared prep, parallel subagents, then aggregation into `analysis.md`.

## Full procedure

Follow **[reference.md](reference.md)** for every step (user prompts, `<prefix>` / `{CMD}` usage, CLI commands, subagent launch text, validation, report `tee` order, plot embedding, and trace diagnostics).

## Workflow index

```
0. Query User Inputs (Platform, Trace Path(s), Analysis Mode, Environment Setup)
1. Generate Performance Report (branches on analysis mode: training vs inference then, comparison scope)
2. Trace-Quality Gate → Deterministic fallback analysis
3-6. Prepare Category Data (GPU Util, Top Ops, Tree Data, Multi-Kernel Data, Category Filtering)
7. System-Level Analysis (PARALLEL) → system_findings/
8. Compute Kernel Subagents (PARALLEL) → category_findings/
  8.5. Aggregate → priority_data.json::findings[]
9. Validate Subagent Outputs
10. load_findings + Model Identification (subagent) → metadata/model_info.json
11. Render performance PNG if agent_extension.py is absent
12. Generate analysis.md (orchestrator writes via <prefix> tee), optional extension, embed PNG
```

## Rules

- **Subagents:** Use your runner's subagent primitive (the Task tool in Claude Code or Cursor, `spawn_agent` under Codex) **only** where reference.md says “subagent” (Steps **7**, **8**, **10**). The orchestrator runs everything else, including Step 8.5, using the command prefix from `<output_dir>/cache/cmd_prefix.txt` (`{CMD}` substitution).
- **Language:** Prefer vendor-agnostic terms (GPU kernels, collective communication, vendor GEMM library, DNN primitives, GPU graph). When quoting trace data, real kernel names are fine.
- **Subagent prompts:** Point each subagent at the checked-in agent file under `TraceLens/Agent/Analysis/skills/analysis-orchestrator/agents/<name>.md` (see reference.md for exact paths and prompt shells).

## Primary outputs

- **Deliverable:** `<output_dir>/analysis.md`
- **Internals:** `system_findings/`, `category_findings/`, `category_data/`, `metadata/`, `perf_report*.xlsx`, CSV folders — see package README for layout.

## Agent layout

Project subagents ship with this skill: `TraceLens/Agent/Analysis/skills/analysis-orchestrator/agents/*.md`.

© amd · MIT · amd/skills

Similar skills

Everything for AI and ML →

From the same set11

local-ai-use A meta-skill that reroutes image generation, text-to-speech and speech-to-text through a local Lemonade Server instead of a paid cloud API. CX Codex +1 1,100installs local-ai-app-integration Integrates Embeddable Lemonade into apps that currently call cloud AI APIs. Useful when shipping on-device inference on Windows x64 or Linux x64. CX Codex +1 895installs serving-llms-on-instinct Brings up a vLLM endpoint on AMD Instinct GPUs: detects the hardware, validates the environment, builds the Docker command and launches the model. CX Codex +1 876installs magpie-kernel-evaluator Benchmarks LLM inference with Magpie, turns torch traces into stage and roofline reports, and carries an optimization from a hot kernel to a validated variant. CX Codex +1 826installs serving-llms-on-epyc Deploys a vLLM endpoint with the zentorch backend on AMD EPYC CPUs using Docker, Podman, or conda. Handy for CPU-based LLM inference pinned to a single socket. CX Codex +1 817installs lemonade-router-builder This skill converts plain-English routing instructions into a valid Lemonade collection.router policy JSON. Use it to split traffic between small local models and larger cloud LLMs. CX Codex +1 807installs hyperloom-workload-optimizer Bootstraps Hyperloom on an AMD Instinct host and kicks off multi-agent throughput optimization for LLM serving. Useful when a model on MI300X, MI325X or MI355X needs to push more tokens per second. CX Codex +1 783installs quark-install Installs or verifies AMD Quark and makes sure the Python environment has a PyTorch build that matches the accelerator. Useful when the quark import fails or kernels won't compile. CX Codex +1 526installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor