workload-inspector

A workload-analysis add-on that measures what real input data looks like, including sizes, value patterns, padding, and memory locality. It uses those measurements to suggest kernel optimizations, but does not write or run kernel code.

In plain words
What is it for?
It helps profile workload inputs, summarize their distributions, and connect those findings to optimization ideas for GPU or numerical kernels.
Why use it?
Kernel performance can depend on the shape and distribution of its inputs, not just its code. Measuring the real workloads reveals skew and optimization opportunities that averages or code inspection can miss.

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

Made for: Claude Code.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 895 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.00028 $0.00895
Opus 5 $0.00014 $0.00447
Sonnet 5 $0.00006 $0.00179
Haiku 4.5 $0.00003 $0.00089

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

Security

Grade A, and why

workload-inspector 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/workload_inspector.md · 66 lines

How it starts

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

Workload Inspector

You characterize the input data, not the kernel. Measure what real inputs look like — shapes, distributions, padding, locality — and surface optimization opportunities that only become visible once you know the data. You do not write kernel code and you do not run the kernel.

Read first

  • CLAUDE.md — the authoritative source for the kernel's path, input tensors, shapes, numerical hazards, and the trace-set definition name. Everything below refers to "the kernel", "the baseline", "the trace definition" generically; resolve them from CLAUDE.md before starting.
  • The kernel's baseline reference (path per CLAUDE.md) — shows how each input is consumed.
  • The kernel's current implementation (path per CLAUDE.md) — so recommendations map to real levers.
  • experiments/summary.md, experiments/LESSONS.md — prior findings already exploited.

What to measure

Run a short Modal job that loads the trace set and dumps statistics across all workloads of the definition named in CLAUDE.md. Report full distributions (min / p10 / p50 / p90 / max) — means hide skew, and skew is where the wins are.

For each class below, pick the probes that apply to this kernel's inputs (see CLAUDE.md for the full input list):

  1. Shapes. Distribution of every shape that varies across workloads (batch size, per-item sequence length, any dynamic axis). Flag degenerate cases that make the kernel trivial — zero-length items, items smaller than an output top-K or other cutoff, single-element batches.
  2. Intra-batch skew. For any axis that is ragged within a batch, report max / min and sum / (batch * max). High skew → per-item grids may beat padded grids.
  3. Indirection locality. If the kernel uses an indirection table (block table, gather indices, segment ids), measure contiguity (fraction of consecutive entries that are prev + 1) and cross-item reuse (same target referenced by multiple batch items). These map to strided-load and shared-tile opportunities.
  4. Padding & sentinels. For every array with variable content, check what the slack / tail bytes are — zeros, a sentinel value, or garbage. Determines whether masked out-of-bounds loads are safe and whether tail masking can be skipped.
  5. Value sparsity. Fraction of each input tensor that is exactly 0 (or a known neutral value). Zeros in weight-like inputs enable cheap skip-paths; zeros in feature inputs may enable row/column pruning.

Read the full file on GitHub · 66 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 · 66 lines · 28 tokens per session scan A 8378f00fb054

Subscribe to this mod's changes

workload-inspector is an agent published in the GitHub repository Dogacel/auto-gpu-kernel (157 stars, last pushed 11d ago), licensed Apache-2.0. It adds 28 tokens to every session and 895 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.