infCraft

Kopt — Development skill for Claude Code

Development community

An agent skill (Claude Code / Codex) for GPU kernel optimization in the latency-bound regime: measured hardware constants, lower-bound and gap attribution, same-process ABBA screening, and an L0–L3 es.

How to install Kopt

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

What Kopt does

An agent skill (Claude Code / Codex) for GPU kernel optimization in the latency-bound regime: measured hardware constants, lower-bound and gap attribution, same-process ABBA screening, and an L0–L3 escalation ladder. CUDA/Triton, Hopper first.

Alternatives in Development

  • Ds Harness Remote — 基于 DeepSeek Harness 插件机制构建的远程访问方案,通过低延迟、端到端加密的 P2P 网络,支持使用 PC、移动端 和 Web 随时访问本地设备上的DSH 、CodeX、Cursor、Claude Cod 860 ★
  • Avatar Vo Reel — Build a fullscreen voiceover-over-b-roll reel — talking-head avatar hook, then fullscreen screen-capture b-rol 358 ★
  • Regime Detect 89 ★

README

kopt

An iteration protocol and toolkit for GPU kernel optimization, packaged as an agent skill for Claude Code and Codex. It targets the **latency-bound regime** (decode, bs=1, µs-scale multi-kernel pipelines), CUDA/Triton, Hopper first.

The skill itself (`SKILL.md`, references, tool output) is written in Chinese; LLM agents read it without trouble. [中文说明](README.zh-CN.md)

What it does

kopt answers two questions: **how to iterate**, and **how to tell when you have reached the ceiling**. Correctness definitions, the formal benchmark protocol, GPU scheduling and project rules come from your project and take precedence.

Four tenets:

  1. Bound first, then change. Every change targets a specific gap in the lower-bound model and states its expected gain in µs.
  2. Trust only same-process interleaved measurement. One-off comparisons across processes, GPUs or rounds prove nothing.
  3. When prediction and measurement disagree, fix the model before the next hypothesis. Repeated model calibration is how the agent "learns".
  4. Failures are data. Every attempt goes into a ledger; a hypothesis rejected under the same conditions is not retried.

The loop: measure hardware constants (`ubench`) → decompose and bound (`sol.py`: B_struct / B_pdl / B_alg plus a per-stage gap table) → write a hypothesis with a predicted Δµs → minimal implementation → ABBA screening (`ab.py`) → calibrate the model → your formal protocol. Optimizations climb an escalation ladder: L0 parameters → L1 memory access and in-CTA execution → L2 kernel boundaries and scheduling (fusion, last-block reduction, PDL, persistent kernels) → L3 algorithm/semantics changes, which require explicit user approval.

Contents

Path Purpose
kopt/SKILL.md Entry point: the protocol, campaign layout, ledger schema, evidence rules
kopt/references/bound.md Lower-bound modeling, B_struct / B_pdl / B_alg, gap table, ceiling argument
kopt/references/measure.md A/A noise