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.
中文简介正在准备中。当前显示原文说明。
Learn the target framework from enabled knowledge tools and implement a baseline GPU kernel. Use this skill to understand compute semantics, determine the target platform and framework, search reference implementations, and produce a correct V0 baseline with performance records for later profile-driven optimization.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Use this skill when the user provides PyTorch logic or a kernel demo and asks to:
kernel.py, reference.py, test_kernel.py, and baseline_report.md for later profile-driven optimization.This stage first understands the PyTorch semantics, then learns the framework APIs (CuteDSL or FlyDSL) through enabled knowledge tools, implements kernel.py and test_kernel.py, validates correctness, records performance, writes baseline_report.md, and writes memory/v0.json.
The orchestrator installs discovered plugin instructions at .atrex_plugins/instructions.md.
kernel_demo.GEMM, Decode Attention, Reduction, or Elementwise.CuteDSLFlyDSLFlyDSL.atrex_plugins/instructions.md and inspect python3 tools/plugin.py list for enabled
tool names and input schemas. Follow the session's phase-specific plugin instructions.plans/v0_plan.md.kernel.py based on PyTorch semantics and the learned framework APIs.Not only must the functionality be correct, but the framework implementation must also be correct, using either CuteDSL or FlyDSL.test_kernel.py using PyTorch logic directly as the correctness reference.ref = pytorch_reference(inputs)
out = kernel_v1(inputs)
rel_err = (out.float() - ref).norm() / ref.norm()
assert rel_err < 0.01
rel_err < 0.01; lower precision formats may use task-specific relaxed thresholds.test_kernel.py to prevent hanging:import signal
def timeout_handler(signum, frame):
raise TimeoutError("Test case exceeded timeout limit")
signal.signal(signal.SIGALRM, timeout_handler)
TIMEOUT_SEC = int(os.environ.get("TEST_TIMEOUT_SEC", "30"))
for case in test_cases:
signal.alarm(TIMEOUT_SEC)
try:
run_test(case)
except TimeoutError:
record_failure(case, "TIMEOUT_FAIL")
finally:
signal.alarm(0)
--multi-seed and do not launch a separate robustness run for V0:python tools/sandbox.py --kind run --no-sync -- \
python test_kernel.py --version v0 --no-memory
Parse the emitted [test_kernel] RESULT_JSON=..., use its performance result and accompanying
correctness status for memory/v0.json, and avoid repeating the expensive baseline workload.
TEST_TIMEOUT_SEC env var).TIMEOUT_FAIL, kill the process, and record the failure in baseline_report.md.rel_err plus PASS/FAIL.latency(us) | TFLOPS | bandwidth(GB/s) | TFLOPS peak utilization(%) | bandwidth peak utilization(%)
compute_utilization.py to calculate TFLOPS and bandwidth utilization:python tools/compute_utilization.py --gpu <gpu> --dtype <dtype> --flops-expr '<expr>' --bytes-expr '<expr>' --time-ms <ms> --grid-blocks <blocks>
Every theoretical peak, bandwidth, and utilization calculation must cite the auditable spec sources registered in Step 0.
Write baseline_report.md with:
rel_err, PASS/FAIL (include any TIMEOUT_FAIL cases)Write baseline iteration data to memory/v0.json using tools/memory_manager.py:
# Create the iteration file
python tools/memory_manager.py create --workspace kernel_opt_<name> --version v0
# Fill in performance and metadata
python tools/memory_manager.py update --workspace kernel_opt_<name> --version v0 \
--set 'performance.latency_us=<value>' \
--set 'performance.tflops=<value>' \
--set 'performance.bandwidth_gbps=<value>' \
--set 'performance.tflops_peak_utilization_pct=<value>' \
--set 'performance.bandwidth_peak_utilization_pct=<value>' \
--set 'optimization.action_category=baseline' \
--set 'optimization.action_description=<summary>' \
--set 'correctness.rel_err=<value>' \
--set 'correctness.status=PASS' \
--set 'quality_gate.result=PASS'
For array fields (pitfalls_and_fixes, references), update the JSON file directly or use read + manual edit + write-back. Fill in:
pitfalls_and_fixes: any errors encountered during implementationreferences: stable source record ids and other docs referenced during learningAfter the quality gate passes, commit:
git add kernel.py test_kernel.py baseline_report.md memory/v0.json README.md
git commit -m "V0: baseline kernel"
Each iteration produces a memory/v<N>.json file following the schema defined in reference/v_iteration.schema.json. The JSON structure captures performance data, optimization actions, profile evidence, correctness results, ISA metric progress, search logs, pitfalls and fixes, and references.
Key rules:
masked field defaults to false. When set to true, the file is skipped during reads.README.md and must be derived from documented best practices, hardware specs, and Step 0 Roofline conclusions. Do not fabricate thresholds from experience.kernel.pyreference.pytest_kernel.pybaseline_report.mdmemory/v0.json还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
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.
中文简介正在准备中。当前显示原文说明。
Generate a structured implementation plan from an evidence draft. Validate paths, obtain configured independent Codex and Qoder reviews, synthesize available advice against repository evidence, preserve the draft, and produce testable acceptance criteria and validation steps.
中文简介正在准备中。当前显示原文说明。
Run the evidence loop of one long-horizon GPU kernel optimization episode. Use this skill to reconstruct the incumbent, profile and localize a bottleneck, research progressively, plan one coherent direction, implement and repair, validate development correctness and performance, and record every decisive experiment in the episode journal.
中文简介正在准备中。当前显示原文说明。
Mine a per-kernel optimization trace — a git repository capturing successive versions of one kernel being optimized — into structured, gate-validated optimization-experience records for the GPU kernel wiki. Use when asked to distill an optimization run, a kernel_opt trace directory or a version ladder into wiki records; to report what such a run actually achieved; to build, extend, re-run or validate the staging store behind those records; or to explain how a trace-derived record's number, snippet or provenance was established.
中文简介正在准备中。当前显示原文说明。
Choose and run ACU-only, adaptive PPU in-kernel timeline, or optional bounded joint analysis for a PPU kernel. Use for device-level bottleneck diagnosis, kernel-internal critical-path questions, or evidence that genuinely needs both; do not require all three modes.
中文简介正在准备中。当前显示原文说明。
Quickly extract a typed GPU-Wiki query intent from prose. Never inspect or query a knowledge store.
中文简介正在准备中。当前显示原文说明。