File size: 6,802 Bytes
153dd42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<div align="center">

<div align="center">
  <img src="assets/FlowCache1.png" width="50%">
</div>

# Flow Caching for Autoregressive Video Generation

### ICLR 2026

**[Paper](https://openreview.net/forum?id=vko4DuhKbh)** | **[arXiv](https://arxiv.org/abs/2602.10825)** |

**The first caching framework specifically designed for autoregressive video generation**

Achieving **2.38× speedup on MAGI-1** and **6.7× on SkyReels-V2** with negligible quality degradation

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![PyTorch](https://img.shields.io/badge/PyTorch-2.0+-ee4c2c.svg)](https://pytorch.org/)

</div>

## 📋 Table of Contents

- [News](#news)
- [Overview](#overview)
- [Method](#method)
- [Main Results](#main-results)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Supported Models](#supported-models)
- [Todo](#todo)
- [Contact](#contact)
- [Citation](#citation)
- [Acknowledgments](#acknowledgments)

---

## 📰 News

- 📄 **2026.02.12**: Paper available on [arXiv](https://arxiv.org/abs/2602.10825)!
- 🚀 **2026.02.10**: Code release for [MAGI-1](https://github.com/SandAI-org/MAGI-1) and [SkyReels-V2](https://github.com/SkyworkAI/SkyReels-V2)!
- 🎉 **2026.01.26**: Paper accepted by ICLR 2026!

---

## 🌟 Overview

FlowCache is a caching framework designed specifically for **autoregressive video generation models**. Unlike traditional caching methods that treat all frames uniformly, FlowCache introduces a **chunkwise caching strategy** where each video chunk maintains independent caching policies, complemented by **importance-based KV cache compression** that maintains fixed memory bounds while preserving generation quality.

<div align="center">
  <img src="assets/visualization.jpg" alt="Overview" width="90%">
</div>

---

## 🔬 Method

### Key Findings

<div align="center">
  <img src="assets/key_findings.jpg" width="90%">
</div>

Our key insight: Different video chunks exhibit heterogeneous denoising states at identical timesteps, necessitating independent caching policies for optimal performance.


### Framework Overview

<div align="center">
  <img src="assets/method.jpg" width="90%">
</div>

FlowCache introduces three key innovations for training-free acceleration of autoregressive video generation:

- **Chunkwise Denoising Heterogeneity**: We identify and formalize that denoising progress varies significantly across video chunks—even at the same timestep—necessitating per-chunk caching decisions.

- **Chunkwise Adaptive Caching**: A novel design where each chunk independently decides whether to reuse or recompute based on its own similarity trajectory.

- **KV Cache Compression Tailored for Video**: We adapt importance–redundancy scoring to autoregressive video generation KV cache compression by introducing an efficient, equivalence-preserving similarity computation, thereby enhancing cache diversity without sacrificing efficiency.

These contributions collectively make FlowCache the first theoretically grounded, training-free caching framework for efficient autoregressive video generation.

For more details, please refer to the original paper.

---

## 📊 Main Results

### Quantitative Performance

#### MAGI-1 (4.5B model)

| Method | PFLOPs | Speedup | Latency (s) | VBench | LPIPS | SSIM | PSNR |
|:------|:------:|:------:|:----------:|:-----:|:-----:|:----:|:----:|
| Vanilla | 306 | **1.0×** | 2873 | 77.06% | - | - | - |
| TeaCache-slow | 294 | 1.12× | 2579 | 77.50% | 0.6211 | 0.2801 | 13.26 |
| TeaCache-fast | 225 | 1.44× | 1998 | 70.11% | 0.8160 | 0.1138 | 8.94 |
| **FlowCache-slow** | 161 | **1.86×** | 1546 | **78.96%** | 0.3160 | 0.6497 | 22.34 |
| **FlowCache-fast** | 140 | **2.38×** | 1209 | **77.93%** | 0.4311 | 0.5140 | 19.27 |

#### SkyReels-V2 (1.3B model)

| Method | PFLOPs | Speedup | Latency (s) | VBench | LPIPS | SSIM | PSNR |
|:------|:------:|:------:|:----------:|:-----:|:-----:|:----:|:----:|
| Vanilla | 113 | **1.0×** | 1540 | 83.84% | - | - | - |
| TeaCache-slow | 58 | 1.89× | 814 | 82.67% | 0.1472 | 0.7501 | 21.96 |
| TeaCache-fast | 49 | 2.2× | 686 | 80.06% | 0.3063 | 0.6121 | 18.39 |
| **FlowCache-slow** | 36 | **5.88×** | 262 | **83.12%** | 0.1225 | 0.7890 | 23.74 |
| **FlowCache-fast** | 28 | **6.7×** | 230 | **83.05%** | 0.1467 | 0.7635 | 22.95 |

---

### Visualization

<div align="center">
  <img src="assets/more_visualization1.jpg" width="90%">
  <img src="assets/more_visualization2.jpg" width="90%">
</div>

---

## 🛠️ Installation

### Prerequisites

- Python 3.8+
- CUDA 11.8+ (or 12.x)
- PyTorch 2.0+

### MAGI-1 Setup

```bash
cd FlowCache4MAGI-1
pip install -r requirements.txt
```

### SkyReels-V2 Setup

```bash
cd FlowCache4SkyReels-V2
pip install -r requirements.txt
```

---

## 🚀 Quick Start

### MAGI-1

```bash
cd FlowCache4MAGI-1

bash scripts/single_run/flowcache_t2v.sh
```

### SkyReels-V2

```bash
cd FlowCache4SkyReels-V2

bash run_flowcache_fast.sh
```

---

## 🎯 Supported Models

| Model | Type | Status |
|:------|:-----|:------:|
| **[MAGI-1](https://github.com/SandAI-org/MAGI-1)** | 4.5B-distill | ✅ |
| **[SkyReels-V2](https://github.com/SkyworkAI/SkyReels-V2)** | 1.3B | ✅ |

---

## 📝 Todo List

- [ ] Support more autoregressive video generation models (e.g., self-forcing, causal-forcing, etc.)
- [ ] Integrate other training-free acceleration methods (e.g., quantization, etc.)

---

## 📮 Contact

For questions and collaboration inquiries, please contact the co-first authors. The following are all **WeChat IDs**:

- Yuexiao Ma: `ma18640400169`
- Xuzhe Zheng: `zhengxuzhe_`
- Jing Xu: `a2665048215`

---

## 📚 Citation

If you find FlowCache useful for your research, please cite:

```bibtex
@misc{ma2026flowcachingautoregressivevideo,
      title={Flow caching for autoregressive video generation}, 
      author={Yuexiao Ma and Xuzhe Zheng and Jing Xu and Xiwei Xu and Feng Ling and Xiawu Zheng and Huafeng Kuang and Huixia Li and Xing Wang and Xuefeng Xiao and Fei Chao and Rongrong Ji},
      year={2026},
      eprint={2602.10825},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2602.10825}, 
}
```

---

## 🙏 Acknowledgments

We thank the authors of the following projects for their valuable contributions:

- [MAGI-1](https://github.com/SandAI-org/MAGI-1)
- [SkyReels-V2](https://github.com/SkyworkAI/SkyReels-V2)
- [TeaCache](https://github.com/ali-vilab/TeaCache)
- [R-KV](https://github.com/Zefan-Cai/R-KV)

---

<div align="center">

**⭐ If you find this project useful, please consider giving it a star! ⭐**

For questions and feedback, please open an issue on GitHub.

</div>