cache-dit: Skill for Claude Code

.agents/skills/cache-dit-custom-kernel/SKILL.md

cache-dit-custom-kernel is a skill for Claude Code from vipshop/cache-dit. It costs 136 tokens per session (3,976 once invoked), scanned A, original, Apache-2.0.

A development workflow for custom CUDA operators in Cache-DiT. CUDA is NVIDIA's platform for running code on GPUs; the workflow covers the path from GPU code through Python bindings and the machine-learning library interface.

In plain words
What is it for?
Use it for CUDA/C++ kernel changes, operator migration, builds, profiling, dispatch updates, quantization-related work, and performance optimization in Cache-DiT.
Why use it?
It gives developers a defined route for adding, porting, reviewing, building, testing, and optimizing low-level GPU operators without losing track of the layers they must connect.

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 →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash tools/build_fast.sh install -e . --no-build-isolation --no-deps.

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-custom-kernel/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-custom-kernel

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/vipshop/cache-dit/cache-dit-custom-kernel"><img src="https://agentmods.dev/badge/skills/vipshop/cache-dit/cache-dit-custom-kernel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,976 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.00136 $0.03976
Opus 5.5 $0.00054 $0.01590
Sonnet 5.5 $0.00027 $0.00795
Haiku 4.5 $0.00014 $0.00398

Measured today against content hash 5af9d548ad38, 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-custom-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 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-custom-kernel/SKILL.md · 179 lines

How it starts

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

Cache-DiT 自定义算子开发与优化

使用范围与路由

本 skill 处理 csrc/kernels/ 下所有算子族(现有 comm、attn、svdq,目前全部是 CUDA/CuTe C++ kernel)的接入、移植、构建、profile 与优化。读完本节再动手:

任务 判据 读哪里
接入新算子 / 新算子族 要新建 csrc/kernels/<族>/ 下的文件,或要动 setup.py 的源清单/扩展/schema 注册 references/kernel-integration-chain.md
从上游仓库移植算子 有 nunchaku / deepcompressor / flashinfer 参照实现 references/operator-migration.md
改现有算子实现 只改 .cu/.cuh/.h,schema、setup.py、Python 包装都不动 本文 §5 + 该族 Python 模块 + 对应测试
性能优化 数值契约与链路不变 本文 §6;SVDQ 另读下列三份 ref
SVDQuant 原理 推导、误差上界、scale 粒度、低秩残差 references/svdquant-mathematics.md

SVDQ 专项参考,修改 NVFP4 CuTe 路径前先读:

  • references/svdq-nvfp4-cute.md:当前实现、有效/无效尝试和实测性能。
  • references/rfc-cuda-optimizations.md:优化门槛、待办、状态更新规则。
  • references/svdq-nvfp4-cute-tma-sync-analysis.md:TMA/mbarrier、warp/block 同步、K-block 软件流水及 CUTLASS/FlashInfer SM120 对照;做 SVDQ CuTe GEMM 调度与性能优化前先读。

原理路由:先读 references/svdquant-mathematics.md 的 §1–4 建立记号并复核推导与成立条件,需要落到当前实现时读 §5,评估 TurboQuant / DVD-Quant 是否可借鉴时读 §6–8;性能结论与数值契约仍以 references/svdq-nvfp4-cute.md 为准。

配合 cuda-auto-tune(NCU 驱动迭代优化)、cuda-cpp-kernel(CUDA/PTX/架构细节)、cutlass-cpp-kernel(CUTLASS/CuTe C++ 模板)、cute-dsl-kernel(CuTe DSL Python kernel 编写)使用。本仓目前没有 CuTe DSL 算子;将来引入时,kernel 编写走 cute-dsl-kernel,接入、注册与构建仍走本 skill。NCU 优化必须先 profile 后修改,再复采验证。

算子形态现状与后端边界:仓库当前只有纯 CUDA/CuTe C++ kernel(csrc/kernels/),没有 Triton,也没有 CuTe DSL 算子。后续可能引入 CuTe DSL(@cute.kernel)算子,但必须先补齐 Python 侧注册、扩展构建与打包这条链再落地;Triton 明确不支持,不要新增,也不要恢复 kernels/backend.py 之类后端选择层。上游只有 Triton 实现时,读算法后用 CUDA 重写。细则与反模式见 references/operator-migration.md §1、§9。

1. 分层架构(所有算子族共用)

内部调用点
  -> torch.ops.cache_dit_cuda_ops.<op>        Python 侧 torch.library:dispatch / fake / compile
  -> kernels/_<族>.py  @torch.library.impl(..., "CUDA")   元数据校验 + 建输出
  -> _call_<op>()                            out-param 桥 + 签名归一化
  -> _C_<族>.ops.<op>                        pybind 子模块
  -> csrc/kernels/<族>/<TU>.cpp -> <kernel>.cu            TORCH_CHECK + launch

Read the full file on GitHub · 179 lines

Files

What ships with it

6 files 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. today First seen · 179 lines · 136 tokens per session scan A 5af9d548ad38

Subscribe to this mod's changes

cache-dit-custom-kernel is a skill published in the GitHub repository vipshop/cache-dit (1,300 stars, last pushed today), licensed Apache-2.0. It adds 136 tokens to every session and 3,976 once invoked, about $0.0005 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-custom-kernel compared with skills from other repositories

cache-dit-custom-kernel next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cache-dit-custom-kernelvipshop/cache-ditSkill1.3ktodayApache-2.0A136Claude Code
ax-cpp-aiax-llm/axSkill3.0k3d agoApache-2.0A47Claude Code, Codex
ax-cpp-genax-llm/axSkill3.0k3d agoApache-2.0A48Claude Code, Codex
ax-cpp-signatureax-llm/axSkill3.0k3d agoApache-2.0A37Claude Code, Codex
ax-cpp-typesafeax-llm/axSkill3.0k3d agoApache-2.0A57Claude Code, Codex
ax-cpp-gepaax-llm/axSkill3.0k3d agoApache-2.0A39Claude Code, Codex
cuda-kernelshuggingface/kernelsSkill783yesterdayApache-2.0A120Claude Code