write-int8-quantized-kernel

write-int8-quantized-kernel is a skill for Claude Code, Codex from tensormux/kernel-skills. It costs 0 tokens per session (3,233 once invoked), scanned A, original, MIT.

A coding guide for implementing INT8 quantized matrix multiplication or linear-layer kernels for inference, where calculations use smaller integer values.

In plain words
What is it for?
It is for reducing memory use or improving inference speed on suitable Turing-or-newer GPUs, not for training workloads.
Why use it?
It helps choose quantization details, handle scaling and conversion correctly, and decide whether custom code is worthwhile compared with established libraries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for reducing memory use or improving inference speed on suitable Turing-or-newer GPUs, not for training workloads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tensormux/kernel-skills/write-int8-quantized-kernel
Install

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.

Any agent
npx skills add tensormux/kernel-skills --skill write-int8-quantized-kernel
Clone the repo
git clone --depth 1 https://github.com/tensormux/kernel-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for write-int8-quantized-kernel

README.md
[![agentmods](https://agentmods.dev/badge/skills/tensormux/kernel-skills/write-int8-quantized-kernel/github.svg)](https://agentmods.dev/skills/tensormux/kernel-skills/write-int8-quantized-kernel)
Your own site
<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/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.

agentmods 80×15 button for write-int8-quantized-kernel

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,233 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03233
Opus 5.5 $0.00000 $0.01293
Sonnet 5.5 $0.00000 $0.00647
Haiku 4.5 $0.00000 $0.00323

Measured 3mo ago against content hash 28c2e0192369, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 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.

skills/quantization/write-int8-quantized-kernel/SKILL.md · 117 lines

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 dp4a INT8 dot product instruction is available.
  • Evaluating whether a custom INT8 GEMM is justified versus using cuBLAS INT8 (cublasGemmEx with CUDA_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 cublasGemmEx with CUDA_R_8I inputs and CUDA_R_32I compute 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)?

Read the full file on GitHub · 117 lines

Files

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.

Changes

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.

  1. 3mo ago First seen · 117 lines · 0 tokens per session scan A 28c2e0192369

Subscribe to this mod's changes

write-int8-quantized-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 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.

Related

write-int8-quantized-kernel compared with skills from other repositories

write-int8-quantized-kernel next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
write-int8-quantized-kerneltensormux/kernel-skillsSkill935mo agoMITA0Claude Code, Codex
prompt-engineeringMagicKidd/Rokid-agentic-workflowSkill35mo agononeA0Claude Code, Codex
sglang-diffusion-cache-ditsgl-project/sglangSkill39ktodayApache-2.0A161Claude Code
recon-ai-enrichmentsamugit83/redamonSkill3.5ktodayMITA188Claude Code, Codex
pgvector-semantic-searchtimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A190Cursor
postgres-hybrid-text-searchtimescale/pg-aiguideSkill1.9kyesterdayApache-2.0A162Cursor
huawei-cloud-maas-setupXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A133Claude Code