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-softmax-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-softmax-kernel)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/write-triton-softmax-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-triton-softmax-kernel/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/tensormux/kernel-skills/write-triton-softmax-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-triton-softmax-kernel.svg" alt="Reviewed on agentmods" width="80" 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.02951 |
| Opus 5.5 | $0.00000 | $0.01180 |
| Sonnet 5.5 | $0.00000 | $0.00590 |
| Haiku 4.5 | $0.00000 | $0.00295 |
Grade A, and why
write-triton-softmax-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 3mo 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 — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Write a Triton Softmax Kernel
Purpose
Guide the agent through implementing a numerically stable, performant row-wise softmax kernel in Triton. This covers single-program-per-row assignment, online max+sum reduction with tl.max/tl.sum, masking for rows wider than BLOCK_SIZE, fp32 accumulation to avoid overflow and precision loss, and the masked softmax variant for attention.
Use this when
- You need a fused softmax that avoids a separate max-reduction kernel pass and a separate division pass — i.e., you want a single kernel that reads each row once.
- You need a masked softmax (attention mask applied before the exp) and PyTorch's built-in path is not fusing the mask application correctly.
- You are fusing softmax with a preceding or following elementwise operation (e.g., scale by
1/sqrt(d_k)before softmax, or multiply output by values V immediately after). - The row dimension is large enough that a per-row kernel is worthwhile (row_size >= 256 is a reasonable floor). Below this,
torch.nn.functional.softmaxis likely faster.
Do not use this when
- The input is a standard 2D or 3D tensor with no mask and no fusion requirement.
torch.nn.functional.softmaxbacked by cuDNN ortorch.compilewill handle this efficiently. - The softmax dimension is across rows rather than within rows (i.e., column-wise softmax). The per-row strategy does not apply without transposing the problem.
- The row size is very small (< 64). A warp-level reduction in CUDA or a fused
torch.compilegraph is more efficient. - You need a stable online-softmax for arbitrarily long sequences in a streaming fashion — this requires a more complex multi-block reduction strategy beyond a single-program-per-row approach.
Inputs the agent should gather first
Before writing any code, confirm:
- Input shape — (N, D) or (B, H, N, D) or similar. Which dimension is the softmax applied over?
- Row dimension size D — is it fixed (compile-time constant), or dynamic? Is it always a power of 2?
- Input dtype — fp16, bf16, or fp32. Accumulation dtype must be fp32 regardless.
- Whether a mask is applied — additive mask (large negative values added before softmax) or boolean mask (invalid positions should be treated as -inf)?
- Whether to fuse a downstream operation — e.g., multiply by a V matrix tile, apply dropout, or write to a specific output layout.
- Whether the row fits in one BLOCK_SIZE — or whether a loop over multiple blocks per row is needed.
- Hardware target — relevant for choosing BLOCK_SIZE and deciding whether to use
triton.autotune.
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.
- 3mo ago First seen · 153 lines · 0 tokens per session scan A 90b122156965
write-triton-softmax-kernel is a skill published in the GitHub repository tensormux/kernel-skills (93 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,951 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.
write-triton-softmax-kernel compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| write-triton-softmax-kerneltensormux/kernel-skills | Skill | 93 | 5mo ago | MIT | A | 0 | Claude Code, Codex |
| cutedsl_megamoeflashinfer-ai/flashinfer | Skill | 7.0k | today | Apache-2.0 | A | 0 | Claude Code, Codex |
| claude-apihashgraph-online/awesome-codex-plugins | Skill | 1.6k | 2d ago | Apache-2.0 | A | 53 | Claude Code, Codex |
| ai-ml-developmenttravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 43 | Claude Code |
| ring:adopting-lib-commons-huma-wrapperLerianStudio/ring | Skill | 218 | 29d ago | Apache-2.0 | A | 142 | Cursor |
| deep-learning-pythonMindrally/skills | Skill | 322 | 1mo ago | Apache-2.0 | A | 30 | Claude Code |
| pytorchMindrally/skills | Skill | 322 | 1mo ago | Apache-2.0 | A | 18 | Claude Code |