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-int8-quantized-kernelnpx skills add tensormux/kernel-skills --skill write-int8-quantized-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-int8-quantized-kernel)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/write-int8-quantized-kernel"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-int8-quantized-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.03233 |
| Opus 5 | $0.00000 | $0.01617 |
| Sonnet 5 | $0.00000 | $0.00647 |
| Haiku 4.5 | $0.00000 | $0.00323 |
Grade A, and why
write-int8-quantized-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 4d 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 — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Write an INT8 Quantized Kernel
Purpose
Guide the agent through designing and implementing an INT8 quantized matrix multiplication or linear layer kernel for inference, covering quantization scheme selection, scale computation, int32 accumulation, dequantization epilogue, and the decision between custom code and library solutions.
Use this when
- Writing an inference kernel that needs to reduce memory bandwidth and/or increase throughput by operating on INT8 weights and activations.
- Implementing a quantized linear layer where scales and zero-points are known at kernel call time (static or dynamic).
- The hardware is Turing (sm_75) or later, where the
dp4aINT8 dot product instruction is available. - Evaluating whether a custom INT8 GEMM is justified versus using cuBLAS INT8 (
cublasGemmExwithCUDA_R_8I) or CUTLASS INT8 GEMM templates.
Do not use this when
- The target hardware is pre-Turing (sm_70 or earlier) — there is no hardware INT8 dot product instruction and the implementation falls back to emulation, which is unlikely to outperform fp16.
- The workload is training (not inference) — INT8 gradients require careful handling that is a separate design problem.
- The accuracy budget cannot tolerate INT8 quantization error. Evaluate accuracy first before committing to INT8.
- cuBLAS
cublasGemmExwithCUDA_R_8Iinputs andCUDA_R_32Icompute already satisfies the performance requirement. Use the library unless there is a specific reason (custom epilogue, non-standard quantization scheme, latency constraints) that the library does not meet.
Inputs the agent should gather first
- Quantization granularity: per-tensor (one scale for the entire tensor), per-channel (one scale per output channel of the weight), or per-token (one scale per token/row of the activation). This determines the dequantization operation.
- Symmetric vs asymmetric quantization: symmetric maps the range
[-127, 127]to[-max_abs, max_abs]with zero-point = 0. Asymmetric maps[0, 255](or[-128, 127]) to an arbitrary range with a non-zero zero-point. Symmetric is strongly preferred for inference because zero-point handling adds extra arithmetic to the hot loop. - Accumulation dtype: INT32 is mandatory. INT8 accumulation overflows for any practical dot product length.
- Output dtype: FP32 or FP16 after dequantization. This determines the epilogue.
- Scale dtype and location: are scales stored as fp32 scalars, fp32 tensors, or fp16? Are they computed offline (static quantization) or at kernel launch time (dynamic quantization)?
- Hardware target: compute capability (sm_75 for Turing dp4a, sm_80 for Ampere, sm_89 for Ada).
- Weight layout: are weights already quantized and stored as INT8? Are they in row-major or column-major order?
- Activation layout: contiguous rows? Are activations quantized offline or online (at each forward pass)?
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.
- 4d ago First seen · 117 lines · 0 tokens per session scan A 28c2e0192369
write-int8-quantized-kernel is a skill published in the GitHub repository tensormux/kernel-skills (72 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,233 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.
llm-torch-profiler-analysis
Unified LLM torch-profiler triage skill for sglang, vllm, TensorRT-LLM, and TokenSpeed. Use it to inspect an existing trace.json(.gz) or profile directory, or to drive live profiling against a running server when supported and return one three-table report with kernel, overlap-opportunity, and fuse-pattern tables.
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…
sglang-diffusion-benchmark-profile
Use when benchmarking denoise latency or profiling a diffusion bottleneck in SGLang.
experimental-design
Best practices for designing reproducible ML experiments. Use when planning ablations, baselines, or controlled experiments.
mixed-precision
Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.