CLiS: Plug-and-Play Attention Acceleration for Video Diffusion on TPUs via Certified Stabilization
Organizations: Google
Abstract
High-resolution video diffusion relies on attention over long token sequences, making attention efficiency critical to generation latency. Our analysis identifies repeated maximum reductions and accumulator rescaling in online softmax as a bottleneck in long-context TPU attention. We propose CLiS (Certified Loop-invariant Stabilization), a training-free, plug-and-play optimization for video diffusion inference. CLiS fixes per-row stabilizers before the KV loop and certifies numerical safety per head, falling back to online softmax when certification fails. It integrates into existing fused-attention kernels without changing model weights or architecture. On Wan 2.2 and LTX-2 across TPU v6e and TPU7x, CLiS reduces diffusion transformer (DiT) step latency by up to 19.6% relative to tuned online softmax without measurable quality loss. Controlled TPU adaptations of prior GPU stabilization methods show performance or numerical-safety limitations. Preliminary causal LLM experiments also show up to 13.5% higher training throughput in continued pretraining and 7.7% in supervised fine-tuning.
Figures & tables
| 1 | \bar{k}\leftarrow N_{k}^{-1}\sum_{r=1}^{N_{k}}{\color[rgb]{0,0.4453,0.6992}k_{r}} . |
|---|---|
| 2 | . |
| 3 | a conservative upper bound on \max_{r}\|{\color[rgb]{0,0.4453,0.6992}\widetilde{k}_{r}}\|_{2} . |
| 4 | B_{h}\leftarrow\max_{1\leq r\leq N_{q}}\textsc{BoundUp}({\color[rgb]{0.9023,0.625,0}q_{r}},\kappa) . |
| 5 | G\leftarrow\lceil\log_{2}\max(1,\max_{j,r}|{\color[rgb]{0,0.4453,0.6992}V_{jr}}|)\rceil . |
| 6 | . |
| 7 | . |
| Certification | Attention output | VBench vs. online ( ) | |||||||
| Method | Valid | Safe-cond. rate | Max abs. | Rel. | Imaging | Subject cons. | Temp. flicker | Motion smooth. | Dynamic degree |
| Online softmax | 10/10 | – | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| VFA-style | 1/10 | 40.1 | – | – | – | – | – | ||
| FD++-style | 10/10 | 91.0 | |||||||
| FA4-style (tile) | 10/10 | – | 0 | ||||||
| CLiS | 10/10 | 97.9–98.3 | 0 | ||||||
| Model (Dataset) | Task | Seq. | Fwd. Attn. | Train Speedup | Loss (Base / CLiS) | Loss | Cert. |
|---|---|---|---|---|---|---|---|
| Qwen3-8B (C4) | Pretrain | 8K | 3.182 / 3.185 | 100% | |||
| Qwen3-8B (ClimbMix) | Pretrain | 8K | 2.678 / 2.673 | 100% | |||
| Qwen3-8B (UltraChat) | SFT | 8K | 0.807 / 0.806 | 95.8% | |||
| Qwen3-8B (PG-19) | Continual PT | 256K | 2.182 / 2.182 | 95.5% | |||
| Llama-3.1-8B (UltraChat) | SFT | 8K | 0.752 / 0.752 | 100% | |||
| Llama-3.1-8B (PG-19) | Continual PT | 128K | 1.992 / 1.992 | 99.8% |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Dimension | Online softmax | VFA-style | FD++-style | FA4-style (tile) | FA4-style (row) | CLiS |
|---|---|---|---|---|---|---|
| Imaging quality | 0.6658 | – † | 0.6668 | 0.6690 | 0.6672 | 0.6768 |
| Subject consistency | 0.9237 | – † | 0.9231 | 0.9250 | 0.9224 | 0.9252 |
| Temporal flickering | 0.9693 | – † | 0.9705 | 0.9692 | 0.9710 | 0.9697 |
| Motion smoothness | 0.9454 | – † | 0.9453 | 0.9465 | 0.9452 | 0.9456 |
| Dynamic degree | 1.0000 | – † | 0.9000 | 1.0000 | 0.9000 | 1.0000 |
| Aesthetic quality | 0.6226 | – † | 0.6240 | 0.6223 | 0.6216 | 0.6287 |
| Dimension | FD++-style | FA4-style (tile) | FA4-style (row) | CLiS | |
|---|---|---|---|---|---|
| Imaging quality | [ , ] | [ , ] | [ , ] | [ , ] | 10 |
| Subject consistency | [ , ] | [ , ] | [ , ] | [ , ] | 10 |
| Temporal flickering | [ , ] | [ , ] | [ , ] | [ , ] | 10 |
| Motion smoothness | [ , ] | [ , ] | [ , ] | [ , ] | 10 |
| Dynamic degree | [ , ] | [ , ] | [ , ] | [ , ] | 10 |
| Parallelism | CP=1, DP=8 | Ulysses=8, Ring=1 | Ulysses=4, Ring=2 | Ulysses=2, Ring=4 | Ulysses=1, Ring=8 |
|---|---|---|---|---|---|
| Kernel family | Splash | Splash + A2A | 2D Ring | 2D Ring | Pure Ring |
| Local shard | |||||
| Attention Kernel Microbenchmark (ms) | |||||
| Online softmax | 185.85 | 31.62 | 32.95 | 28.26 | 27.67 |
| CLiS | 173.32 | 29.54 | 29.74 | 25.06 | 24.66 |
| Latency change | |||||
| Frames | Tokens | Online | FD++ | VFA | FA4 tile | FA4 row | CLiS |
|---|---|---|---|---|---|---|---|
| Wan 2.2, TPU v6e, 480p | |||||||
| 41 | 17,160 | 4.089 | 4.809 | 6.931 † | 7.624 | 4.086 | 3.344 |
| 81 | 32,760 | 14.156 | 18.320 | 12.926 † | 21.098 | 14.152 | 11.012 |
| 121 | 48,360 | 30.666 | 37.374 | 26.123 † | 47.123 | 30.645 | 24.169 |
| 161 | 63,960 | 52.009 | 61.793 | 43.164 † | 64.258 | 52.045 | 40.841 |
| 201 | 79,560 | 80.151 | 97.233 | 64.993 | 97.864 | 80.280 | 61.110 |
| Frames | Tokens | Online | FD++ | VFA | FA4 tile | FA4 row | CLiS |
|---|---|---|---|---|---|---|---|
| Wan 2.2, TPU v6e, 480p | |||||||
| 41 | 17,160 | 0.606 | 0.635 | 0.768 † | 0.754 | 0.606 | 0.574 |
| 81 | 32,760 | 1.159 | 1.325 | 1.233 † | 1.445 | 1.159 | 1.039 |
| 121 | 48,360 | 2.055 | 2.306 | 1.873 † | 2.696 | 2.053 | 1.797 |
| 161 | 63,960 | 3.159 | 3.527 | 2.807 † | 3.643 | 3.160 | 2.719 |
| 201 | 79,560 | 4.550 | 5.203 | 3.935 | 5.254 | 4.555 | 3.799 |
Efficient Attention
Efficient attention reduces the compute, memory traffic, and cache costs of Transformer attention while preserving useful long-range interactions.
See all 146 papers