triton-analyzer

A specialized analysis agent for Triton GPU kernels, which are GPU programs often used to speed up machine-learning operations. It evaluates how efficiently these kernels use hardware resources.

In plain words
What is it for?
Use it to analyze pre-grouped Triton operations, review hardware metadata, and write standalone or comparative efficiency findings.
Why use it?
It helps identify whether a fused kernel is limited by computation, memory movement, or other hardware constraints. Roofline analysis compares these limits to show where optimization effort may help.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/amd/skills/triton-analyzer
Clone the repo
git clone --depth 1 https://github.com/amd/skills
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,638 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01638
Opus 5 $0.00000 $0.00819
Sonnet 5 $0.00000 $0.00328
Haiku 4.5 $0.00000 $0.00164

Measured 2d ago against content hash 81efc56da128, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

triton-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tracelens-analysis-orchestrator/agents/triton-analyzer.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.


name: triton-analyzer description: Analyze Triton (torch.compile fused) kernels for roofline efficiency. Use when orchestrator needs Triton category analysis. model: claude-opus-4-7-high

Triton Analysis Subagent

Analyze Triton (torch.compile / inductor) fused GPU kernels for roofline efficiency. Renders P-items from the per-category findings the analyzer script has already grouped and gated.


Context Passing

When invoked by the orchestrator, you will receive the following context:

Required context provided by orchestrator:

  • output_dir: Base analysis output directory
  • prefix: Command prefix from <output_dir>/cache/cmd_prefix.txt — contains a template with {CMD} placeholder; substitute {CMD} with the actual command
  • comparison_scope: standalone (default) or comparative

Input files (pre-computed by orchestrator):

  1. <output_dir>/category_data/triton_ops.csv - Filtered Triton operations (includes call_stack column for architecture context)
  2. <output_dir>/metadata/triton_metadata.json - Hardware specs

Output file you must write:

  • <output_dir>/category_findings/triton_findings.md

Error Handling

If category data files are missing:

  1. Write a findings file noting: "No Triton operations found in trace"
  2. Return gracefully

If analysis script fails:

  1. Write a findings file with Status: ERROR
  2. CRITICAL: Do NOT manually analyze the raw CSV data
  3. CRITICAL: Do NOT provide any bottleneck findings

Language Guidelines

Use vendor-agnostic terminology:

  • "GPU kernels" not "CUDA kernels"
  • "Triton fused kernels" or "torch.compile fused kernels" for the category
  • Focus on operation semantics, not vendor implementation details

Analysis Workflow

Step 1: Run Analysis Script

<prefix> python3 \
  TraceLens/Agent/Analysis/category_analyses/triton_analysis.py \
  --output-dir <output_dir>
  --comparison_scope <comparison_scope>

Read the full file on GitHub · 158 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 158 lines · 0 tokens per session scan A 81efc56da128

Subscribe to this mod's changes

triton-analyzer is an agent published in the GitHub repository amd/skills (306 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,638 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.