cache-dit: Skill for Claude Code

.agents/skills/cache-dit-quantization/SKILL.md

cache-dit-quantization is a skill for Claude Code from vipshop/cache-dit. It costs 106 tokens per session (4,781 once invoked), scanned A, original, Apache-2.0.

A guide for choosing, configuring, extending, and debugging quantization in Cache-DiT. Quantization stores model numbers with fewer bits, which can reduce memory use but may affect accuracy.

In plain words
What is it for?
It helps quantize models, tune layer precision and exclusions, run calibration-based or calibration-free workflows, inspect accuracy, and add or debug quantization backends.
Why use it?
It helps developers choose between supported quantization methods and locate the right configuration, calibration, fallback, and backend code instead of changing unrelated parts.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is vipshop/cache-dit's own configuration. It tells Claude Code how to work on cache-dit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cache-dit configures →

About the project

Cache-DiT is a PyTorch inference engine for DiT models, with caching, parallel processing, quantization, and CPU offloading. It is for running diffusion-model pipelines with support for systems and hardware such as Diffusers, SGLang Diffusion, vLLM-Omni, ComfyUI, NVIDIA GPUs, Ascend NPUs, and AMD GPUs.

vipshop/cache-dit · 1,300 stars · on GitHub · cache-dit.readthedocs.io

Reuse

Borrowing it

Nothing to install: this file belongs to vipshop/cache-dit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vipshop/cache-dit/main/.agents/skills/cache-dit-quantization/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vipshop/cache-dit

Made for: Claude Code.

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 cache-dit-quantization

README.md
[![agentmods](https://agentmods.dev/badge/skills/vipshop/cache-dit/cache-dit-quantization/github.svg)](https://agentmods.dev/skills/vipshop/cache-dit/cache-dit-quantization)
Your own site
<a href="https://agentmods.dev/skills/vipshop/cache-dit/cache-dit-quantization"><img src="https://agentmods.dev/badge/skills/vipshop/cache-dit/cache-dit-quantization/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 cache-dit-quantization

Your own site · 80×15
<a href="https://agentmods.dev/skills/vipshop/cache-dit/cache-dit-quantization"><img src="https://agentmods.dev/badge/skills/vipshop/cache-dit/cache-dit-quantization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,781 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.00106 $0.04781
Opus 5.5 $0.00042 $0.01912
Sonnet 5.5 $0.00021 $0.00956
Haiku 4.5 $0.00011 $0.00478

Measured today against content hash de9db434da66, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cache-dit-quantization 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 today.

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.

.agents/skills/cache-dit-quantization/SKILL.md · 221 lines

How it starts

The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cache-DiT 量化与后端接入

0. 任务路由

任务 判断依据 读哪里
选一种量化 / 跑通量化 只是调用 enable_cache / quantize §2、§3;用户文档以 docs/user_guide/QUANTIZATION.md 为唯一权威
调精度与显存 要动 regional / exclude / precision plan / fallback / observer §4–§6
接入新量化后端或新 PTQ 工作流 要新增 src/cache_dit/quantization/<backend>/ 或改共享 config/dispatch §7–§11
改 SVDQ 算子或 GEMM 本身 动 csrc/kernels/svdq/ 走 cache-dit-custom-kernel,本 skill 只管工作流与配置

代码、文档、CLI 三处描述同一个量化能力时,先改 docs/user_guide/QUANTIZATION.md,再同步本 skill;本 skill 只做索引与判据,不复制整段用户文档。

1. 代码地图

位置 职责
src/cache_dit/quantization/config.py QuantizeConfig 全部字段 + svdq_kwargs 的集中校验(_resolve_svdq_*)、DEFAULT_EXCLUDE_LAYERS
src/cache_dit/quantization/backend.py QuantizeBackend 枚举(AUTO/TORCHAO/CACHE_DIT/NONE)与字符串别名解析
src/cache_dit/quantization/dispatch.py 公共 quantize() / load() / remove_quantization_stats(),按 backend 分派
src/cache_dit/quantization/torchao/ TorchAO online 路径:quantize_ao.py(quant_type → AO config、过滤与 fallback)、_scaled_mm.py
src/cache_dit/quantization/svdquant/ SVDQuant:ptq.py(校准 + 序列化 + load)、quantizer.py(DQ/PTQ 量化数学)、linear.py/fused.py(运行模块)、packing.py/lowrank.py/passes.py/dtensor.py
src/cache_dit/quantization/observers.py 逐层精度观察器(默认关闭)
src/cache_dit/quantization/converter.py 独立转换 CLI(cache-dit-convert,只支持 SVDQ _dq)
src/cache_dit/_utils/utils.py CLI 参数与 maybe_quantize_transformer(--quantize-* → QuantizeConfig)
docs/user_guide/QUANTIZATION.md 用户文档:类型总表、各路径示例、observer 与 converter
tests/quantization/ 配置、observer、torchao、SVDQ(ptq/dq/quantizer/compile/padding/imports/offload)测试

2. 支持面(quant_type)

两条互不相干的路径,不要混用:

  • TorchAO online quantization(quant_type 直接是 torchao 类型):float8_per_row(推荐)、float8_per_tensor、float8_per_block、float8_weight_only、int8_per_row、int8_per_tensor、int8_weight_only、int4_weight_only、nvfp4、nvfp4_weight_only。
  • SVDQuant W4A4(quant_type 形如 svdq_{int4,nvfp4}_r{rank}[_dq]):有 _dq 后缀是 DQ(无校准),无后缀是 PTQ(需要校准 + 可序列化)。

Read the full file on GitHub · 221 lines

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. today First seen · 221 lines · 106 tokens per session scan A de9db434da66

Subscribe to this mod's changes

cache-dit-quantization is a skill published in the GitHub repository vipshop/cache-dit (1,300 stars, last pushed today), licensed Apache-2.0. It adds 106 tokens to every session and 4,781 once invoked, about $0.0004 per session on Opus 5.5. 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-11-06.

Related

cache-dit-quantization compared with skills from other repositories

cache-dit-quantization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cache-dit-quantizationvipshop/cache-ditSkill1.3ktodayApache-2.0A106Claude Code
agent-platform-model-registrygoogle/skillsSkill22kyesterdayApache-2.0A60Claude Code, Codex
foundry-config-setupmicrosoft/agent-frameworkSkill15kyesterdayMITA65Claude Code, Codex
google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skillsSkill22kyesterdayApache-2.0A132Claude Code, Codex
training-checkwanshuiyin/Auto-claude-code-research-in-sleepSkill19k3d agoMITA35Claude Code
nemo-automodel-launcher-configNVIDIA/skillsSkill3.9kyesterdayApache-2.0A30Claude Code
finetuningmicrosoft/skillsSkill3.2kyesterdayMITA132Claude Code