anchi205

Kernel Ladder — Development skill for Claude Code

Development community

Agent harness that writes and verifies GPU kernels.

How to install Kernel Ladder

This entry records only its repository, not the path inside it, so there is no exact command to give. Open anchi205/kernel-ladder and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Kernel Ladder does

Agent harness that writes and verifies GPU kernels. Claude proposes Triton kernels; a fixed verifier gates correctness, determinism and speed. Retry loop with exit rules, parallel strategy graph, undo-cost gates, remote CUDA runner. Benchmarked vs torch.compile and library ops on an NVIDIA GB10

Alternatives in Development

  • Arreflect — AgentRecall consolidation & reflection — periodic triage of recurring corrections; proposes rule changes, neve 370 ★
  • Cloud Run Debug — Diagnose a failing Cloud Run service — Antigravity (agy/Gemini) digests the error logs cheaply, Claude infers 284 ★
  • Position Ladder — Position Ladder — Staged Entry & Cost-Basis Management 192 ★

README

KernelLadder

An agent that writes and optimizes GPU kernels and proves every speedup, built on the harness / loop / graph ladder. This stage is the check: correctness against a fixed reference, then timing against it, with EXPECTED / SAW / FENCE / DEAD ENDS feedback.

Ops

op what it is reference
softmax row softmax torch's fused kernel (hard to beat)
rmsnorm RMS normalization unfused eager ops (fusion wins)
attention causal scaled dot-product attention naive: materializes the score matrix
int8_matmul int8 x int8 with per-row/col scales float matmul + 2 scale multiplies
kv_quant quantize new K/V rows to int8 + scales (2 outputs) 8 eager kernels

Setup

uv venv && uv pip install -e ".[dev]"
pytest -q          # CPU-side tests; GPU tests skip without KL_SSH_TARGET

The remote GPU box needs its own environment: see REMOTE_SETUP.md.

Run checks on a remote GPU container

export KL_SSH_TARGET=user@host KL_CONTAINER= KL_SSH_KEY=~/.ssh/id_ed25519
# optional: KL_REMOTE_PYTHON (default ~/kl-venv/bin/python), KL_REMOTE_DIR (default ~/work/kernelladder)
kernelladder check softmax candidates/softmax_stable.py --remote --min-speedup 0

The verifier and reference ops are synced to the box on each run; the candidate is sent on stdin. Remote tests skip unless `KL_SSH_TARGET` is set.

Let Claude write the kernel

kernelladder optimize rmsnorm --remote --target 1.5 --max-attempts 8      # --proposer code (default)

The default proposer runs the local `claude -p` CLI (Claude Code, logged in with a subscription), with tools off in an empty directory. All results in RESULTS.md came from it. `--proposer api` uses the Anthropic API instead and needs `ANTHROPIC_API_KEY` (or `ant auth login`). The agent is nondeterministic: re-running gives different kernels, while the checker itself is deterministic.

The parallel strategy graph

kernelladder graph attention --re