swapab_cutedsl_megakernel

swapab_cutedsl_megakernel is a skill for Claude Code, Codex from flashinfer-ai/flashinfer. It costs 0 tokens per session (1,615 once invoked), scanned C, original, Apache-2.0.

A maintenance guide for a specialized NVIDIA GPU kernel written with CuTeDSL, a language for describing GPU computation and memory layouts. It explains how to update vendor-provided source code while keeping local adapter code separate.

In plain words
What is it for?
Use it when updating the SM120 swap-AB MegaMoE kernel, its adapters, communication setup, launch wrappers, and reference helpers.
Why use it?
It reduces the risk of breaking a high-performance GPU kernel when the upstream kernel team publishes a new version.

Skill for Claude CodeCodex

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

Good fit Use it when updating the SM120 swap-AB MegaMoE kernel, its adapters, communication setup, launch wrappers, and reference helpers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel
About the project

FlashInfer is a library and kernel generator that supplies GPU operations used to run large language model inference, including attention, matrix multiplication, and mixture-of-experts computations. It helps engineers build and optimize LLM serving systems across supported GPU hardware and backend implementations. Its catalogue add-ons provide skills and instructions for working with FlashInfer.

flashinfer-ai/flashinfer · 6,370 stars · on GitHub · flashinfer.ai

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 flashinfer-ai/flashinfer --skill swapab_cutedsl_megakernel
Clone the repo
git clone --depth 1 https://github.com/flashinfer-ai/flashinfer

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 swapab_cutedsl_megakernel

README.md
[![agentmods](https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel/github.svg)](https://agentmods.dev/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel)
Your own site
<a href="https://agentmods.dev/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel"><img src="https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel/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 swapab_cutedsl_megakernel

Your own site · 80×15
<a href="https://agentmods.dev/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel"><img src="https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/swapab_cutedsl_megakernel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,615 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00000 $0.01615
Opus 5 $0.00000 $0.00807
Sonnet 5 $0.00000 $0.00323
Haiku 4.5 $0.00000 $0.00161

Measured 7d ago against content hash e23d3de1d1dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

swapab_cutedsl_megakernel 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 7d ago.

The scan reads SKILL.md. This mod also ships 60 executable files (__init__.py, shim/__init__.py, shim/_paths.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 -rf common src moe_sm120_mxfp8_swapab moe_mxfp8_glu moe_nvfp4_swapab
flashinfer/moe_ep/kernel_src/sm120/swapab_cutedsl_megakernel/SKILL.md · 91 lines

How it starts

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

Updating the SM120 swap-AB CuTeDSL MegaMoE kernel src

Layout

kernel_src/sm120/swapab_cutedsl_megakernel/
├── src/                    ← VERBATIM kernel-team drop; NEVER edit or add files here
│   ├── common/
│   ├── src/                ← CuTeDSL core src (bootstrap, sym_buffer, token_comm, …)
│   ├── moe_sm120_mxfp8_swapab/  ← the SM120 MXFP8 swap-AB kernel
│   ├── moe_mxfp8_glu/      ← generic MXFP8 torch reference (+ its runner helpers)
│   └── moe_nvfp4_swapab/   ← import dependency of moe_mxfp8_glu's reference
├── __init__.py             ← public API for moe_ep; talks ONLY to shim/ (our code)
├── shim/                   ← thin adapters over src/ (our code) — ALL adaptation here
│   ├── _paths.py           ← adds sibling src/ to sys.path; sibling-tree guard
│   ├── comm.py             ← dist bootstrap, sym heap, compile state,
│   │                          zero_local_counter_regions (SM120 pre-launch contract)
│   ├── mxfp8.py            ← SM120 MXFP8 frontend + symm-buffer/launch wrappers
│   └── kernel_helpers.py   ← SINGLE (all-lazy) re-export point for raw-kernel
│                              helpers/constants/reference (drop-audit point)
├── VENDOR.md               ← provenance + sync state of the current src/ drop
└── SKILL.md                ← this file (drop-update workflow)

Core principle: src/ is a verbatim copy of the kernel-team drop — no injected files, no edits. Every adaptation lives in shim/. A new drop is a pure replace of src/; the only work is updating shim/ to whatever the new src/ exposes.

Layer isolation (enforce on every drop — grep before/after): shim/ is the only layer importing src/ packages; FI backends (backends/mega/kernel/sm120/mxfp8_mxfp8_bf16_cutedsl/) import ONLY the package __init__; the tree is process-exclusive with the SM100/SM90 trees (shared top-level module names — shim/_paths.py raises on collision).

When the kernel team drops a new version of src/

  1. Replace src/ verbatim with the drop's five kernel packages:
    cd flashinfer/moe_ep/kernel_src/sm120/swapab_cutedsl_megakernel/src
    rm -rf common src moe_sm120_mxfp8_swapab moe_mxfp8_glu moe_nvfp4_swapab
    cp -r <new_drop>/{common,src,moe_sm120_mxfp8_swapab,moe_mxfp8_glu,moe_nvfp4_swapab} .
    
    Do NOT copy repo scaffolding (ci/, tester/, tests/, scripts/, pyproject.toml, dispatch_test.py, README.md, core.python.*). Update VENDOR.md (commit SHA, date, pending local diffs).

Read the full file on GitHub · 91 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 91 lines · 0 tokens per session scan C e23d3de1d1dc

Subscribe to this mod's changes

swapab_cutedsl_megakernel is a skill published in the GitHub repository flashinfer-ai/flashinfer (6,370 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,615 tokens. 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-09-03.

Related

Other skills, from other repositories

cuopt-developer

Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.

NVIDIA/cuopt · 47 tokens

transform-model

Add a Hugging Face or local checkpoint to TensorRT-Model-Connect as a self-contained family, or extend the family that already owns it.

NVIDIA/TensorRT-Model-Connect · 33 tokens

readable-cpp

Readable C/C++/Rust/CUDA code rules inspired by The Art of Readable Code. Use when writing, reviewing, or refactoring C, C++, Rust, or CUDA code. Enforces short functions, flat control flow, clear naming, readable structure, and idiomatic patterns.

crazyguitar/cppcheatsheet · 63 tokens

cpp

Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics. Use for: C/C++ questions, C/C++ interview preparation, modern language features, RAII/memory management, templates/generics, CUDA…

crazyguitar/cppcheatsheet · 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

debug-cuda-kernel-correctness

Guide the agent through a systematic process of isolating, reproducing, and diagnosing correctness errors in CUDA kernels — covering indexing bugs, layout mismatches, synchronization races, reduction errors, numerical drift, and out-of-bounds memory access.

tensormux/kernel-skills · 0 tokens