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/tensormux/kernel-skills/write-cuda-gemm-kernelnpx skills add tensormux/kernel-skills --skill write-cuda-gemm-kernelgit clone --depth 1 https://github.com/tensormux/kernel-skillsWrote 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/tensormux/kernel-skills/write-cuda-gemm-kernel)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/write-cuda-gemm-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-cuda-gemm-kernel.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00000 | $0.03543 |
| Opus 5 | $0.00000 | $0.01772 |
| Sonnet 5 | $0.00000 | $0.00709 |
| Haiku 4.5 | $0.00000 | $0.00354 |
Grade A, and why
write-cuda-gemm-kernel 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 5d 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 — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Write CUDA GEMM Kernel
Purpose
Guide the agent through designing and implementing a correct, performance-aware CUDA GEMM kernel (C = alpha * A * B + beta * C) for a specific problem configuration, including decisions about tiling strategy, memory hierarchy usage, tensor core eligibility, and when to defer to cuBLAS or CUTLASS instead.
Use this when
- You need a custom GEMM or GEMM-like operation that cuBLAS does not support (fused epilogue, custom accumulation, non-standard layouts, sparse masks)
- You are implementing a batched GEMM variant with irregular batch structure
- You need to fuse the GEMM with a downstream operation (bias add, activation, quantization) and cannot tolerate the memory round-trip of a separate kernel
- You are on a constrained embedded or inference target where you control the tiling strategy precisely
- You are building a learning or research kernel and need explicit control over every memory access
Do not use this when
- Standard sgemm/hgemm/dgemm without custom epilogue: use cuBLAS (
cublasGemmEx) — it will outperform any first-attempt custom kernel on all shipping hardware - GEMM with tensor core acceleration and standard epilogues: use CUTLASS — it exposes MMA-level tiling with a composable epilogue framework that is already highly tuned
- Batch GEMM with fixed batch sizes and standard shapes: use
cublasGemmStridedBatchedEx - FP8 GEMM on Hopper: use
cublasLtMatmulwith FP8 descriptors or CUTLASS 3.x FP8 kernels - The problem is memory-bound rather than compute-bound (small K relative to M and N): tiling will not help, and a simpler kernel may be better
Inputs the agent should gather first
- M, N, K: exact or typical sizes; whether they are statically known or runtime-dynamic
- dtypes: A dtype, B dtype, accumulator dtype, output C dtype (e.g., A=fp16, B=fp16, acc=fp32, C=fp16)
- Layout of A and B: row-major or column-major; leading dimension stride if non-standard
- Transpose flags: transA, transB (determines which dimension is the inner product dimension)
- Hardware target: SM architecture (SM70/Volta, SM75/Turing, SM80/Ampere, SM89/Ada, SM90/Hopper) — determines warp MMA availability, shared memory capacity, async copy support
- Precision requirements: is fp32 accumulation required for fp16 inputs, or is fp16 accumulation acceptable
- Epilogue requirements: is there an alpha/beta scaling, bias addition, activation function, quantization step, or other per-element operation to fuse
- Batch dimension: is this a single GEMM or batched; are batch strides uniform
- Tensor core eligibility: does the problem shape and dtype satisfy alignment requirements (K divisible by 8 for fp16 wmma, 16 for MMA with specific fragment sizes)
What ships with it
1 file 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.
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.
- 5d ago First seen · 122 lines · 0 tokens per session scan A b812844ae7f3
write-cuda-gemm-kernel is a skill published in the GitHub repository tensormux/kernel-skills (73 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,543 tokens. 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.
Other skills, from other repositories
add-sgl-kernel
Step-by-step tutorial for adding a heavyweight AOT CUDA/C++ kernel to sgl-kernel (including tests & benchmarks).
add-cuda-kernel
Step-by-step tutorial for adding new CUDA kernels to FlashInfer.
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.
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.
cutedsl_megamoe
Skill "cutedsl_megamoe" from flashinfer-ai/flashinfer, covering updating the cutedsl megamoe kernel src, layout, when the kernel team drops a new version of src/ and what not to update here.
swapab_cutedsl_megakernel
Skill "swapab_cutedsl_megakernel" from flashinfer-ai/flashinfer, covering updating the sm120 swap-ab cutedsl megamoe kernel src, layout, when the kernel team drops a new version of src/ and what not to update here.