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.
npx agentmods add skills/amd-agi/apex/aiter-reflectionnpx skills add AMD-AGI/Apex --skill aiter-reflectiongit clone --depth 1 https://github.com/AMD-AGI/ApexWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00046 | $0.00766 |
| Opus 5 | $0.00023 | $0.00383 |
| Sonnet 5 | $0.00009 | $0.00153 |
| Haiku 4.5 | $0.00005 | $0.00077 |
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 2d 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` 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-smiorps aux | grep pythonto identify GPU tasks - Stop any unrelated GPU workloads
- Use
- Clear JIT compilation cache to ensure clean state
- Run the benchmark script using the
.venvPython environment - Save results under logs/ folder with timestamp
4) Iterate on kernel optimization (one iteration)
- Read the kernel source, identify bottlenecks, and call
rocprof-computeat least once to deepen bottleneck analysis. - Use
kernel-exp-historyto 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-reinstallrm -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
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.
- 2d ago First seen · 73 lines · 46 tokens per session scan C e71dfa936c10
aiter-reflection is a skill published in the GitHub repository AMD-AGI/Apex (76 stars, last pushed 5d ago), licensed MIT. It adds 46 tokens to every session and 766 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
write-triton-kv-cache-append-kernel
Guide the agent through implementing a Triton kernel that writes newly computed K and V tensors into a pre-allocated KV cache during LLM inference. This covers two cache layouts (contiguous and paged / vLLM-style PagedAttention), unified prefill and decode handling via a slotmapping tensor, GQA/MQA where the cache…
write-triton-rope-kernel
Guide the agent through implementing a correct Triton kernel that applies Rotary Position Embeddings (RoPE) to query and key tensors before attention. This covers the two incompatible layout conventions (GPT-NeoX/HuggingFace-LLaMA vs GPT-J/original-paper), pre-computed cos/sin table consumption, per-token position…
choose-launch-configuration
Guide the agent through selecting the correct and efficient thread block dimensions and grid dimensions for a CUDA kernel, covering occupancy analysis, register and shared memory constraints, tail effects, persistent kernels, and when to use cudaOccupancyMaxActiveBlocksPerMultiprocessor as a decision tool.
optimize-shared-memory-tiling
Guide the agent through designing and tuning shared memory tiling strategies for CUDA kernels, covering bank conflict analysis and elimination, tile shape selection, double buffering with async copy, occupancy tradeoffs from shared memory allocation, and the decision of when smem tiling is worth the complexity.
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.
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.