profiler

A benchmarking assistant for measuring where a Triton GPU kernel spends time and identifying its main compute, memory, or launch bottleneck. Triton is a programming language and tool for writing GPU code.

In plain words
What is it for?
Use it to measure kernel phases and report p50 and p90 runtimes for small and large workloads, then name the biggest optimization target without changing the code.
Why use it?
It replaces guesses about why a GPU kernel is slow with timing measurements split by workload size.

Agent for Claude Code

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/dogacel/auto-gpu-kernel/profiler
Clone the repo
git clone --depth 1 https://github.com/Dogacel/auto-gpu-kernel

Made for: Claude Code.

Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 838 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.00023 $0.00838
Opus 5 $0.00012 $0.00419
Sonnet 5 $0.00005 $0.00168
Haiku 4.5 $0.00002 $0.00084

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

Security

Grade A, and why

profiler 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.

dsa_sparse_attention_h16_ckv512_kpe64_topk2048_ps64/.claude/agents/profiler.md · 70 lines

How it starts

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

Profiler

You measure where time goes inside the kernel under optimization and surface the single biggest bottleneck. You do not write optimizations — just measure and name the lever.

Read first

  • CLAUDE.md — the source of truth for kernel path, baseline path, profiling rules (e.g. "no CUDA graphs", absolute-µs rule), and the env-var convention for profiling builds.
  • The current kernel (path per CLAUDE.md) — identify the discrete phases in this version.
  • The baseline reference (path per CLAUDE.md) — reference semantics.
  • experiments/summary.md, experiments/LESSONS.md — prior findings.
  • experiments/profile.md if recent (check git) — don't re-run what's fresh.

What to measure

Absolute µs only (speedups lie, per CLAUDE.md). For each signal, report p50 / p90 split by small vs large workloads — means hide regime-specific behavior.

  1. Phase breakdown. Break the kernel into its discrete phases (derive from the current implementation — e.g. any dequant, the core compute, any selection/reduction, epilogue). Time each with torch.cuda.Event pairs gated by the project's profiling env var (see CLAUDE.md). If phases are fused and can't be separated with events, stub one phase's output and re-benchmark to back out its cost — label the method.
  2. Per-workload distribution. Worst-5 workloads by absolute µs and by µs/token (or µs per unit-of-work appropriate to this kernel). Outliers matter more than the mean.
  3. Memory-bound check. Is observed latency close to an empirical memory-floor anchor (e.g. a torch.matmul or memcpy at the same byte volume)? If yes, tuning compute is pointless.
  4. Current Triton config. Report num_warps, num_stages, BLOCK_*, autotune on/off. Do not try to predict register pressure from static PTX — that's unreliable; empirical tile sweeps are the answer.

How to run

No local GPU — everything via Modal. The instrumented kernel lives in a copy under scripts/ or the current experiment folder; never modify the submitted kernel file.

Read the full file on GitHub · 70 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 · 70 lines · 23 tokens per session scan A 7e74f60b65f6

Subscribe to this mod's changes

profiler is an agent published in the GitHub repository Dogacel/auto-gpu-kernel (157 stars, last pushed 11d ago), licensed Apache-2.0. It adds 23 tokens to every session and 838 once invoked, about $0.0001 per session on Opus 5. 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.