cache-dit 0.3.2__py3-none-any.whl → 1.0.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. cache_dit/__init__.py +37 -19
  2. cache_dit/_version.py +2 -2
  3. cache_dit/caching/__init__.py +36 -0
  4. cache_dit/{cache_factory → caching}/block_adapters/__init__.py +149 -18
  5. cache_dit/{cache_factory → caching}/block_adapters/block_adapters.py +91 -7
  6. cache_dit/caching/block_adapters/block_registers.py +118 -0
  7. cache_dit/caching/cache_adapters/__init__.py +1 -0
  8. cache_dit/{cache_factory → caching}/cache_adapters/cache_adapter.py +262 -123
  9. cache_dit/caching/cache_blocks/__init__.py +226 -0
  10. cache_dit/caching/cache_blocks/offload_utils.py +115 -0
  11. cache_dit/caching/cache_blocks/pattern_0_1_2.py +26 -0
  12. cache_dit/caching/cache_blocks/pattern_3_4_5.py +543 -0
  13. cache_dit/caching/cache_blocks/pattern_base.py +748 -0
  14. cache_dit/caching/cache_blocks/pattern_utils.py +86 -0
  15. cache_dit/caching/cache_contexts/__init__.py +28 -0
  16. cache_dit/caching/cache_contexts/cache_config.py +120 -0
  17. cache_dit/{cache_factory → caching}/cache_contexts/cache_context.py +29 -90
  18. cache_dit/{cache_factory → caching}/cache_contexts/cache_manager.py +138 -10
  19. cache_dit/{cache_factory → caching}/cache_contexts/calibrators/__init__.py +25 -3
  20. cache_dit/{cache_factory → caching}/cache_contexts/calibrators/foca.py +1 -1
  21. cache_dit/{cache_factory → caching}/cache_contexts/calibrators/taylorseer.py +81 -9
  22. cache_dit/caching/cache_contexts/context_manager.py +36 -0
  23. cache_dit/caching/cache_contexts/prune_config.py +63 -0
  24. cache_dit/caching/cache_contexts/prune_context.py +155 -0
  25. cache_dit/caching/cache_contexts/prune_manager.py +167 -0
  26. cache_dit/caching/cache_interface.py +358 -0
  27. cache_dit/{cache_factory → caching}/cache_types.py +19 -2
  28. cache_dit/{cache_factory → caching}/forward_pattern.py +14 -14
  29. cache_dit/{cache_factory → caching}/params_modifier.py +10 -10
  30. cache_dit/caching/patch_functors/__init__.py +15 -0
  31. cache_dit/{cache_factory → caching}/patch_functors/functor_chroma.py +1 -1
  32. cache_dit/{cache_factory → caching}/patch_functors/functor_dit.py +1 -1
  33. cache_dit/{cache_factory → caching}/patch_functors/functor_flux.py +1 -1
  34. cache_dit/{cache_factory → caching}/patch_functors/functor_hidream.py +2 -4
  35. cache_dit/{cache_factory → caching}/patch_functors/functor_hunyuan_dit.py +1 -1
  36. cache_dit/caching/patch_functors/functor_qwen_image_controlnet.py +263 -0
  37. cache_dit/caching/utils.py +68 -0
  38. cache_dit/metrics/__init__.py +11 -0
  39. cache_dit/metrics/metrics.py +3 -0
  40. cache_dit/parallelism/__init__.py +3 -0
  41. cache_dit/parallelism/backends/native_diffusers/__init__.py +6 -0
  42. cache_dit/parallelism/backends/native_diffusers/context_parallelism/__init__.py +164 -0
  43. cache_dit/parallelism/backends/native_diffusers/context_parallelism/attention/__init__.py +4 -0
  44. cache_dit/parallelism/backends/native_diffusers/context_parallelism/attention/_attention_dispatch.py +304 -0
  45. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_chroma.py +95 -0
  46. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cogvideox.py +202 -0
  47. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cogview.py +299 -0
  48. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cosisid.py +123 -0
  49. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_dit.py +94 -0
  50. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_flux.py +88 -0
  51. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_hunyuan.py +729 -0
  52. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_ltxvideo.py +264 -0
  53. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_nunchaku.py +407 -0
  54. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_pixart.py +285 -0
  55. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_qwen_image.py +104 -0
  56. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_registers.py +84 -0
  57. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_wan.py +101 -0
  58. cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_planners.py +117 -0
  59. cache_dit/parallelism/backends/native_diffusers/parallel_difffusers.py +49 -0
  60. cache_dit/parallelism/backends/native_diffusers/utils.py +11 -0
  61. cache_dit/parallelism/backends/native_pytorch/__init__.py +6 -0
  62. cache_dit/parallelism/backends/native_pytorch/parallel_torch.py +62 -0
  63. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/__init__.py +48 -0
  64. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_flux.py +171 -0
  65. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_kandinsky5.py +79 -0
  66. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_qwen_image.py +78 -0
  67. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_registers.py +65 -0
  68. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_wan.py +153 -0
  69. cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_planners.py +14 -0
  70. cache_dit/parallelism/parallel_backend.py +26 -0
  71. cache_dit/parallelism/parallel_config.py +88 -0
  72. cache_dit/parallelism/parallel_interface.py +77 -0
  73. cache_dit/quantize/__init__.py +7 -0
  74. cache_dit/quantize/backends/__init__.py +1 -0
  75. cache_dit/quantize/backends/bitsandbytes/__init__.py +0 -0
  76. cache_dit/quantize/backends/torchao/__init__.py +1 -0
  77. cache_dit/quantize/{quantize_ao.py → backends/torchao/quantize_ao.py} +44 -30
  78. cache_dit/quantize/quantize_backend.py +0 -0
  79. cache_dit/quantize/quantize_config.py +0 -0
  80. cache_dit/quantize/quantize_interface.py +3 -16
  81. cache_dit/summary.py +593 -0
  82. cache_dit/utils.py +46 -290
  83. cache_dit-1.0.14.dist-info/METADATA +301 -0
  84. cache_dit-1.0.14.dist-info/RECORD +102 -0
  85. cache_dit-1.0.14.dist-info/licenses/LICENSE +203 -0
  86. cache_dit/cache_factory/__init__.py +0 -28
  87. cache_dit/cache_factory/block_adapters/block_registers.py +0 -90
  88. cache_dit/cache_factory/cache_adapters/__init__.py +0 -1
  89. cache_dit/cache_factory/cache_blocks/__init__.py +0 -72
  90. cache_dit/cache_factory/cache_blocks/pattern_0_1_2.py +0 -16
  91. cache_dit/cache_factory/cache_blocks/pattern_3_4_5.py +0 -238
  92. cache_dit/cache_factory/cache_blocks/pattern_base.py +0 -404
  93. cache_dit/cache_factory/cache_blocks/utils.py +0 -41
  94. cache_dit/cache_factory/cache_contexts/__init__.py +0 -14
  95. cache_dit/cache_factory/cache_interface.py +0 -217
  96. cache_dit/cache_factory/patch_functors/__init__.py +0 -12
  97. cache_dit/cache_factory/utils.py +0 -57
  98. cache_dit-0.3.2.dist-info/METADATA +0 -753
  99. cache_dit-0.3.2.dist-info/RECORD +0 -56
  100. cache_dit-0.3.2.dist-info/licenses/LICENSE +0 -53
  101. /cache_dit/{cache_factory → caching}/.gitignore +0 -0
  102. /cache_dit/{cache_factory → caching}/cache_contexts/calibrators/base.py +0 -0
  103. /cache_dit/{cache_factory → caching}/patch_functors/functor_base.py +0 -0
  104. /cache_dit/{custom_ops → kernels}/__init__.py +0 -0
  105. /cache_dit/{custom_ops → kernels}/triton_taylorseer.py +0 -0
  106. {cache_dit-0.3.2.dist-info → cache_dit-1.0.14.dist-info}/WHEEL +0 -0
  107. {cache_dit-0.3.2.dist-info → cache_dit-1.0.14.dist-info}/entry_points.txt +0 -0
  108. {cache_dit-0.3.2.dist-info → cache_dit-1.0.14.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,301 @@
1
+ Metadata-Version: 2.4
2
+ Name: cache_dit
3
+ Version: 1.0.14
4
+ Summary: A Unified and Flexible Inference Engine with Hybrid Cache Acceleration and Parallelism for 🤗Diffusers.
5
+ Author: DefTruth, vipshop.com, etc.
6
+ Maintainer: DefTruth, vipshop.com, etc
7
+ Project-URL: Repository, https://github.com/vipshop/cache-dit
8
+ Project-URL: Homepage, https://github.com/vipshop/cache-dit
9
+ Project-URL: GitHub, https://github.com/vipshop/cache-dit
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: pyyaml
14
+ Requires-Dist: torch>=2.7.1
15
+ Requires-Dist: diffusers>=0.35.1
16
+ Requires-Dist: transformers>=4.55.2
17
+ Provides-Extra: parallelism
18
+ Requires-Dist: einops>=0.8.1; extra == "parallelism"
19
+ Provides-Extra: quantization
20
+ Requires-Dist: torchao>=0.14.1; extra == "quantization"
21
+ Requires-Dist: bitsandbytes>=0.48.1; extra == "quantization"
22
+ Provides-Extra: metrics
23
+ Requires-Dist: scipy; extra == "metrics"
24
+ Requires-Dist: scikit-image; extra == "metrics"
25
+ Requires-Dist: image-reward; extra == "metrics"
26
+ Requires-Dist: lpips==0.1.4; extra == "metrics"
27
+ Provides-Extra: dev
28
+ Requires-Dist: packaging; extra == "dev"
29
+ Requires-Dist: pre-commit; extra == "dev"
30
+ Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "dev"
31
+ Requires-Dist: pytest-html; extra == "dev"
32
+ Requires-Dist: expecttest; extra == "dev"
33
+ Requires-Dist: hypothesis; extra == "dev"
34
+ Requires-Dist: accelerate; extra == "dev"
35
+ Requires-Dist: peft; extra == "dev"
36
+ Requires-Dist: protobuf; extra == "dev"
37
+ Requires-Dist: sentencepiece; extra == "dev"
38
+ Requires-Dist: opencv-python-headless; extra == "dev"
39
+ Requires-Dist: ftfy; extra == "dev"
40
+ Requires-Dist: scikit-image; extra == "dev"
41
+ Provides-Extra: all
42
+ Requires-Dist: cache-dit[parallelism]; extra == "all"
43
+ Requires-Dist: cache-dit[quantization]; extra == "all"
44
+ Requires-Dist: cache-dit[metrics]; extra == "all"
45
+ Dynamic: license-file
46
+ Dynamic: requires-python
47
+
48
+ <div align="center">
49
+ <p align="center">
50
+ <h2 align="center">
51
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cache-dit-logo.png height="90" align="left">
52
+ A Unified and Flexible Inference Engine with 🤗🎉<br>Hybrid Cache Acceleration and Parallelism for DiTs<br>
53
+ <a href="https://pepy.tech/projects/cache-dit"><img src=https://static.pepy.tech/personalized-badge/cache-dit?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=BLUE&left_text=downloads></a>
54
+ <img src=https://img.shields.io/github/stars/vipshop/cache-dit.svg?style=dark >
55
+ <a href="https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit"><img src=https://img.shields.io/badge/🤗Diffusers-ecosystem-yellow.svg ></a>
56
+ <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>
57
+ <img src=https://img.shields.io/badge/Models-30+-hotpink.svg >
58
+ </h2>
59
+ </p>
60
+ </div>
61
+
62
+ <!--
63
+ <a href="https://pepy.tech/projects/cache-dit"><img src=https://static.pepy.tech/personalized-badge/cache-dit?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=GREEN&left_text=downloads></a>
64
+ <a href="https://pypi.org/project/cache-dit/"><img src=https://img.shields.io/pypi/dm/cache-dit.svg ></a>
65
+ -->
66
+
67
+ ## 🔥Hightlight
68
+
69
+ We are excited to announce that the **first API-stable version (v1.0.0)** of cache-dit has finally been released!
70
+ **[cache-dit](https://github.com/vipshop/cache-dit)** is a **Unified** and **Flexible** inference engine for 🤗 Diffusers, enabling acceleration with just ♥️**one line**♥️ of code. Key features: **Unified Cache APIs**, **Forward Pattern Matching**, **Automatic Block Adapter**, **DBCache**, **DBPrune**, **Hybrid TaylorSeer Calibrator**, **Hybrid Cache CFG**, **Context Parallelism**, **Tensor Parallelism**, **Torch Compile Compatible** and **🎉SOTA** performance.
71
+
72
+ ```bash
73
+ pip3 install -U cache-dit # pip3 install git+https://github.com/vipshop/cache-dit.git
74
+ ```
75
+ You can install the stable release of cache-dit from PyPI, or the latest development version from GitHub. Then try ♥️ Cache Acceleration with just **one line** of code ~ ♥️
76
+ ```python
77
+ >>> import cache_dit
78
+ >>> from diffusers import DiffusionPipeline
79
+ >>> pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image") # Can be any diffusion pipeline
80
+ >>> cache_dit.enable_cache(pipe) # One-line code with default cache options.
81
+ >>> output = pipe(...) # Just call the pipe as normal.
82
+ >>> stats = cache_dit.summary(pipe) # Then, get the summary of cache acceleration stats.
83
+ >>> cache_dit.disable_cache(pipe) # Disable cache and run original pipe.
84
+ ```
85
+
86
+ ### 📚Core Features
87
+
88
+ - **[🎉Full 🤗Diffusers Support](./docs/User_Guide.md#supported-pipelines)**: Notably, **[cache-dit](https://github.com/vipshop/cache-dit)** now supports nearly **all** of Diffusers' **DiT-based** pipelines, include **[30+](./examples/pipeline/)** series, nearly **[100+](./examples/pipeline/)** pipelines, such as FLUX.1, Qwen-Image, Qwen-Image-Lightning, Wan 2.1/2.2, HunyuanImage-2.1, HunyuanVideo, HiDream, AuraFlow, CogView3Plus, CogView4, CogVideoX, LTXVideo, ConsisID, SkyReelsV2, VisualCloze, PixArt, Chroma, Mochi, SD 3.5, DiT-XL, etc.
89
+ - **[🎉Extremely Easy to Use](./docs/User_Guide.md#unified-cache-apis)**: In most cases, you only need **one line** of code: `cache_dit.enable_cache(...)`. After calling this API, just use the pipeline as normal.
90
+ - **[🎉Easy New Model Integration](./docs/User_Guide.md#automatic-block-adapter)**: Features like **Unified Cache APIs**, **Forward Pattern Matching**, **Automatic Block Adapter**, **Hybrid Forward Pattern**, and **Patch Functor** make it highly functional and flexible. For example, we achieved 🎉 Day 1 support for [HunyuanImage-2.1](https://github.com/Tencent-Hunyuan/HunyuanImage-2.1) with 1.7x speedup w/o precision loss—even before it was available in the Diffusers library.
91
+ - **[🎉State-of-the-Art Performance](./bench/)**: Compared with algorithms including Δ-DiT, Chipmunk, FORA, DuCa, TaylorSeer and FoCa, cache-dit achieved the **SOTA** performance w/ **7.4x↑🎉** speedup on ClipScore!
92
+ - **[🎉Support for 4/8-Steps Distilled Models](./bench/)**: Surprisingly, cache-dit's **DBCache** works for extremely few-step distilled models—something many other methods fail to do.
93
+ - **[🎉Compatibility with Other Optimizations](./docs/User_Guide.md#️torch-compile)**: Designed to work seamlessly with torch.compile, Quantization ([torchao](./examples/quantize/), [🔥nunchaku](./examples/quantize/)), CPU or Sequential Offloading, **[🔥Context Parallelism](./docs/User_Guide.md/#️hybrid-context-parallelism)**, **[🔥Tensor Parallelism](./docs/User_Guide.md#️hybrid-tensor-parallelism)**, etc.
94
+ - **[🎉Hybrid Cache Acceleration](./docs/User_Guide.md#taylorseer-calibrator)**: Now supports hybrid **Block-wise Cache + Calibrator** schemes (e.g., DBCache or DBPrune + TaylorSeerCalibrator). DBCache or DBPrune acts as the **Indicator** to decide *when* to cache, while the Calibrator decides *how* to cache. More mainstream cache acceleration algorithms (e.g., FoCa) will be supported in the future, along with additional benchmarks—stay tuned for updates!
95
+ - **[🤗Diffusers Ecosystem Integration](https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit)**: 🔥**cache-dit** has joined the Diffusers community ecosystem as the **first** DiT-specific cache acceleration framework! Check out the documentation here: <a href="https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit"><img src=https://img.shields.io/badge/🤗Diffusers-ecosystem-yellow.svg ></a>
96
+
97
+ ![](https://github.com/vipshop/cache-dit/raw/main/assets/clip-score-bench.png)
98
+
99
+ ## 🔥 Supported DiTs
100
+
101
+ > [!Tip]
102
+ > One **Model Series** may contain **many** pipelines. cache-dit applies optimizations at the **Transformer** level; thus, any pipelines that include the supported transformer are already supported by cache-dit. ✅: known work and official supported now; ✖️: unofficial supported now, but maybe support in the future; **4-bits**: w/ nunchaku + svdq int4.
103
+
104
+ <div align="center">
105
+
106
+ | 📚Model | Cache | CP | TP | 📚Model | Cache | CP | TP |
107
+ |:---|:---|:---|:---|:---|:---|:---|:---|
108
+ | **🎉[FLUX.1](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[FLUX.1 4-bits](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ |
109
+ | **🎉[Qwen-Image](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[Qwen-Image 4-bits](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ |
110
+ | **🎉[Qwen...Lightning](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[Qwen...Lightning 4-bits](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ |
111
+ | **🎉[CogVideoX](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[OmniGen](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
112
+ | **🎉[Wan 2.1](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[PixArt](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ |
113
+ | **🎉[Wan 2.2](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[CogVideoX 1.5](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ |
114
+ | **🎉[HunyuanVideo](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ | **🎉[Sana](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
115
+ | **🎉[LTX](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[VisualCloze](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ |
116
+ | **🎉[Allegro](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[AuraFlow](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
117
+ | **🎉[CogView4](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[ShapE](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
118
+ | **🎉[CogView3Plus](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[Chroma](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ️✅ |
119
+ | **🎉[Cosmos](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[HiDream](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
120
+ | **🎉[EasyAnimate](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[HunyuanDiT](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
121
+ | **🎉[SkyReelsV2](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[HunyuanDiTPAG](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
122
+ | **🎉[StableDiffusion3](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[Kandinsky5](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✅️ |
123
+ | **🎉[ConsisID](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[PRX](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
124
+ | **🎉[DiT](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✖️ | **🎉[HunyuanImage](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✅ | ✅ |
125
+ | **🎉[Amused](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[LongCatVideo](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
126
+ | **🎉[StableAudio](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[Bria](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
127
+ | **🎉[Mochi](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ | **🎉[Lumina](https://github.com/vipshop/cache-dit/blob/main/examples/pipeline)** | ✅ | ✖️ | ✖️ |
128
+
129
+ </div>
130
+
131
+ <details align='center'>
132
+ <summary>🔥<b>Click</b> here to show many <b>Image/Video</b> cases🔥</summary>
133
+
134
+ <p align='center'>
135
+ 🎉Now, cache-dit covers almost All Diffusers' DiT Pipelines🎉 <br>
136
+ 🔥<a href="./examples/pipeline">Qwen-Image</a> | <a href="./examples/pipeline">Qwen-Image-Edit</a> | <a href="./examples/pipeline">Qwen-Image-Edit-Plus </a> 🔥<br>
137
+ 🔥<a href="./examples/pipeline">FLUX.1</a> | <a href="./examples/pipeline">Qwen-Image-Lightning 4/8 Steps</a> | <a href="./examples/pipeline"> Wan 2.1 </a> | <a href="./examples/pipeline"> Wan 2.2 </a>🔥<br>
138
+ 🔥<a href="./examples/pipeline">HunyuanImage-2.1</a> | <a href="./examples/pipeline">HunyuanVideo</a> | <a href="./examples/pipeline">HunyuanDiT</a> | <a href="./examples/pipeline">HiDream</a> | <a href="./examples/pipeline">AuraFlow</a>🔥<br>
139
+ 🔥<a href="./examples/pipeline">CogView3Plus</a> | <a href="./examples/pipeline">CogView4</a> | <a href="./examples/pipeline">LTXVideo</a> | <a href="./examples/pipeline">CogVideoX</a> | <a href="./examples/">CogVideoX 1.5</a> | <a href="./examples/">ConsisID</a>🔥<br>
140
+ 🔥<a href="./examples/pipeline">Cosmos</a> | <a href="./examples/pipeline">SkyReelsV2</a> | <a href="./examples/pipeline">VisualCloze</a> | <a href="./examples/pipeline">OmniGen 1/2</a> | <a href="./examples/pipeline">Lumina 1/2</a> | <a href="./examples/pipeline">PixArt</a>🔥<br>
141
+ 🔥<a href="./examples/pipeline">Chroma</a> | <a href="./examples/pipeline">Sana</a> | <a href="./examples/pipeline">Allegro</a> | <a href="./examples/pipeline">Mochi</a> | <a href="./examples/pipeline">SD 3/3.5</a> | <a href="./examples/pipeline">Amused</a> | <a href="./examples/pipeline"> ... </a> | <a href="./examples/pipeline">DiT-XL</a>🔥
142
+ </p>
143
+
144
+ <div align='center'>
145
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/wan2.2.C0_Q0_NONE.gif width=124px>
146
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/wan2.2.C1_Q0_DBCACHE_F1B0_W2M8MC2_T1O2_R0.08.gif width=124px>
147
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/hunyuan_video.C0_L0_Q0_NONE.gif width=126px>
148
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/hunyuan_video.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.12_S27.gif width=126px>
149
+ <p><b>🔥Wan2.2 MoE</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.0x↑🎉 | <b>HunyuanVideo</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.1x↑🎉</p>
150
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image.C0_Q0_NONE.png width=160px>
151
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image.C1_Q0_DBCACHE_F8B0_W8M0MC0_T1O4_R0.12_S23.png width=160px>
152
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux.C0_Q0_NONE_T23.69s.png width=90px>
153
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux.C0_Q0_DBCACHE_F1B0_W4M0MC0_T1O2_R0.15_S16_T11.39s.png width=90px>
154
+ <p><b>🔥Qwen-Image</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.8x↑🎉 | <b>FLUX.1-dev</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.1x↑🎉</p>
155
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image-lightning.4steps.C0_L1_Q0_NONE.png width=160px>
156
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image-lightning.4steps.C0_L1_Q0_DBCACHE_F16B16_W2M1MC1_T0O2_R0.9_S1.png width=160px>
157
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/hunyuan-image-2.1.C0_L0_Q1_fp8_w8a16_wo_NONE.png width=90px>
158
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/hunyuan-image-2.1.C0_L0_Q1_fp8_w8a16_wo_DBCACHE_F8B0_W8M0MC2_T1O2_R0.12_S25.png width=90px>
159
+ <p><b>🔥Qwen...Lightning</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.14x↑🎉 | <b>HunyuanImage</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.7x↑🎉</p>
160
+ <img src=https://github.com/vipshop/cache-dit/raw/main/examples/data/bear.png width=125px>
161
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image-edit.C0_L0_Q0_NONE.png width=125px>
162
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image-edit.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S18.png width=125px>
163
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/qwen-image-edit.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.12_S24.png width=125px>
164
+ <p><b>🔥Qwen-Image-Edit</b> | Input w/o Edit | Baseline | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.6x↑🎉 | 1.9x↑🎉 </p>
165
+ </div>
166
+ <div align='center'>
167
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux-kontext-cat.C0_L0_Q0_NONE.png width=100px>
168
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux-kontext.C0_L0_Q0_NONE.png width=100px>
169
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux-kontext.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S10.png width=100px>
170
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux-kontext.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.12_S12.png width=100px>
171
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/flux-kontext.C0_L0_Q0_DBCACHE_F1B0_W2M0MC2_T0O2_R0.15_S15.png width=100px>
172
+ <p><b>🔥FLUX-Kontext-dev</b> | Baseline | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.3x↑🎉 | 1.7x↑🎉 | 2.0x↑ 🎉</p>
173
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/hidream.C0_L0_Q0_NONE.png width=100px>
174
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/hidream.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T0O2_R0.08_S24.png width=100px>
175
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview4.C0_L0_Q0_NONE.png width=100px>
176
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview4.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S15.png width=100px>
177
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview4.C0_L0_Q0_DBCACHE_F1B0_W4M0MC4_T0O2_R0.2_S22.png width=100px>
178
+ <p><b>🔥HiDream-I1</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.9x↑🎉 | <b>CogView4</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.4x↑🎉 | 1.7x↑🎉</p>
179
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview3_plus.C0_L0_Q0_NONE.png width=100px>
180
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview3_plus.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S15.png width=100px>
181
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/cogview3_plus.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.08_S25.png width=100px>
182
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/chroma1-hd.C0_L0_Q0_NONE.png width=100px>
183
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/chroma1-hd.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T0O2_R0.08_S20.png width=100px>
184
+ <p><b>🔥CogView3</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.5x↑🎉 | 2.0x↑🎉| <b>Chroma1-HD</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.9x↑🎉</p>
185
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/mochi.C0_L0_Q0_NONE.gif width=125px>
186
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/mochi.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S34.gif width=125px>
187
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/skyreels_v2.C0_L0_Q0_NONE.gif width=125px>
188
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/skyreels_v2.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.12_S17.gif width=125px>
189
+ <p><b>🔥Mochi-1-preview</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.8x↑🎉 | <b>SkyReelsV2</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.6x↑🎉</p>
190
+ <img src=https://github.com/vipshop/cache-dit/raw/main/examples/data/visualcloze/00555_00.jpg width=100px>
191
+ <img src=https://github.com/vipshop/cache-dit/raw/main/examples/data/visualcloze/12265_00.jpg width=100px>
192
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/visualcloze-512.C0_L0_Q0_NONE.png width=100px>
193
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/visualcloze-512.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S15.png width=100px>
194
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/visualcloze-512.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T0O2_R0.08_S18.png width=100px>
195
+ <p><b>🔥VisualCloze-512</b> | Model | Cloth | Baseline | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.4x↑🎉 | 1.7x↑🎉 </p>
196
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/ltx-video.C0_L0_Q0_NONE.gif width=144px>
197
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/ltx-video.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T0O2_R0.15_S13.gif width=144px>
198
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/cogvideox1.5.C0_L0_Q0_NONE.gif width=105px>
199
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/cogvideox1.5.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T0O2_R0.12_S22.gif width=105px>
200
+ <p><b>🔥LTX-Video-0.9.7</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.7x↑🎉 | <b>CogVideoX1.5</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.0x↑🎉</p>
201
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/omingen-v1.C0_L0_Q0_NONE.png width=100px>
202
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/omingen-v1.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S24.png width=100px>
203
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/omingen-v1.C0_L0_Q0_DBCACHE_F1B0_W8M0MC0_T1O2_R0.08_S38.png width=100px>
204
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/lumina2.C0_L0_Q0_NONE.png width=100px>
205
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/lumina2.C0_L0_Q0_DBCACHE_F1B0_W2M0MC2_T0O2_R0.12_S14.png width=100px>
206
+ <p><b>🔥OmniGen-v1</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.5x↑🎉 | 3.3x↑🎉 | <b>Lumina2</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.9x↑🎉</p>
207
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/allegro.C0_L0_Q0_NONE.gif width=117px>
208
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/gifs/allegro.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.26_S27.gif width=117px>
209
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/auraflow.C0_L0_Q0_NONE.png width=133px>
210
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/auraflow.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.08_S28.png width=133px>
211
+ <p><b>🔥Allegro</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.36x↑🎉 | <b>AuraFlow-v0.3</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.27x↑🎉 </p>
212
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/sana.C0_L0_Q0_NONE.png width=100px>
213
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/sana.C0_L0_Q0_DBCACHE_F8B0_W8M0MC2_T0O2_R0.25_S6.png width=100px>
214
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/sana.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.3_S8.png width=100px>
215
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/pixart-sigma.C0_L0_Q0_NONE.png width=100px>
216
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/pixart-sigma.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S28.png width=100px>
217
+ <p><b>🔥Sana</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.3x↑🎉 | 1.6x↑🎉| <b>PixArt-Sigma</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.3x↑🎉</p>
218
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/pixart-alpha.C0_L0_Q0_NONE.png width=100px>
219
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/pixart-alpha.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.05_S27.png width=100px>
220
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/pixart-alpha.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.08_S32.png width=100px>
221
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/sd_3_5.C0_L0_Q0_NONE.png width=100px>
222
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/sd_3_5.C0_L0_Q0_DBCACHE_F1B0_W8M0MC3_T0O2_R0.12_S30.png width=100px>
223
+ <p><b>🔥PixArt-Alpha</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.6x↑🎉 | 1.8x↑🎉| <b>SD 3.5</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:2.5x↑🎉</p>
224
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/amused.C0_L0_Q0_NONE.png width=100px>
225
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/amused.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.34_S1.png width=100px>
226
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/amused.C0_L0_Q0_DBCACHE_F8B0_W8M0MC0_T0O2_R0.38_S2.png width=100px>
227
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/dit-xl.C0_L0_Q0_NONE.png width=100px>
228
+ <img src=https://github.com/vipshop/cache-dit/raw/main/assets/dit-xl.C0_L0_Q0_DBCACHE_F1B0_W8M0MC2_T0O2_R0.15_S11.png width=100px>
229
+ <p><b>🔥Asumed</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.1x↑🎉 | 1.2x↑🎉 | <b>DiT-XL-256</b> | <a href="https://github.com/vipshop/cache-dit">+cache-dit</a>:1.8x↑🎉
230
+ <br>♥️ Please consider to leave a <b>⭐️ Star</b> to support us ~ ♥️</p>
231
+ </div>
232
+
233
+ </details>
234
+
235
+ ## 📖Table of Contents
236
+
237
+ <div id="user-guide"></div>
238
+
239
+ For more advanced features such as **Unified Cache APIs**, **Forward Pattern Matching**, **Automatic Block Adapter**, **Hybrid Forward Pattern**, **Patch Functor**, **DBCache**, **DBPrune**, **TaylorSeer Calibrator**, **Hybrid Cache CFG**, **Context Parallelism** and **Tensor Parallelism**, please refer to the [🎉User_Guide.md](./docs/User_Guide.md) for details.
240
+
241
+ - [⚙️Installation](./docs/User_Guide.md#️installation)
242
+ - [🔥Supported DiTs](./docs/User_Guide.md#supported)
243
+ - [🔥Benchmarks](./docs/User_Guide.md#benchmarks)
244
+ - [🎉Unified Cache APIs](./docs/User_Guide.md#unified-cache-apis)
245
+ - [📚Forward Pattern Matching](./docs/User_Guide.md#forward-pattern-matching)
246
+ - [📚Cache with One-line Code](./docs/User_Guide.md#%EF%B8%8Fcache-acceleration-with-one-line-code)
247
+ - [🔥Automatic Block Adapter](./docs/User_Guide.md#automatic-block-adapter)
248
+ - [📚Hybrid Forward Pattern](./docs/User_Guide.md#hybrid-forward-pattern)
249
+ - [📚Implement Patch Functor](./docs/User_Guide.md#implement-patch-functor)
250
+ - [📚Transformer-Only Interface](./docs/User_Guide.md#transformer-only-interface)
251
+ - [📚How to use ParamsModifier](./docs/User_Guide.md#how-to-use-paramsmodifier)
252
+ - [🤖Cache Acceleration Stats](./docs/User_Guide.md#cache-acceleration-stats-summary)
253
+ - [⚡️DBCache: Dual Block Cache](./docs/User_Guide.md#️dbcache-dual-block-cache)
254
+ - [⚡️DBPrune: Dynamic Block Prune](./docs/User_Guide.md#️dbprune-dynamic-block-prune)
255
+ - [⚡️Hybrid Cache CFG](./docs/User_Guide.md#️hybrid-cache-cfg)
256
+ - [🔥Hybrid TaylorSeer Calibrator](./docs/User_Guide.md#taylorseer-calibrator)
257
+ - [⚡️Hybrid Context Parallelism](./docs/User_Guide.md#context-parallelism)
258
+ - [⚡️Hybrid Tensor Parallelism](./docs/User_Guide.md#tensor-parallelism)
259
+ - [🤖Low-bits Quantization](./docs/User_Guide.md#quantization)
260
+ - [🛠Metrics Command Line](./docs/User_Guide.md#metrics-cli)
261
+ - [⚙️Torch Compile](./docs/User_Guide.md#️torch-compile)
262
+ - [📚API Documents](./docs/User_Guide.md#api-documentation)
263
+
264
+ ## 👋Contribute
265
+ <div id="contribute"></div>
266
+
267
+ How to contribute? Star ⭐️ this repo to support us or check [CONTRIBUTE.md](https://github.com/vipshop/cache-dit/raw/main/CONTRIBUTE.md).
268
+
269
+ <div align='center'>
270
+ <a href="https://star-history.com/#vipshop/cache-dit&Date">
271
+ <picture align='center'>
272
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=vipshop/cache-dit&type=Date&theme=dark" />
273
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=vipshop/cache-dit&type=Date" />
274
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=vipshop/cache-dit&type=Date" width=400px />
275
+ </picture>
276
+ </a>
277
+
278
+ </div>
279
+
280
+ ## 🎉Projects Using CacheDiT
281
+
282
+ Here is a curated list of open-source projects integrating **CacheDiT**, including popular repositories like [jetson-containers](https://github.com/dusty-nv/jetson-containers/blob/master/packages/diffusion/cache_edit/build.sh) ![](https://img.shields.io/github/stars/dusty-nv/jetson-containers.svg), [flux-fast](https://github.com/huggingface/flux-fast) ![](https://img.shields.io/github/stars/huggingface/flux-fast.svg), and [sdnext](https://github.com/vladmandic/sdnext/discussions/4269) ![](https://img.shields.io/github/stars/vladmandic/sdnext.svg). 🎉**CacheDiT** has been **recommended** by: [Wan2.2](https://github.com/Wan-Video/Wan2.2) ![](https://img.shields.io/github/stars/Wan-Video/Wan2.2.svg), [Qwen-Image-Lightning](https://github.com/ModelTC/Qwen-Image-Lightning) ![](https://img.shields.io/github/stars/ModelTC/Qwen-Image-Lightning.svg), [Qwen-Image](https://github.com/QwenLM/Qwen-Image) ![](https://img.shields.io/github/stars/QwenLM/Qwen-Image.svg), [LongCat-Video](https://github.com/meituan-longcat/LongCat-Video) ![](https://img.shields.io/github/stars/meituan-longcat/LongCat-Video.svg), [Kandinsky-5](https://github.com/ai-forever/Kandinsky-5) ![](https://img.shields.io/github/stars/ai-forever/Kandinsky-5.svg), <a href="https://huggingface.co/docs/diffusers/main/en/optimization/cache_dit"><img src="https://img.shields.io/badge/🤗Diffusers-ecosystem-yellow.svg"></a> ![](https://img.shields.io/github/stars/huggingface/diffusers.svg), [<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>](https://hellogithub.com/repository/vipshop/cache-dit) ![](https://img.shields.io/github/stars/521xueweihan/HelloGitHub.svg), among others.
283
+
284
+
285
+ ## ©️Acknowledgements
286
+
287
+ Special thanks to vipshop's Computer Vision AI Team for supporting document, testing and production-level deployment of this project.
288
+
289
+ ## ©️Citations
290
+
291
+ <div id="citations"></div>
292
+
293
+ ```BibTeX
294
+ @misc{cache-dit@2025,
295
+ title={cache-dit: A Unified and Flexible Inference Engine with Hybrid Cache Acceleration and Parallelism for Diffusers.},
296
+ url={https://github.com/vipshop/cache-dit.git},
297
+ note={Open-source software available at https://github.com/vipshop/cache-dit.git},
298
+ author={DefTruth, vipshop.com},
299
+ year={2025}
300
+ }
301
+ ```
@@ -0,0 +1,102 @@
1
+ cache_dit/__init__.py,sha256=o2p2odulRXB24ZZb4zE0Rn1O085lRu59sO7BEVCPOOs,2025
2
+ cache_dit/_version.py,sha256=6M51k-eDUkvbg1O0UDaNPjBRHmqrs5f127zkdrldxjg,706
3
+ cache_dit/logger.py,sha256=0zsu42hN-3-rgGC_C29ms1IvVpV4_b4_SwJCKSenxBE,4304
4
+ cache_dit/summary.py,sha256=ZSmmpEEV_yKT6d86rqEIwaQNni1WgOEVdbg1o88-7lI,22159
5
+ cache_dit/utils.py,sha256=FeprLDwxnlWWMqBS5ZKRgqJrORkCn64oTqRVNjHYLJM,1846
6
+ cache_dit/caching/.gitignore,sha256=5Cb-qT9wsTUoMJ7vACDF7ZcLpAXhi5v-xdcWSRit988,23
7
+ cache_dit/caching/__init__.py,sha256=47Im7unxC6gB2vFjFgbY-qHuJ-GOPKT6nU3ZkTGUA74,1747
8
+ cache_dit/caching/cache_interface.py,sha256=OWMv6K8jpSFNc9kjdEim_XdFTn0x5ygUKfM-S_pOtZ8,18058
9
+ cache_dit/caching/cache_types.py,sha256=QnWfaS52UOXQtnoCUOwwz4ziY0dyBta6vQ6hvgtdV44,1404
10
+ cache_dit/caching/forward_pattern.py,sha256=DAnldDC-B_FOMK8REtX2hx8mLZ9GLe1UWYfkxzyyMgo,2197
11
+ cache_dit/caching/params_modifier.py,sha256=4GDKkZmol53j9ICZnbbkuTSAjO2p63KFH3hTE_fahBM,3588
12
+ cache_dit/caching/utils.py,sha256=0K2DSvbhLJgajI9tHtwjaYH_YKAUWK8PY74wPiLRC_s,2473
13
+ cache_dit/caching/block_adapters/__init__.py,sha256=duiVXQB8vasnC15PdGc9yTYQvi-NOjmb3MstmjpbX50,22254
14
+ cache_dit/caching/block_adapters/block_adapters.py,sha256=H5BuIm5_1Cy2aHjSu56WQhrB2VozUfeARiWdMpxBHSk,25267
15
+ cache_dit/caching/block_adapters/block_registers.py,sha256=L-PYmh2jz-D8b-rBznm2lC0k6u9Tpo6u68lXJXM86Cw,3821
16
+ cache_dit/caching/cache_adapters/__init__.py,sha256=IRO0IigSRxxwLccCBNLCJuQMtZDZo9WUikFAtn8LUFE,73
17
+ cache_dit/caching/cache_adapters/cache_adapter.py,sha256=1xeFMybrlSQycw_Slq9rZ2RcwJXkqDvvPp3DpST44Wg,25654
18
+ cache_dit/caching/cache_blocks/__init__.py,sha256=FKKGZ_jfFadet4k9jXejCqp1dhS7sIHBGfyWBtlPeXU,9924
19
+ cache_dit/caching/cache_blocks/offload_utils.py,sha256=wusgcqaCrwEjvv7Guy-6VXhNOgPPUrBV2sSVuRmGuvo,3513
20
+ cache_dit/caching/cache_blocks/pattern_0_1_2.py,sha256=bzSVkxFa2uvtNU47GC-poWR6l74i597hIhXjX9u6AGU,654
21
+ cache_dit/caching/cache_blocks/pattern_3_4_5.py,sha256=g-4WStwVJIRF4gj_71UX6Zt0UqHKv42K-Zf4f8cw6Pc,19767
22
+ cache_dit/caching/cache_blocks/pattern_base.py,sha256=ZaLeyFZDTE1qyV-n6bZNLV50-KPxMNxbEYjhAl7VuTQ,27832
23
+ cache_dit/caching/cache_blocks/pattern_utils.py,sha256=AEuWRQxbR2p6yIUwblAT_kQokqIBgbCEjnJXjyT6YMA,3106
24
+ cache_dit/caching/cache_contexts/__init__.py,sha256=OOiCta6yCWr7NIwj45_ERY8SFdDS_m4usubHM4Pgq8A,805
25
+ cache_dit/caching/cache_contexts/cache_config.py,sha256=7lKrCg6v9scWTV59kulfIYuJkdHYTRw9jhiBlfLdN9w,5947
26
+ cache_dit/caching/cache_contexts/cache_context.py,sha256=kHLAyWK9-jC8Up_y6fgcdJR_NU92L6QQ3oeBs8I8Cu4,11406
27
+ cache_dit/caching/cache_contexts/cache_manager.py,sha256=L7hQbyEqf5TZMJ9aCP81NxDlNHs4ASf8XEZ-09DcVH4,35386
28
+ cache_dit/caching/cache_contexts/context_manager.py,sha256=7Q3D5eQperAWaEuVrlwkCMDSCjqdgzSOtSta1aJ0ZYM,1059
29
+ cache_dit/caching/cache_contexts/prune_config.py,sha256=OdMEs_nBO3SDq8vC4JcF4LyINws2QWxFZOkh9N53ScQ,3204
30
+ cache_dit/caching/cache_contexts/prune_context.py,sha256=HlPARnwrRQmkgdcsAYSm7_nhe8X7-dQYrIxbyVW64x0,6341
31
+ cache_dit/caching/cache_contexts/prune_manager.py,sha256=KOn6h2IJmM5GUMUzCNjM6xgmaABzQ_zIV-BuAxL0bBM,6111
32
+ cache_dit/caching/cache_contexts/calibrators/__init__.py,sha256=Kgyy93ftAaJp-GJ1XtJqQ9AaN8rlaMCHcFLwDeKZhtI,6251
33
+ cache_dit/caching/cache_contexts/calibrators/base.py,sha256=mn6ZBkChGpGwN5csrHTUGMoX6BBPvqHXSLbIExiW-EU,748
34
+ cache_dit/caching/cache_contexts/calibrators/foca.py,sha256=dh0LsV_y9RkDxmcL_VaUYTEylkzSuqlBHKUKnSxTGZU,885
35
+ cache_dit/caching/cache_contexts/calibrators/taylorseer.py,sha256=lN2y_baGCG-aRed_xTVjybrOyCH4YivKpQbxQUMHT24,6003
36
+ cache_dit/caching/patch_functors/__init__.py,sha256=mP81SWtlqUGjLMLXIpAN7_R0GW_RZBVv_Rr01IB0v7k,610
37
+ cache_dit/caching/patch_functors/functor_base.py,sha256=Ahk0fTfrHgNdEl-9JSkACvfyyv9G-Ei5OSz7XBIlX5o,357
38
+ cache_dit/caching/patch_functors/functor_chroma.py,sha256=BNhFkSQe8PCZ6aK68xQYcosIeDByxxRF-e5ZE7NZXHg,13424
39
+ cache_dit/caching/patch_functors/functor_dit.py,sha256=wbo8cQZbgtLFAHHFZb5bXMQ572jr9UK7VmVl-MsG_wM,3898
40
+ cache_dit/caching/patch_functors/functor_flux.py,sha256=xyPY2FJ1wy1UJfgX_MVBCJvmH2hydNjHbeyRFr2N39Y,9553
41
+ cache_dit/caching/patch_functors/functor_hidream.py,sha256=OO3_cVTGbG1VKnCHU-nu9k6VMpQKa-oQWVghT64FuyM,15303
42
+ cache_dit/caching/patch_functors/functor_hunyuan_dit.py,sha256=mrSpxbdUY7RY_EEH4X22RGHI00BeTUFOL_-G33vTyBA,6395
43
+ cache_dit/caching/patch_functors/functor_qwen_image_controlnet.py,sha256=FxPcD_fCdJ-9AFn2EMbI32oi61r6Y-3A4W_U-TbCTLA,10513
44
+ cache_dit/compile/__init__.py,sha256=FcTVzCeyypl-mxlc59_ehHL3lBNiDAFsXuRoJ-5Cfi0,56
45
+ cache_dit/compile/utils.py,sha256=nN2OIrSdwRR5zGxJinKDqb07pXpvTNTF3g_OgLkeeBU,3858
46
+ cache_dit/kernels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ cache_dit/kernels/triton_taylorseer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ cache_dit/metrics/__init__.py,sha256=Y_JrBr9XE6NKXwyXc7d_-PaX9c_rk5FKms-IYgCyHmY,936
49
+ cache_dit/metrics/clip_score.py,sha256=ERNCFQFJKzJdbIX9OAg-1LiSPuXUVHLOFxbf2gcENpc,3938
50
+ cache_dit/metrics/config.py,sha256=ieOgD9ayz722RjVzk24bSIqS2D6o7TZjGk8KeXV-OLQ,551
51
+ cache_dit/metrics/fid.py,sha256=ZM_FM0XERtpnkMUfphmw2aOdljrh1uba-pnYItu0q6M,18219
52
+ cache_dit/metrics/image_reward.py,sha256=N8HalJo1T1js0dsNb2V1KRv4kIdcm3nhx7iOXJuqcns,5421
53
+ cache_dit/metrics/inception.py,sha256=pBVe2X6ylLPIXTG4-GWDM9DWnCviMJbJ45R3ulhktR0,12759
54
+ cache_dit/metrics/lpips.py,sha256=hrHrmdM-f2B4TKDs0xLqJO5JFaYcCjq2qNIR8oCrVkc,811
55
+ cache_dit/metrics/metrics.py,sha256=AZbQyoavE-djvyRUZ_EfCIrWSQbiWQFo7n2dhn7XptE,40466
56
+ cache_dit/parallelism/__init__.py,sha256=dheBG5_TZCuwctviMslpAEgB-B3N8F816bE51qsw_fU,210
57
+ cache_dit/parallelism/parallel_backend.py,sha256=XFmv8GmAKfadJQomUbAgox9aJQxmNxdlPhVE6nJBn0s,939
58
+ cache_dit/parallelism/parallel_config.py,sha256=kgpysG1lKCJ6Wd3llQFSmiY_Hdorv2wTfm2Xcj6qec0,3738
59
+ cache_dit/parallelism/parallel_interface.py,sha256=2OtZiXmpQbSchzH_MKUwMr1iDB3gj1sklQJGA_Kc04I,2664
60
+ cache_dit/parallelism/backends/native_diffusers/__init__.py,sha256=rpYu52_ATmsBpztWSzpwpYvhsQ0ABJe-KyP4UyawgZ8,237
61
+ cache_dit/parallelism/backends/native_diffusers/parallel_difffusers.py,sha256=CY53v3lc36o8HXdc42xc5c0wsKdpDiswNDM3kLAuW-0,1607
62
+ cache_dit/parallelism/backends/native_diffusers/utils.py,sha256=VAqtv9b8PTvcoYzD_CbvtRgdg9_VbtBug_5L38PADl0,266
63
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/__init__.py,sha256=oOCVeisY7K8JPw5JaGmqhoZZslFDAsYC5oNgbTmt1vU,6228
64
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_chroma.py,sha256=r1LbdyI26sY1Ig5sX24qtUNdk5NfX-DLP0Po2_cCR78,3899
65
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cogvideox.py,sha256=QKS0xN62N7mTlJIutuOoiuYW9vkjmwrjZM8quPbaDKw,7812
66
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cogview.py,sha256=fsifJF1Nlh96YVVYk9qa4q7xvno3gqWncpZkrMmCQZY,12403
67
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_cosisid.py,sha256=ry0zmbbVFiu_sBXXGp4XCO9rzZTxJ9dORFVqXIfLUR8,5248
68
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_dit.py,sha256=jrrSciQUYP4T4bc7BuXVt6ha1VJC-L3jrcNywVHIRng,3346
69
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_flux.py,sha256=yaGCqywRGjd_UL8FtwnEbX3NmM7z2XPhMeo3TNfI7mA,3690
70
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_hunyuan.py,sha256=2VcObE9F25tF9NJNTudcQX8nYediF3CvF2GYE85Lm60,28628
71
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_ltxvideo.py,sha256=tzIx3MOMGuO2hVIhaM_z6IXRdYABX4sjfqd5slhRCVc,10470
72
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_nunchaku.py,sha256=VvE4tzKqLU5h4CxyFT1NG2xamcDy11iQQS_NsbYrEbA,16712
73
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_pixart.py,sha256=vftDDzQ62PXCl3cji8uFV9OpQSfX0aP7X0QlNW1mJzM,10872
74
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_qwen_image.py,sha256=XbNE40TMC_RptsXJXIGEWTPTlccQPG5z0oLGWhQKlYE,4314
75
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_registers.py,sha256=W3Uh71YMxwqUqJZp8wrDN_E1Xcxi5UNRKJefPjFm15g,2713
76
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_plan_wan.py,sha256=DZlt3r04KfCpFy43JXO2OTDNqsgHW282mgBh5ViL6yc,3977
77
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/cp_planners.py,sha256=_dTHUdlhVunZOwidDN5zqHtrwLxv6ykZW9TApMTcaqA,5206
78
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/attention/__init__.py,sha256=6jIdEQGxC3I97MjLmxkXr3bp6QhzGQ7nId-PzA9ffbg,246
79
+ cache_dit/parallelism/backends/native_diffusers/context_parallelism/attention/_attention_dispatch.py,sha256=a6_9PDfBfhQo3fkRpB7y6vDK1vHAmkHTrX3Z0WZ29og,10411
80
+ cache_dit/parallelism/backends/native_pytorch/__init__.py,sha256=EAzdGEP47-y9w6uyPisvDjCF3TE03ZCdhalAY89p-ZA,226
81
+ cache_dit/parallelism/backends/native_pytorch/parallel_torch.py,sha256=1A-Gdv6JRueZNpwJdrVxRT7TBxwo2Bn-CwMbnlhJx0M,2047
82
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/__init__.py,sha256=M-nEf6a22UeoIjZEhIajpUpGSQzWiNn_zmWiBNU70Fs,1662
83
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_flux.py,sha256=yiZeyFigd3kpHLMGQ6tt3iK9CU6gHaLm3MiVZWEb4_0,6549
84
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_kandinsky5.py,sha256=MwNzjj8nyxOzqdmyhAaeslFM5iVHBY0I2Jd9W4TjTjs,2702
85
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_qwen_image.py,sha256=AcRCfML0bwGeVY0gnVfMQtW9GAWc5wO4ZhxWGNDCkKc,2644
86
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_registers.py,sha256=ERgUE6RnweM7BGp9aO4jywAyMrS8KHrL1mTL7XReMkw,2099
87
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_plan_wan.py,sha256=j8w5gZn3MhSsacxOVguss85GSI6bdLL61FMySDZKwJc,5191
88
+ cache_dit/parallelism/backends/native_pytorch/tensor_parallelism/tp_planners.py,sha256=GbhB7-21DiNF786oGw-AeGBUISkjzEgp82Mztjkl6J0,571
89
+ cache_dit/quantize/__init__.py,sha256=rUu0V9VRjOgwXuIUHHAI-osivNjAdUsi-jpkDbFp6Gk,278
90
+ cache_dit/quantize/quantize_backend.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
+ cache_dit/quantize/quantize_config.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
+ cache_dit/quantize/quantize_interface.py,sha256=dKLrLF-FDdRLQq-3CnaRzkAh70P4oObJE3-qWF7goM0,882
93
+ cache_dit/quantize/backends/__init__.py,sha256=SL9EupOwBRzRcHZBI1ABqdHjCS9vEpFZXjA9R5ikTk8,33
94
+ cache_dit/quantize/backends/bitsandbytes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
+ cache_dit/quantize/backends/torchao/__init__.py,sha256=NK1widhJeKSx8ICCcyYZAWGUpGc2uKF5O7pLIcSCUDI,37
96
+ cache_dit/quantize/backends/torchao/quantize_ao.py,sha256=-a99fEp5xjEXpIgD4Hu1lBVk7bBl2XN1tsWhGlK2cN4,6718
97
+ cache_dit-1.0.14.dist-info/licenses/LICENSE,sha256=6LIQc3N_o1SeNXCONTZUJPO4bFIYccq-E4Qp8Dti5CQ,11438
98
+ cache_dit-1.0.14.dist-info/METADATA,sha256=Rhfwk2kYNDQuXKS9VnE_rgClkf1qwmP62ERGK1HqwkI,31359
99
+ cache_dit-1.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ cache_dit-1.0.14.dist-info/entry_points.txt,sha256=FX2gysXaZx6NeK1iCLMcIdP8Q4_qikkIHtEmi3oWn8o,65
101
+ cache_dit-1.0.14.dist-info/top_level.txt,sha256=ZJDydonLEhujzz0FOkVbO-BqfzO9d_VqRHmZU-3MOZo,10
102
+ cache_dit-1.0.14.dist-info/RECORD,,