cache-dit
Cache-DiT: A PyTorch-native Inference Engine with Cache, Parallelism, Quantization and CPU Offload for DiTs.
What it is and what it does
Cache-DiT is a PyTorch inference engine for Diffusion Transformers that wraps the Diffusers library and applies multiple optimization strategies: KV-cache acceleration (DBCache, TaylorSeer, SCM), multi-GPU parallelism (Context, Tensor, 2D/3D hybrid), quantization (including SVDQuant W4A4), and layerwise CPU offloading. It integrates with SGLang Diffusion, vLLM-Omni, TensorRT-LLM, ComfyUI, and other frameworks.
The package is designed to be easy to adopt: a single `cache_dit.enable_cache(pipe)` call on a Diffusers pipeline activates caching, and optional config objects allow fine-grained control over parallelism and quantization. It runs on NVIDIA, AMD, and Ascend GPUs. The library is actively maintained, has no known vulnerabilities, and depends on standard ML packages (torch, diffusers, transformers, pyyaml, packaging).
Use it for:
- Speed up text-to-image generation pipelines by enabling KV-cache and context parallelism with minimal code changes.
- Reduce GPU memory footprint and latency on multi-GPU setups using tensor parallelism and hybrid 2D/3D parallelism.
- Quantize large DiT models to int4 or nvfp4 precision without calibration data using SVDQuant.
- Offload transformer layers to CPU during inference to fit larger models on limited GPU VRAM.
- Integrate cache acceleration into existing ComfyUI, SGLang, or vLLM workflows via community plugins.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cache-DiT accelerates inference for Diffusion Transformers (DiTs) via hybrid caching, parallelism, quantization, and CPU offloading, integrating with the Diffusers library and supporting NVIDIA, AMD, and Ascend hardware.
Yes, with conditions. Cache-DiT is actively maintained, has no known vulnerabilities, and offers genuine performance gains for Diffusion Transformer inference. Install it if you run Diffusers pipelines on GPU and want to reduce latency or memory usage. However, verify the license status before use in proprietary contexts, and test speedup claims on your specific hardware and model architecture.
Install
cache-dit on PyPI
pip
pip install cache-dituv
uv add cache-ditpoetry
poetry add cache-ditInstalling cache-dit
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance (last commit 2026-08-14, 1246 GitHub stars). Requires PyTorch, Diffusers, and related ML libraries already in your environment.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or restricted contexts.
Quickstart
pip install cache-dit
import cache_dit
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained(...).to("cuda")
cache_dit.enable_cache(pipe) # One-line cache acceleration
output = pipe(...)
Requires Python >=3.10, PyTorch, and a compatible GPU (NVIDIA, AMD, or Ascend). For SVDQuant quantization: CUDA 13.0+, PyTorch 2.11+, Ubuntu 22.04+.
Verify before relying
- Whether the unclear license permits commercial use or redistribution.
- Actual speedup gains (9x mentioned in description) under typical production workloads.
- Compatibility matrix with specific Diffusers versions and DiT architectures.
- Performance overhead of layerwise CPU offload on systems with limited PCIe bandwidth.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — packaging, pyyaml, torch, diffusers, transformers |
| Maintenance | actively maintained — 59 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 646,072/month — #5,596 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cache_dit-1.5.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
tomesdSpeeds up Stable Diffusion image generation by…
permissive · top 15,000 on PyPI
diffusersDiffusers provides pretrained diffusion models…
permissive · top 5,000 on PyPI
nvidia-modeloptApplies state-of-the-art model optimization…
permissive · top 15,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
compelCompel lets you re-weight different parts of…
permissive · top 15,000 on PyPI
nvidia-cudnn-cu11Provides cuDNN runtime libraries for…
unclear · top 5,000 on PyPI
nvidia-cusparseProvides NVIDIA CUSPARSE native runtime…
unclear · top 1,000 on PyPI
cpm-kernelsProvides CUDA kernels optimized for CPM,…
permissive · top 15,000 on PyPI
optimum-intelOptimum Intel bridges Hugging Face Transformers…
permissive · top 15,000 on PyPI
mmgpOptimizes GPU memory usage for running large…
unclear · top 15,000 on PyPI