agentleFS
saint0xsaint0x/my-skills/kernel-engineering/SKILL.md

kernel-engineering

Skill1 starsChanged 3 months agoMITView on GitHub

Use when the user wants to design, review, refactor, optimize, or productionize high-performance compute kernels such as attention, KV-cache, CUDA, ROCm, Triton, CUTLASS, or fused tensor kernels. Especially useful for kernel decomposition, precision policy, metadata ABI design, launch-shape selection, fast-path partitioning, correctness boundaries, benchmarking, replayable validation, and turning a working kernel into a cleaner elite implementation without regressions.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the task is not just to make a kernel faster, but to make it sharper, cleaner, safer, and more repeatable as an …

    line 8
  2. Distinctive:

    Do not chase elegance by deleting production safeguards.

    line 33
  3. Distinctive:

    Prefer a kernel family over one universal kernel when regimes are materially different.

    line 48
  4. Distinctive:

    Keep hot loops free of avoidable branching, unused fields, and debug work.

    line 50
  5. Distinctive:

    Treat metadata layout as part of kernel design, not a side detail.

    line 51
  6. Distinctive:

    Use exact or tightly bounded correctness checks, not vibes.

    line 54
  7. Distinctive:

    Read references/kernel-engineering.md before making substantial kernel design or refactor decisions.

    line 58
  8. Distinctive:

    Use it especially for:

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kernel Engineering

Use this skill when the task is not just to make a kernel faster, but to make it sharper, cleaner, safer, and more repeatable as an engineering discipline.

The goal is to preserve production truth while improving kernel elegance.

Use This Skill For

  • Designing a new high-performance kernel or kernel family
  • Refactoring an existing kernel that already works
  • Splitting a broad kernel into narrower fast paths
  • Reviewing attention, KV-cache, fused recurrence, quantized, or paged-cache kernels
  • Improving CUDA, ROCm, Triton, HIP, or CUTLASS kernel engineering quality
  • Building a no-regression optimization roadmap
  • Creating kernel validation, benchmarking, and rollout discipline

Core Principle

Elite kernel engineering comes from combining:

  • narrow kernel contracts
  • explicit regime selection
  • kernel-shaped metadata
  • numerically justified precision choices
  • launch-shape discipline
  • strict correctness and replayability

Do not chase elegance by deleting production safeguards. Move safeguards out of the hot path instead.

Workflow

  1. Identify the real regimes.
  2. Separate system policy from kernel hot-path work.
  3. Define the kernel-facing ABI for each regime.
  4. Minimize each kernel's responsibility.
  5. Make precision and tile decisions explicit and falsifiable.
  6. Build reference tests and narrow microbenches before changing code.
  7. Refactor one regime at a time behind strict gating.
  8. Require no-regression proof before promotion.

Working Rules

  • Prefer a kernel family over one universal kernel when regimes are materially different.
  • Push decisions upstream when the scheduler, planner, or metadata builder already knows the answer.
  • Keep hot loops free of avoidable branching, unused fields, and debug work.
  • Treat metadata layout as part of kernel design, not a side detail.
  • Encode supported shapes, fallback shapes, and preferred shapes explicitly.
  • Preserve fail-closed behavior at every production boundary.
  • Use exact or tightly bounded correctness checks, not vibes.

Read Next

Read references/kernel-engineering.md before making substantial kernel design or refactor decisions.

Use it especially for:

  • regime partitioning
  • metadata ABI cleanup
  • raw-only versus mixed-layout strategy
  • numerical contract design
  • launch heuristics
  • benchmarking and rollout gates

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.