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 skills add tensormux/kernel-skills --skill write-triton-layernorm-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-triton-layernorm-kernel)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/write-triton-layernorm-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-triton-layernorm-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.1 | $0.00000 | $0.03009 |
| Opus 5 | $0.00000 | $0.01504 |
| Sonnet 5 | $0.00000 | $0.00602 |
| Haiku 4.5 | $0.00000 | $0.00301 |
Grade A, and why
write-triton-layernorm-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 8d 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 — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Write a Triton LayerNorm Kernel
Purpose
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 BLOCK_SIZE, and pointer arithmetic for 1D affine parameters applied to 2D or higher-rank inputs.
Use this when
- You need a fused forward LayerNorm that avoids separate mean, variance, normalize, and scale passes — i.e., a single kernel reading each row once (or twice for a two-pass approach).
- You need an RMSNorm variant (no mean subtraction, only RMS scaling) that is not available in your framework's kernel library.
- You need a custom LayerNorm that fuses a downstream or upstream operation (e.g., fusing the residual add into the LayerNorm input).
- You require the backward pass and intend to write a custom autograd function — knowing how the forward is structured is a prerequisite.
torch.nn.LayerNormwithtorch.compileis not achieving the expected fusion or is producing numerical issues you need to diagnose.
Do not use this when
- The normalized shape maps to a standard
torch.nn.LayerNormcall and no fusion is needed.torch.compilewill fuse the LayerNorm efficiently. - The hidden dimension is very small (< 64). Warp-level reductions in CUDA (via vendor libraries) are more efficient at this size.
- You need training with a custom backward pass for a non-standard normalization variant. Prefer implementing the full custom kernel with saved statistics before committing to a Triton forward-only version.
- The normalization is over a non-contiguous dimension. This skill covers row-wise normalization (last dimension). Normalizing over other axes requires a different decomposition.
Inputs the agent should gather first
Before writing any code, confirm:
- Input shape — (N, H) for 2D, or (B, T, H) for sequence inputs. Which dimension is normalized? (Assume last dimension H unless stated otherwise.)
- Hidden dimension H — fixed or dynamic? Is H a power of 2? Is H always divisible by BLOCK_SIZE?
- Input dtype — fp16, bf16, or fp32. Accumulation for mean and variance must be fp32.
- Affine transform — does the kernel apply learned gamma and beta parameters? Are they 1D tensors of shape (H,)?
- RMSNorm vs LayerNorm — LayerNorm subtracts mean and divides by std; RMSNorm skips mean subtraction and uses RMS of activations.
- Epsilon value — typically 1e-5 or 1e-6. Confirm whether it is added inside or outside the square root (both are used in practice — they differ numerically).
- Forward-only or training — if training, the mean and inverse-std (rstd) must be saved for the backward pass.
- Residual fusion — is there a residual to add before normalization (pre-norm pattern)?
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.
- 8d ago First seen · 160 lines · 0 tokens per session scan A 2444ec23f016
write-triton-layernorm-kernel is a skill published in the GitHub repository tensormux/kernel-skills (74 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,009 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
fba-simulator
Run Flux Balance Analysis (FBA) and related constraint-based simulations using COBRApy. Covers standard FBA, parsimonious FBA (pFBA), Flux Variability Analysis (FVA), loopless FBA, gene/reaction knockouts, and carbon source swapping. Outputs flux distributions and CSV files.
flux-analyzer
Analyse FBA flux distributions to extract biological insights. Covers gene essentiality, phenotypic phase planes, flux sampling, pathway-level aggregation, secretion product prediction, and production of publication- quality figures.
gsmm-validator
Validate a COBRApy genome-scale metabolic model for mass/charge balance, stoichiometric consistency, biomass producibility, dead-end metabolites, thermodynamic loops, and GPR rule formatting. Outputs a structured validation report with errors and warnings.
gsmm-builder
Build or load a genome-scale metabolic model (GSMM) using COBRApy. Covers loading from BIGG, constructing minimal models from scratch, setting medium constraints, and exporting validated .json model files.
stat-result-validator
Validate statistical research outputs for formulation quality, method-to- problem alignment, theory presence, experimental evidence, fair comparison, artifact completeness, and final-claim consistency.
statistical-problem-formulation
Formulate statistical research problems with formal notation, target parameters, assumptions, hypotheses, evaluation criteria, and theory targets.