Autonomous GPU Kernel Timeline
Use this inside an AKA optimization episode only after a correct runnable kernel and representative
workload exist. Do not trigger it when aggregate kernel timing or ordinary profiler evidence already
answers the question.
Ownership
- AKA chooses the hypothesis, sites, writer roles, density, boundary semantics, and number of retries.
- The backend records and decodes those choices without silent identity, capacity, or pairing errors.
- The final validator rejects known factual failures; it does not decide whether AKA chose the best
algorithm boundary or interpretation.
Route
- Standalone CUDA and inline PTX: read references/cuda-backend.md
and use
backends/cuda_backend/atrex_timeline.cuh.
- CuTe DSL: read references/iket-quickstart.md and use IKeT. Do not
fall back to the CUDA backend.
Autonomous loop
- State one falsifiable timing question and begin with the fewest useful sites.
- Save the current clean
kernel.py content, then create an instrumented working snapshot in the
same episode worktree. This snapshot is not a handoff candidate and must not enter promotion or
stall accounting.
- Run representative correctness through the immutable evaluator and capture through the campaign
sandbox. For final evidence, pass the sandbox-owned
.atrex_long_horizon/evaluations.jsonl as
--correctness-evidence; a model-supplied --correctness passed is only an exploration note and
cannot produce decision_grade. Use scripts/timeline.py to validate and export the returned
evidence. If the remote command reads backend files, pass
--input skills/autonomous-gpu-kernel-timeline/backends/<backend> to tools/sandbox.py; sync only
the attempt-specific directory.
- Read the summary and Perfetto trace. Remove, move, or refine probes and repeat when the evidence
is insufficient, semantically misplaced, or too intrusive. Name every reported interval as
start_site -> end_site and recompute its numbers from canonical events rather than trusting a
prose label. A local timeline delta is mechanism evidence, not a substitute for probe-free
end-to-end ABBA. Reviewer feedback is optional.
- Before replacing the snapshot, preserve its source or reversible patch and its content hash.
- Restore a probe-free kernel, implement the optimization, and use the normal evaluator for final
correctness and performance. Re-instrument the new clean state only when confirmation is useful.
For a final perturbation claim, use scripts/timeline.py measure inside one GPU allocation. Give it
baseline/instrumented commands as JSON argv arrays, the exact sources, and materialized binaries when
the compiler exposes them. JIT-only CuTe DSL measurements need not invent a binary artifact.
Each command must perform the requested warmup and iterations, synchronize the device, check the full
representative output, and emit exactly one line of this form:
__ATREX_TIMELINE_SAMPLE__={"latency_ms":1.0,"correctness":"passed","synchronized":true,"workload_identity":"...","device_identity":{"uuid":"..."},"warmup":10,"iterations":100}
The helper runs each sample in a fresh process, defaults to ABBA followed by BAAB, rejects workload or
device drift, and writes the raw schedule and samples. Pass that artifact to capture/export with
--measurement; validate rechecks its hashes and recomputes the medians and overhead.
The sample's correctness field rejects a bad timing run but does not replace the immutable evaluator
record required for final evidence.
Hard boundaries
- Never modify
profile_driver.py, evaluators, ground truth, or other protected paths.
- Never hand off or promote an instrumented snapshot. Only a probe-free kernel may become the
episode
candidate_commit == HEAD.
- Do not combine events from different launches into one apparent execution.
- Construct exactly one recorder per selected owner per launch and reuse it for that owner's events;
duplicate ownership is a capture failure, not a sampling policy.
- Reject overflow, truncation, invalid owner/site identity, deterministic range mismatch, stale
source/binary/workload provenance, and unrecomputable numeric claims.
- Never classify final evidence as
decision_grade without a matching sandbox evaluator record.
- The default low-perturbation target is 10%. A higher-overhead trace may remain diagnostic when it
is labelled honestly; the threshold is hard only when the task explicitly requires it.
- Do not add fixed site catalogs, fixed coverage quotas, mandatory reviewer approval, or a separate
orchestration state machine.
1---2name: autonomous-gpu-kernel-timeline3description: Let AKA autonomously add, run, inspect, and revise intra-kernel timeline probes for standalone CUDA/inline PTX or CuTe DSL when ordinary benchmark, NSYS, or NCU evidence cannot answer a specific kernel-internal timing question.4---56# Autonomous GPU Kernel Timeline78Use this inside an AKA optimization episode only after a correct runnable kernel and representative9workload exist. Do not trigger it when aggregate kernel timing or ordinary profiler evidence already10answers the question.1112## Ownership1314- AKA chooses the hypothesis, sites, writer roles, density, boundary semantics, and number of retries.15- The backend records and decodes those choices without silent identity, capacity, or pairing errors.16- The final validator rejects known factual failures; it does not decide whether AKA chose the best17 algorithm boundary or interpretation.1819## Route2021- Standalone CUDA and inline PTX: read [references/cuda-backend.md](references/cuda-backend.md)22 and use `backends/cuda_backend/atrex_timeline.cuh`.23- CuTe DSL: read [references/iket-quickstart.md](references/iket-quickstart.md) and use IKeT. Do not24 fall back to the CUDA backend.2526## Autonomous loop27281. State one falsifiable timing question and begin with the fewest useful sites.292. Save the current clean `kernel.py` content, then create an instrumented working snapshot in the30 same episode worktree. This snapshot is not a handoff candidate and must not enter promotion or31 stall accounting.323. Run representative correctness through the immutable evaluator and capture through the campaign33 sandbox. For final evidence, pass the sandbox-owned `.atrex_long_horizon/evaluations.jsonl` as34 `--correctness-evidence`; a model-supplied `--correctness passed` is only an exploration note and35 cannot produce `decision_grade`. Use `scripts/timeline.py` to validate and export the returned36 evidence. If the remote command reads backend files, pass37 `--input skills/autonomous-gpu-kernel-timeline/backends/<backend>` to `tools/sandbox.py`; sync only38 the attempt-specific directory.394. Read the summary and Perfetto trace. Remove, move, or refine probes and repeat when the evidence40 is insufficient, semantically misplaced, or too intrusive. Name every reported interval as41 `start_site -> end_site` and recompute its numbers from canonical events rather than trusting a42 prose label. A local timeline delta is mechanism evidence, not a substitute for probe-free43 end-to-end ABBA. Reviewer feedback is optional.445. Before replacing the snapshot, preserve its source or reversible patch and its content hash.456. Restore a probe-free kernel, implement the optimization, and use the normal evaluator for final46 correctness and performance. Re-instrument the new clean state only when confirmation is useful.4748For a final perturbation claim, use `scripts/timeline.py measure` inside one GPU allocation. Give it49baseline/instrumented commands as JSON argv arrays, the exact sources, and materialized binaries when50the compiler exposes them. JIT-only CuTe DSL measurements need not invent a binary artifact.51Each command must perform the requested warmup and iterations, synchronize the device, check the full52representative output, and emit exactly one line of this form:5354```text55__ATREX_TIMELINE_SAMPLE__={"latency_ms":1.0,"correctness":"passed","synchronized":true,"workload_identity":"...","device_identity":{"uuid":"..."},"warmup":10,"iterations":100}56```5758The helper runs each sample in a fresh process, defaults to ABBA followed by BAAB, rejects workload or59device drift, and writes the raw schedule and samples. Pass that artifact to capture/export with60`--measurement`; `validate` rechecks its hashes and recomputes the medians and overhead.61The sample's `correctness` field rejects a bad timing run but does not replace the immutable evaluator62record required for final evidence.6364## Hard boundaries6566- Never modify `profile_driver.py`, evaluators, ground truth, or other protected paths.67- Never hand off or promote an instrumented snapshot. Only a probe-free kernel may become the68 episode `candidate_commit == HEAD`.69- Do not combine events from different launches into one apparent execution.70- Construct exactly one recorder per selected owner per launch and reuse it for that owner's events;71 duplicate ownership is a capture failure, not a sampling policy.72- Reject overflow, truncation, invalid owner/site identity, deterministic range mismatch, stale73 source/binary/workload provenance, and unrecomputable numeric claims.74- Never classify final evidence as `decision_grade` without a matching sandbox evaluator record.75- The default low-perturbation target is 10%. A higher-overhead trace may remain diagnostic when it76 is labelled honestly; the threshold is hard only when the task explicitly requires it.77- Do not add fixed site catalogs, fixed coverage quotas, mandatory reviewer approval, or a separate78 orchestration state machine.