cache-dit-1.3.5


توضیحات

Cache-DiT: A PyTorch-native Inference Engine with Hybrid Cache Acceleration and Massive Parallelism for DiTs.
ویژگی مقدار
سیستم عامل -
نام فایل cache-dit-1.3.5
نام cache-dit
نسخه کتابخانه 1.3.5
نگهدارنده ['DefTruth, vipshop.com, etc']
ایمیل نگهدارنده []
نویسنده DefTruth, vipshop.com, etc.
ایمیل نویسنده -
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/cache-dit/
مجوز -
<div align="center"> <p align="center"> <h2 align="center"> <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cache-dit-logo-v2.png width=185px align="left"> 🤗🎉A PyTorch-native Inference Engine with Hybrid <br>Cache Acceleration and Massive Parallelism for DiTs<br> <a href="https://pepy.tech/projects/cache-dit"><img src=https://static.pepy.tech/personalized-badge/cache-dit?period=total&units=ABBREVIATION&left_color=GRAY&right_color=BLUE&left_text=downloads/pypi ></a> <a href="https://pypi.org/project/cache-dit/"><img src=https://img.shields.io/github/release/vipshop/cache-dit.svg?color=GREEN ></a> <img src="https://img.shields.io/github/license/vipshop/cache-dit.svg?color=blue"> <a href="https://cache-dit.readthedocs.io/en/latest/COMMUNITY/"><img src=https://img.shields.io/badge/🤗-Community-orange.svg ></a> <a href="https://hellogithub.com/repository/vipshop/cache-dit" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=b8b03b3b32a449ea84cfc2b96cd384f3&claim_uid=ofSCbzTmdeQk3FD&theme=small" alt="Featured|HelloGitHub" /></a> </h2> </p> </div> **🤗Why Cache-DiT❓❓**Cache-DiT is built on top of the 🤗[Diffusers](https://github.com/huggingface/diffusers) library and now supports nearly [ALL](https://cache-dit.readthedocs.io/en/latest/supported_matrix/NVIDIA_GPU/) DiTs from Diffusers. It provides [hybrid cache acceleration](https://cache-dit.readthedocs.io/en/latest/user_guide/CACHE_API/) (DBCache, TaylorSeer, SCM, etc.) and comprehensive [parallelism](https://cache-dit.readthedocs.io/en/latest/user_guide/CONTEXT_PARALLEL/) optimizations, including Context Parallelism, Tensor Parallelism, hybrid 2D or 3D parallelism, and dedicated extra parallelism support for Text Encoder, VAE, and ControlNet. <div align="center"> <img src=https://github.com/vipshop/cache-dit/raw/main/assets/arch_v2.png width=815px> </div> Cache-DiT is compatible with compilation, CPU Offloading, and quantization, fully integrates with [SGLang Diffusion](https://docs.sglang.io/diffusion/performance/cache/cache_dit.html), [vLLM-Omni](https://docs.vllm.ai/projects/vllm-omni/en/latest/user_guide/diffusion/cache_dit_acceleration/), ComfyUI, and runs natively on NVIDIA GPUs, Ascend NPUs and AMD GPUs. Cache-DiT is **fast**, **easy to use**, and **flexible** for various DiTs (online docs at 📘[readthedocs.io](https://cache-dit.readthedocs.io/en/latest/)). <div align="center"> <img src=https://github.com/vipshop/cache-dit/raw/main/assets/speedup_v5.png width=800px> <p align="center"> <i>(Let's go beyond Cache-DiT) 👉</i> <a href="https://docs.sglang.io/diffusion/performance/cache/cache_dit.html"> SGLang Diffusion </a> | <a href="https://docs.vllm.ai/projects/vllm-omni/en/latest/user_guide/diffusion/cache_dit_acceleration/"> vLLM-Omni </a> | <a href="https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit"> Diffusers </a> </p> </div> ## 🚀Quick Start You can install the cache-dit from PyPI or from source: ```bash pip3 install -U cache-dit # or, pip3 install git+https://github.com/vipshop/cache-dit.git ``` Then accelerate your DiTs with just **♥️one line♥️** of code ~ ```python >>> import cache_dit >>> from diffusers import DiffusionPipeline >>> pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image") >>> cache_dit.enable_cache(pipe) # Cache Acceleration with One-line code. >>> from cache_dit import DBCacheConfig, ParallelismConfig >>> cache_dit.enable_cache( # Or, Hybrid Cache Acceleration + Parallelism. ... pipe, cache_config=DBCacheConfig(), # w/ default ... parallelism_config=ParallelismConfig(ulysses_size=2)) >>> from cache_dit import DBCacheConfig, ParallelismConfig, QuantizeConfig >>> cache_dit.enable_cache( # Or, Hybrid Cache + Parallelism + Quantization. ... pipe, cache_config=DBCacheConfig(), # w/ default ... parallelism_config=ParallelismConfig(ulysses_size=2), ... quantize_config=QuantizeConfig(quant_type="...")) >>> output = pipe(...) # Then, just call the pipe as normal. ``` For more advanced features, please refer to our online documentation at 📘[readthedocs.io](https://cache-dit.readthedocs.io/en/latest/). ## 🌐Community Integration - 🎉[ComfyUI x Cache-DiT](https://github.com/Jasonzzt/ComfyUI-CacheDiT) - 🎉[(Intel) llm-scaler x Cache-DiT](https://github.com/intel/llm-scaler/tree/main/omni#cache-dit--torchcompile-acceleration) - 🎉[Diffusers x Cache-DiT](https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit) - 🎉[SGLang Diffusion x Cache-DiT](https://docs.sglang.io/diffusion/performance/cache/cache_dit.html) - 🎉[vLLM-Omni x Cache-DiT](https://docs.vllm.ai/projects/vllm-omni/en/latest/user_guide/diffusion/cache_dit_acceleration/) - 🎉[Nunchaku x Cache-DiT](https://nunchaku.tech/docs/nunchaku/usage/cache.html#cache-dit) - 🎉[SD.Next x Cache-DiT](https://github.com/vladmandic/sdnext/blob/master/modules/cachedit.py) - 🎉[stable-diffusion.cpp x Cache-DiT](https://github.com/leejet/stable-diffusion.cpp/blob/master/cache_dit.hpp) - 🎉[jetson-containers x Cache-DiT](https://github.com/dusty-nv/jetson-containers/tree/master/packages/cv/diffusion/cache_edit) ## ©️Acknowledgements Special thanks to vipshop's Computer Vision AI Team for supporting document, testing and deployment of this project. We learned the design and reused code from the following projects: [Diffusers](https://github.com/huggingface/diffusers), [SGLang](https://github.com/sgl-project/sglang), [vLLM](https://github.com/vllm-project/vllm), [vLLM-Omni](https://github.com/vllm-project/vllm-omni), [ParaAttention](https://github.com/chengzeyi/ParaAttention), [xDiT](https://github.com/xdit-project/xDiT) and [TaylorSeer](https://github.com/Shenyi-Z/TaylorSeer). ## ©️Citations <div id="citations"></div> ```BibTeX @misc{cache-dit@2025, title={Cache-DiT: A PyTorch-native Inference Engine with Hybrid Cache Acceleration and Massive Parallelism for DiTs.}, url={https://github.com/vipshop/cache-dit.git}, note={Open-source software available at https://github.com/vipshop/cache-dit.git}, author={DefTruth, vipshop.com, etc.}, year={2025} } ```


