fk-experiment
/fk-experiment
Przeprowadza dokładnie jeden eksperyment fast-kernel (stan, jedna hipoteza, edycja kandydata, ewaluacja, notatka) w bieżącej kampanii i się zatrzymuje.
- Autor
- kadirnar ↗
- Repozytorium
- fast-kernel ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 29.08.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 29.08.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Przeprowadza dokładnie jeden eksperyment fast-kernel (stan, jedna hipoteza, edycja kandydata, ewaluacja, notatka) w bieżącej kampanii i się zatrzymuje.
Wyzwalacze z opisu
Argumenty
/fk-experiment [campaign-dir] [--target <id>] [--technique <id>]
Oryginalny opis (EN)
Run exactly ONE fast-kernel experiment (state -> one hypothesis -> edit candidate/ -> fast-kernel eval -> note) in the current campaign and stop. The unit of work for /fk-optimize, `/loop /fk-experiment` and the Stop-hook loop. Use for "run one experiment", "next iteration", "try one more idea".
Jak działa
- 1. Read the state (2 minutes, no shortcuts)
- 2. Choose one hypothesis
- 3. Implement (candidate/ only)
- 4. Evaluate
- 5. Learn and stop
Podgląd SKILL.md
---
name: fk-experiment
description: Run exactly ONE fast-kernel experiment (state -> one hypothesis -> edit candidate/ -> fast-kernel eval -> note) in the current campaign and stop. The unit of work for /fk-optimize, `/loop /fk-experiment` and the Stop-hook loop. Use for "run one experiment", "next iteration", "try one more idea".
argument-hint: [campaign-dir] [--target <id>] [--technique <id>]
allowed-tools: Bash(fast-kernel *), Bash(fk *), Bash(uv run *), Bash(python *), Bash(.venv/bin/python *), Bash(git diff *), Bash(git log *), Bash(git status *), Bash(nvidia-smi *), Bash(cat *), Bash(ls *), Read, Edit, Write, MultiEdit, Glob, Grep
---
# /fk-experiment — one iteration, in full
Campaign: `$ARGUMENTS` if a directory was given, else `uv run fast-kernel resolve "continue" --json` →
`campaign`. Run every command as `cd <campaign> && uv run fast-kernel ...`.
## 1. Read the state (2 minutes, no shortcuts)
```bash
uv run fast-kernel brief # one screen: incumbent + threshold, plateau streak, ranked targets
# (share, SOL, tried/accepted) with their measured memory, last
# experiments with reasons, latest insights
```
That is the whole per-iteration read. Go deeper only where the brief points: `PLAN.md` for shapes and the
top-kernels table (regenerate with `uv run fast-kernel profile` if it predates the incumbent), `KNOWLEDGE.md`
for every insight, `uv run fast-kernel memory --target <id>` for the full history of one target, and
`uv run fast-kernel show <N> --log` when the last experiment failed. `fast-kernel status --brief`,
`ideas` and `history` still exist for their individual views.
## 2. Choose one hypothesis
Score = share × (1 − roofline efficiency), from `brief`. A streak of 5+ in the brief means PLATEAU: change
the approach or the target before anything else (the backend is fixed — see step 3). Tie-breaks: untried > larger measured share >
lower SOL > smaller diff. The technique itself is never prescribed — discover it from the measurements. A focus given as `--target/--technique` wins unless it is
clearly exhausted. Write the hypothesis as one line before touching code:
`"<what> for <target class> via <technique/backend>; expect ~<x>% end-to-end because <share/boundness>"`.
Do not pick: an identical failed edit; a technique whose skill you have not read; anything that changes
GOAL.md's policy.
## 3. Implement (candidate/ only)
- Kernel in `candidate/kernels/<name>.py`, integration in `candidate/__init__.py: apply(model, ctx)`
(module swap or forward monkeypatch; keep signatures), `report()` evidence (`active`, `invocations`).
- **The implementation backend is CUDA C++** (`/cuda-cpp-kernels`), written with
`fastkernel.backends.cuda_cpp.load_cuda_inline`, captured with `/cuda-graphs`
(`fastkernel.backends.graphs.Graphed` / `ShapeBucketedGraphs`). Leaving an op on stock torch, or taking a
pre-built CUDA kernel from `/hub-kernels`, are legitimate answers. Do not write Triton, TileLang or CuTe
kernels — see AGENTS.md for the measurements behind that. Start from `uv run fast-kernel templates`.
- Numerics per `/numerical-verification`: fp32 accumulation, fixed-order reductions, exact argmin via
coarse pass + fp32 re-rank, reference tie-breaks and padding. Strict policy = identical outputs.
- Self-test before eval: a 20-line script in `/tmp` comparing the kernel with the torch reference on
the real shapes from PLAN.md (`torch.testing.assert_close`, plus `torch.equal` for discrete outputs).
- Warm up every shape in `apply()`; autotune results cached under `candidate/tuned/`; no `.item()`,
`.cpu()`, data-dependent Python or allocations in the hot path when graphs are involved.
## 4. Evaluate
```bash
uv run fast-kernel eval -m "<the one line>" --technique <id[,id]> --target <id> # add --simpler only when deleting code at equal speed
```
Read the verdict: gates (which stage/check failed, value vs threshold), metric vs incumbent vs
threshold, kernel count, GPU busy, next target. Crash with a trivial cause (typo, import, stride,
`.contiguous()`, meta tensor) → fix and rerun once. Anything else → accept the revert.
The verdict line also names the **decision basis**. `anchored ratio vs the reference model` means the
candidate and the reference were timed interleaved in one process, so the comparison is free of
session-to-session drift and the threshold is that measurement's own uncertainty (typically well
under 1 %). `raw milliseconds` means no anchor was available and the threshold falls back to the
baseline noise floor — one `fast-kernel eval --force` on a clean tree fixes that for good.
**bank** = the gain was real but below the resolution limit. The harness committed it and left it in
`candidate/`; build the next experiment on top of it rather than reverting or re-testing it. The
incumbent deliberately does not move, so the accumulated tree is compared against the last number
the campaign can defend, and is promoted in one keep when the pile clears the threshold.
## 5. Learn and stop
```bash
uv run fast-kernel note "<insight with numbers: what, how much, why, what next>" --tags <technique,target>
```
Then stop after exactly one recorded experiment with three lines:
`#N [status] <metric> (Δ vs incumbent) · <speedup>× vs baseline · kernels <k>`,
`gates: ...` (or the failing check), `next: <the hypothesis you would run next>`.
Never ask whether to continue — the loop calls this skill again.
Wersje
W bazie nie ma innych skilli o nazwie fk-experiment.
Migawka bazy z 13.11.2026 · wersja paczki b8de0b69118a (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 82fk-loop
Wyjaśnia i konfiguruje trzy sposoby, by fast-kernel optymalizował bez przerwy: zaplanowane wybudzenia, hak Stop i tryb headless. - 90fk-parallel
Uruchamia kilku agentów fast-kernel równolegle w jednej kampanii, każdego we własnym worktree, i mierzy propozycje po kolei w skrzynce. - 95run-local-experiment
Uruchamia i debuguje jeden eksperyment lokalnie na GPU badacza, bez osobnego serwera, i zwraca ustrukturyzowany wynik. - 100setup-experiment
Prowadzi interaktywnie przez konfigurację eksperymentów symulacji agentów: tworzy zadania, dobiera środowiska, buduje eksperyment, ustawia sygnały i opcjonalnie uruchamia pierwszą iterację. - 95trigger-experiment
Uruchamia eksperyment lub benchmark na zbiorze danych przez webhook POST, gdy użytkownik chce go wystartować. - 95run-ec2-experiment
Uruchamia eksperyment na przydzielonym serwerze GPU w EC2, debuguje go w ramach budżetu czasu i zwraca ustrukturyzowany wynik.