kernel-exp-history

kernel-exp-history is a skill for Claude Code, Codex from AMD-AGI/Apex. It costs 37 tokens per session (1,454 once invoked), scanned A, original, MIT.

A local record of past GPU kernel optimization experiments, including their settings and results. It helps an agent find similar attempts and save the outcome of a new optimization.

In plain words
What is it for?
Use it to find high-scoring or similar kernel experiments, compare settings such as block sizes and memory changes, and record results after each optimization iteration.
Why use it?
It removes the need to search through old experiments manually or lose track of what has already been tried.

Skill for Claude CodeCodex

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 skills/amd-agi/apex/kernel-exp-history
Any agent
npx skills add AMD-AGI/Apex --skill kernel-exp-history
Clone the repo
git clone --depth 1 https://github.com/AMD-AGI/Apex

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kernel-exp-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/amd-agi/apex/kernel-exp-history.svg)](https://agentmods.dev/skills/amd-agi/apex/kernel-exp-history)
Your own site
<a href="https://agentmods.dev/skills/amd-agi/apex/kernel-exp-history"><img src="https://agentmods.dev/badge/skills/amd-agi/apex/kernel-exp-history.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,454 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.1 $0.00037 $0.01454
Opus 5 $0.00018 $0.00727
Sonnet 5 $0.00007 $0.00291
Haiku 4.5 $0.00004 $0.00145

Measured 5d ago against content hash a40243269479, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

kernel-exp-history 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/kernel_exp_dataclass.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

tools/skills/kernel-exp-history/SKILL.md · 164 lines

How it starts

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

Kernel Experiment History

Overview

Use the local kernel experiment database to look up prior optimization attempts and record new results after an optimization iteration completes.

Workflow

1) Find prior experiments for inspiration

  • Read references/kernel_exp_dataclass.py to understand the database helpers and schema.
  • Start with top_experiments(max_results=20) to get a score-sorted list of high-impact experiments.
  • If more context is needed, load full entries using get_experiment(exp_id) or list_experiments() and filter by operator_sig, dtype_sig, env, or base_commit.
  • Summarize the most relevant patterns (block sizes, memory changes, profiling signals, etc.) before proposing new optimizations.
Query Examples

Example 1: Find similar kernel optimizations

# Search for cache kernel optimizations
from kernel_exp_dataclass import list_experiments

experiments = list_experiments()
cache_exps = [e for e in experiments if 'cache' in e.operator_sig.lower()]

# Sort by score
cache_exps_sorted = sorted(cache_exps, key=lambda x: x.score, reverse=True)

print("Top cache kernel optimizations:")
for exp in cache_exps_sorted[:5]:
    print(f"  {exp.score:.4f}x - {exp.change_summary}")

Example 2: Find best unroll factor

# Compare different unroll factors
unroll_exps = [e for e in experiments if 'unroll' in e.change_summary.lower()]

for exp in unroll_exps:
    factor = 'unknown'
    if 'unroll 4' in exp.detailed_description.lower():
        factor = '4'
    elif 'unroll 8' in exp.detailed_description.lower():
        factor = '8'
    print(f"Unroll {factor}: {exp.score:.4f}x - {exp.operator_sig[:50]}")

Example 3: Learn from failures

# Find what NOT to do
failures = [e for e in experiments if e.score < 0.98 or e.is_buggy]

print("Failed optimizations (learn from these!):")
for exp in failures:
    print(f"  ❌ {exp.change_summary}")
    print(f"     Why: {exp.detailed_description[:100]}...")

Read the full file on GitHub · 164 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 164 lines · 37 tokens per session scan A a40243269479

Subscribe to this mod's changes

kernel-exp-history is a skill published in the GitHub repository AMD-AGI/Apex (76 stars, last pushed 2d ago), licensed MIT. It adds 37 tokens to every session and 1,454 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

write-cuda-reduction-kernel

Guide the agent through designing and implementing a correct, efficient CUDA reduction kernel for a given operator (sum, max, min, or custom binary associative op), covering warp-level primitives, block-level reduction, multi-block strategies, and when to use CUB instead.

tensormux/kernel-skills · 0 tokens

write-cuda-layernorm-kernel

Guide the agent through designing and implementing a correct, efficient CUDA LayerNorm (and RMSNorm) kernel, covering mean/variance computation strategies, Welford online accumulation, epsilon placement, affine transform application, backward pass structure, and decomposition for non-power-of-two hidden dimensions.

tensormux/kernel-skills · 0 tokens

write-triton-gemm-kernel

Guide the agent through implementing a correct, performant blocked matrix multiplication kernel in Triton. This covers tile assignment via programid, pointer arithmetic for A/B/C tiles, accumulation with tl.dot, boundary masking for non-divisible shapes, swizzled tile ordering for L2 reuse, and autotuning for…

tensormux/kernel-skills · 0 tokens

write-triton-layernorm-kernel

Guide the agent through implementing a correct, numerically stable row-wise layer normalization kernel in Triton. This covers mean and variance computation with fp32 accumulation, epsilon handling, affine transform with gamma/beta, the RMSNorm variant, masking for hidden dimensions not divisible by BLOCKSIZE, and…

tensormux/kernel-skills · 0 tokens

choose-tile-size-and-work-partitioning

Guide the agent through selecting tile sizes and work partitioning strategies for a CUDA or Triton kernel, based on shared memory budget, register pressure, occupancy targets, problem shape, and access pattern.

tensormux/kernel-skills · 0 tokens

write-numerically-stable-kernel

Guide the agent through identifying numerical instability risks in a kernel's computation path and applying the correct stabilization strategy for each risk class.

tensormux/kernel-skills · 0 tokens