نیازمندی

مقدار نام
- pyyaml
- torch>=2.7.1
- diffusers>=0.36.0
- transformers>=4.55.2
xtr einops>=0.8.1;
xtr torchao>=0.14.1;
xtr bitsandbytes>=0.48.1;
xtr scipy;
xtr scikit-image;
xtr image-reward;
xtr lpips==0.1.4;
xtr fastapi>=0.104.0;
xtr uvicorn>=0.24.0;
xtr pydantic>=2.0.0;
xtr peft;
xtr packaging;
xtr pre-commit;
xtr pytest<8.0.0,>=7.0.0;
xtr pytest-html;
xtr expecttest;
xtr hypothesis;
xtr accelerate;
xtr peft;
xtr protobuf;
xtr sentencepiece;
xtr opencv-python-headless;
xtr ftfy;
xtr scikit-image;
xtr mkdocs==1.6.1;
xtr mkdocs-api-autonav;
xtr mkdocs-material==9.7.1;
xtr mkdocstrings-python;
xtr mkdocs-gen-files;
xtr mkdocs-awesome-nav;
xtr mkdocs-glightbox;
xtr mkdocs-git-revision-date-localized-plugin;
xtr mkdocs-minify-plugin;
xtr regex;
xtr ruff;
xtr pydantic;
xtr cache-dit[parallelism];
xtr cache-dit[quantization];
xtr cache-dit[metrics];
xtr cache-dit[serving];


زبان مورد نیاز

مقدار نام
>=3.10 Python


نحوه نصب


نصب پکیج whl cache-dit-1.3.5:

    pip install cache-dit-1.3.5.whl


نصب پکیج tar.gz cache-dit-1.3.5:

    pip install cache-dit-1.3.5.tar.gz