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-triton-dequant-kernelnpx skills add tensormux/kernel-skills --skill write-triton-dequant-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-dequant-kernel)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/write-triton-dequant-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-triton-dequant-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.03947 |
| Opus 5 | $0.00000 | $0.01973 |
| Sonnet 5 | $0.00000 | $0.00789 |
| Haiku 4.5 | $0.00000 | $0.00395 |
Grade A, and why
write-triton-dequant-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 6d 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 — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Write a Triton Dequant Kernel (int4 / int8 → fp16 / bf16)
Purpose
Guide the agent through implementing a Triton kernel that unpacks and dequantizes a quantized weight tensor (int4 or int8) into fp16 or bf16. This is the standalone building block underneath W4A16 / W8A16 schemes (AWQ, GPTQ, SqueezeLLM, bitsandbytes NF4, int8 per-channel). Covers bit-unpacking, per-group scale/zero arithmetic, NF4 codebook lookup, and — critically — when not to write a standalone dequant kernel because the operation should be fused into the matmul instead.
Use this when
- You need to materialize a fp16/bf16 weight tile from a packed int4/int8 representation for a consumer that does not have a fused-dequant matmul (custom op, MoE expert hot-swap, LoRA merge into a quantized base).
- You need a baseline reference to validate a fused dequant-GEMM (Marlin, AWQ-fused-GEMM, ExLlama, GPTQ kernels) by comparing intermediate fp16 weights.
- You are debugging a quantized model's accuracy and need to inspect the dequantized weights for a specific scheme (AWQ packing order, GPTQ act-order permutation).
- You are implementing a one-off or research scheme and a fused kernel does not yet exist.
- You must dequantize on the fly because the quantized weight is being modified at runtime (online calibration, dynamic LoRA composition).
Do not use this when
- You are running a standard W4A16 or W8A16 linear layer in production. Standalone dequant materializes the full fp16 weight to HBM and reads it back for the GEMM, doubling weight memory traffic and defeating most of the benefit of weight quantization. Use a fused dequant-GEMM instead (Marlin / AWQ kernels / GPTQ kernels / ExLlama /
torch.ops.aten._weight_int4pack_mm). - The downstream GEMM is bandwidth-bound on the weight (typical for batch size 1–32 LLM decode). A fused kernel is strictly better — standalone dequant turns one HBM read of int4 into one read of int4 + one write of fp16 + one read of fp16.
- You only need activation dequantization. This skill is about weight dequant; activation dequant lives in the GEMM epilogue.
- The scheme is symmetric int8 per-tensor and the framework already has
torch.dequantizeor equivalent. - You want to "speed up" inference by replacing a fused GEMM with standalone dequant + cuBLAS fp16 GEMM. Almost always slower.
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.
- 6d ago First seen · 161 lines · 0 tokens per session scan A 7959ea13d35e
write-triton-dequant-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,947 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
prompt-engineering
Prompt engineering techniques and patterns. Use when writing agent commands, hooks, skills, subagent prompts, or any LLM interaction: optimizing prompts, improving output reliability, and designing production-grade prompt templates. Trigger words: prompt engineering, prompt, prompt optimization, LLM interaction.
compute-mamba-ratio
Compute the optimal --mamba-full-memory-ratio (or --max-mamba-cache-size pin) for a hybrid attention + linear-attention (Mamba / GDN / KDA) model's two serving memory pools, from the workload and serving config. Use when a user asks what ratio to set, why concurrency is clamped, or how to size the state vs KV pools…
stripe-directory
Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill for ANY request…
pgvector-semantic-search
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…
postgres-hybrid-text-search
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…
nlp-alignment
Best practices for LLM alignment techniques including RLHF, DPO, and instruction tuning. Use when working on alignment or safety.