Borrowing it
Nothing to install: this file belongs to RightNow-AI/AutoMegaKernel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/RightNow-AI/AutoMegaKernel/main/.claude/skills/megakernel-optimization/SKILL.mdgit clone --depth 1 https://github.com/RightNow-AI/AutoMegaKernelWrote 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.
[](https://agentmods.dev/skills/rightnow-ai/automegakernel/megakernel-optimization)<a href="https://agentmods.dev/skills/rightnow-ai/automegakernel/megakernel-optimization"><img src="https://agentmods.dev/badge/skills/rightnow-ai/automegakernel/megakernel-optimization/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.
<a href="https://agentmods.dev/skills/rightnow-ai/automegakernel/megakernel-optimization"><img src="https://agentmods.dev/badge/skills/rightnow-ai/automegakernel/megakernel-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.02026 |
| Opus 5.5 | $0.00023 | $0.00810 |
| Sonnet 5.5 | $0.00011 | $0.00405 |
| Haiku 4.5 | $0.00006 | $0.00203 |
Grade A, and why
megakernel-optimization scanned grade A with 0 findings 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 2mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AutoMegaKernel (AMK), megakernel schedule optimization
AMK compiles a HuggingFace Llama-family model into ONE persistent CUDA megakernel and tunes it
with an AutoKernel-style loop: read the edit surface -> propose ONE knob change -> eval ->
keep/revert -> record -> repeat. This skill drives Loop 2 (schedule + kernel_knobs search).
You never write kernel code; you only edit a structured ScheduleConfig (plus its reserved
kernel_knobs sub-object). The frozen VM lowers your config deterministically and the CPU
ReferenceVM judges correctness vs eager PyTorch.
HARD HONESTY RULES (state and obey these every time)
- Correctness FIRST. A latency is NEVER reported without a correctness PASS vs the CPU ReferenceVM. Keep a candidate only if it is correct AND >= 1% faster than the incumbent.
- validate-before-launch. An unsafe
ScheduleConfigis a clean REJECTED (a deadlock/race-free proof rejects it before launch), never a hung GPU. - The edit surface is
ScheduleConfig+kernel_knobsONLY, never raw kernel code, nevervm/, never the frozen ABI. - Measured-gpu latency is drift-robust; physically-impossible sub-roofline latencies are withheld as artifacts.
- All speedups are vs AMK's OWN baseline (default schedule), NOT a claim of beating cuBLAS/vLLM. AMK is currently within ~13% of cuBLAS at batch-1, behind it.
The edit surface (read it before proposing)
Read the surface programmatically, never guess knob names. Prefer the canonical MCP tool; fall back to the CLI if MCP is unavailable.
- MCP:
amk_propose(model, gpu="rtx5090")->{ schedule_config, schedule_id, search_space, ... }.search_spaceincludes thekernel_knobs.*sub-surface. - CLI:
amk propose <model> --gpu <arch>(oruv run python amk_cli.py propose <model> --gpu <arch>) prints the same surface as JSON on stdout.
The ScheduleConfig knobs (edit ONE per trial): tiling.gemv.N_tile,
tiling.attention.kv_block, fusion_grouping, sm_assignment, pipelining_depth,
page_allocation, threads_per_block, smem_bytes_per_block. The reserved kernel_knobs
object holds GEMV build knobs: cols_per_warp, cpasync, cpa_stages, cpa_cols (these move
MEASURED latency under device=cuda; the predicted/CPU path does not model them). A config
WITHOUT kernel_knobs is byte-identical to the production incumbent.
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.
- 2mo ago First seen · 124 lines · 57 tokens per session scan A 88f899547ee6
megakernel-optimization is a skill published in the GitHub repository RightNow-AI/AutoMegaKernel (161 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 2,026 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
megakernel-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| megakernel-optimizationRightNow-AI/AutoMegaKernel | Skill | 161 | 1mo ago | MIT | A | 57 | Claude Code |
| cutedsl_megamoeflashinfer-ai/flashinfer | Skill | 6.9k | today | Apache-2.0 | C | 0 | Claude Code, Codex |
| swapab_cutedsl_megakernelflashinfer-ai/flashinfer | Skill | 6.9k | today | Apache-2.0 | C | 0 | Claude Code, Codex |
| next_cutedsl_megamoeflashinfer-ai/flashinfer | Skill | 6.9k | today | Apache-2.0 | A | 0 | Claude Code, Codex |
| cuopt-developerNVIDIA/cuopt | Skill | 1.1k | yesterday | Apache-2.0 | B | 47 | Cursor |
| ax-cpp-aiax-llm/ax | Skill | 3.0k | 3d ago | Apache-2.0 | A | 47 | Claude Code, Codex |
| ax-cpp-genax-llm/ax | Skill | 3.0k | 3d ago | Apache-2.0 | A | 48 | Claude Code, Codex |