aiter-reflection

aiter-reflection is a skill for Claude Code, Codex from AMD-AGI/Apex. It costs 46 tokens per session (766 once invoked), scanned C, original, MIT.

A workflow for optimizing AMD MI300 GPU kernels in the AITER project, checking that they remain correct, benchmarking them, and saving each iteration's results. It includes guidance for tests, benchmark scripts, warmups, repetitions, and synchronization.

In plain words
What is it for?
Use it to locate target kernels and tests, run correctness checks, build benchmark scripts for common input sizes, compare timings, and record optimization results.
Why use it?
It creates a repeatable way to measure kernel changes and avoid treating compilation time or unreliable timings as performance results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to locate target kernels and tests, run correctness checks, build benchmark scripts for common input sizes, compare timings, and record optimization results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/amd-agi/apex/aiter-reflection
View source ↗ AMD-AGI/Apex
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AMD-AGI/Apex --skill aiter-reflection
Clone the repo
git clone --depth 1 https://github.com/AMD-AGI/Apex

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aiter-reflection

README.md
[![agentmods](https://agentmods.dev/badge/skills/amd-agi/apex/aiter-reflection/github.svg)](https://agentmods.dev/skills/amd-agi/apex/aiter-reflection)
Your own site
<a href="https://agentmods.dev/skills/amd-agi/apex/aiter-reflection"><img src="https://agentmods.dev/badge/skills/amd-agi/apex/aiter-reflection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aiter-reflection

Your own site · 80×15
<a href="https://agentmods.dev/skills/amd-agi/apex/aiter-reflection"><img src="https://agentmods.dev/badge/skills/amd-agi/apex/aiter-reflection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.00766
Opus 5.5 $0.00018 $0.00306
Sonnet 5.5 $0.00009 $0.00153
Haiku 4.5 $0.00005 $0.00077

Measured 1mo ago against content hash e71dfa936c10, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

aiter-reflection scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `rm -f aiter/jit/*.so && rm -rf aiter/jit/build ~/.aiter`
tools/skills/aiter-reflection/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Aiter Reflection

Overview

Optimize AMD MI300 GPU kernels for correctness and performance using the aiter workflow, then record each iteration to the kernel experiment database.

Workflow

1) Locate targets and understand tests

  • Use the provided context to identify target kernel files, kernels, and their op tests.
  • Run the op tests once to understand output format and verify correctness expectations. (Attention: Stucked background op test processes and lock files under jit folder may cause the op tests running failed; Op tests require JIT compiling, please be prepared to wait for a long time)

2) Build a benchmark shell script

  • Come up with a new name for this iteration and create a folder logs/. Put the shell script under this folder
  • Reuse the existing op_test python script
  • Covers common shapes: 128, 256, 512, 1024, 2048, 4096 if applies
  • Repeats each op test multiple times and reports the correctness and the average time consuming.
    • Use at least 100 iterations per configuration for reliable results
    • Include 10-20 warmup iterations to handle JIT compilation overhead
    • Add torch.cuda.synchronize() after each kernel call
    • Use fixed random seed for reproducibility
    • Use high-precision timing (time.perf_counter())
  • Implements a robust timeout to avoid hangs.
  • Outputs structured timing per shape.

3) Establish a baseline

  • Before testing: Check for background GPU processes that may interfere
    • Use rocm-smi or ps aux | grep python to identify GPU tasks
    • Stop any unrelated GPU workloads
  • Clear JIT compilation cache to ensure clean state
  • Run the benchmark script using the .venv Python environment
  • Save results under logs/ folder with timestamp

4) Iterate on kernel optimization (one iteration)

  • Read the kernel source, identify bottlenecks, and call rocprof-compute at least once to deepen bottleneck analysis.
  • Use kernel-exp-history to review related optimization history and extract ideas.
  • Modify the kernel file to improve performance for multiple shapes allowed.
  • Save the changes: (git diff > logs//iter_diff.patch)
  • Reinstall aiter and clear cache:
    • python -m pip install -e . --no-build-isolation --no-deps --force-reinstall
    • rm -f aiter/jit/*.so && rm -rf aiter/jit/build ~/.aiter
  • Re-run the benchmark to measure the new performance.
  • If results seem suspicious (unexpected regressions):
    • Verify no background processes are running
    • Re-test baseline with same methodology
    • Check if JIT compilation overhead affected measurements

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 73 lines · 46 tokens per session scan C e71dfa936c10

Subscribe to this mod's changes

aiter-reflection is a skill published in the GitHub repository AMD-AGI/Apex (78 stars, last pushed 23d ago), licensed MIT. It adds 46 tokens to every session and 766 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

write-cuda-layernorm-kernel

Guide the agent through designing and implementing a correct, efficient CUDA LayerNorm (and RMSNorm) kernel, covering mean/variance computation strategies, Welford online accumulation, epsilon placement, affine transform application, backward pass structure, and decomposition for non-power-of-two hidden dimensions.

tensormux/kernel-skills · 0 tokens

write-cuda-reduction-kernel

Guide the agent through designing and implementing a correct, efficient CUDA reduction kernel for a given operator (sum, max, min, or custom binary associative op), covering warp-level primitives, block-level reduction, multi-block strategies, and when to use CUB instead.

tensormux/kernel-skills · 0 tokens

write-triton-gemm-kernel

Guide the agent through implementing a correct, performant blocked matrix multiplication kernel in Triton. This covers tile assignment via programid, pointer arithmetic for A/B/C tiles, accumulation with tl.dot, boundary masking for non-divisible shapes, swizzled tile ordering for L2 reuse, and autotuning for…

tensormux/kernel-skills · 0 tokens

write-triton-layernorm-kernel

Guide the agent through implementing a correct, numerically stable row-wise layer normalization kernel in Triton. This covers mean and variance computation with fp32 accumulation, epsilon handling, affine transform with gamma/beta, the RMSNorm variant, masking for hidden dimensions not divisible by BLOCKSIZE, and…

tensormux/kernel-skills · 0 tokens

choose-tile-size-and-work-partitioning

Guide the agent through selecting tile sizes and work partitioning strategies for a CUDA or Triton kernel, based on shared memory budget, register pressure, occupancy targets, problem shape, and access pattern.

tensormux/kernel-skills · 0 tokens

write-numerically-stable-kernel

Guide the agent through identifying numerical instability risks in a kernel's computation path and applying the correct stabilization strategy for each risk class.

tensormux/kernel-skills · 0 tokens