arXiv:2611.00444cs.LGOct 2026

Manuscript Offprint

arXiv:2611.00444

CLiS: Plug-and-Play Attention Acceleration for Video Diffusion on TPUs via Certified Stabilization

Elisa Tsai, Shao-yu Huang, Daniel Mandragona, Wei-Yu Lin, WenXin Dong, Jevin Jiang, Chandra Devarakonda, Mehdy Bohlool, Yixin Shi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Elisa Tsai 1∗†^{1*\dagger} Shao-yu Huang 1∗^{1*} Daniel Mandragona 1^{1} Wei-Yu Lin 1^{1} WenXin Dong 1^{1} Jevin Jiang 1^{1} Chandra Devarakonda 1^{1} Mehdy Bohlool 1^{1} Yixin Shi 1^{1}

1^{1}Google *Equal contribution †Corresponding author

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.

{elisatsai, shyhuang, dandragona, weiyulin, wenxindong, jevinjiang, chandrasekhard, mehdy, yxshi}@google.com

Figure

Online softmax (End-to-End Time: 335.7s on TPU v6e)

CLiS (ours) (End-to-End Time: 277.7s on TPU v6e)

Figure 1. CLiS accelerates long-sequence video diffusion attention without visually altering generation quality. Left: speedup on TPU v6e. Right: frames 0, 20, 40, 60, 80, 100 from a 720p, 7.5s (16fps, 40-step) video generated by WAN 2.2 (Team Wan, 2025).

1 INTRODUCTION

Video Diffusion Transformers (DiTs) repeatedly apply self-attention over spatiotemporal tokens during generation (Peebles & Xie, 2023; Team Wan, 2025; Kong et al., 2024; Ha-Cohen et al., 2024; Brooks et al., 2024; Google DeepMind, 2025). As resolution and duration increase, these sequences become extremely long: a five-second 720p video can require approximately 75K–120K tokens (Team Wan, 2025; Kong et al., 2024). Attention efficiency is therefore a major determinant of generation latency. FLOP counts, however, can obscure an emerging hardware bottleneck. Although matmuls dominate attention FLOPs, softmax can rival them in cycle cost because exponential throughput is far lower (Figure 2) and has scaled more slowly (Shah et al., 2024).

Motivation. This matmul-non-matmul throughput im-

balance, previously studied on GPUs (Shah et al., 2024; Zadouri et al., 2026), also arises on TPUs. Schedules from the TPU compiler's low-level optimizer (LLO), which emits the final VLIW instruction bundles (Jouppi et al., 2021), show that exponentiation alone rivals the matmuls in modeled cycle cost, while maximum reduction and accumulator rescaling push the full softmax cost beyond them. TPU architecture adds another constraint: within each KV iteration, online-softmax state competes with score and probability tiles for a limited set of shared vector registers. Because this maximum-and-rescaling chain is re-executed for every KV block, its total cost grows with sequence length, and runtime ablations confirm that it remains on the critical path (Section 3).

Challenges. Softmax subtracts a per-row stabilizer from the

Figure

Figure 2. (1) Each unit's modeled share of cycles per attention score (work divided by peak throughput). At d=128d=128 (dotted line, used by Wan 2.2 and LTX-2), exponentiation alone matches the matmuls. On TPU7x, vector-unit max reduction and rescaling push softmax past them. (2) Exposed softmax in the compiled VLIW bundle schedule for Wan 2.2 DiT self-attention (one KV-block iteration) on TPU7x.

logits to keep exponentials in floating-point range. In exact arithmetic, any choice gives the same result. Online softmax uses the largest logit seen so far, so every KV block that raises it forces a rescale of the accumulated sums. A loop-invariant stabilizer, fixed before the KV loop, removes both the per-block maximum reduction and the rescaling. Prior GPU work moves partway toward this: FlashDecoding++ fixes a shared shift but recomputes rows that violate it (Hong et al., 2024), VFA freezes an approximate maximum without a safety guarantee (Sun et al., 2026), and FlashAttention-4 rescales only past a threshold but still computes every block's maximum (Zadouri et al., 2026). Yet if a fixed stabilizer sits too far below a row's maximum, exponentials overflow, and if it sits too far above, they underflow to zero (Figure 3). Computing the exact maximum in advance avoids both but costs an extra pass over all attention scores. The challenge is therefore to certify a safe loop-invariant stabilizer at negligible cost.

Our Method. We introduce CLiS (Certified Loop-invariant Stabilization), a training-free, plug-and-play optimization for existing video diffusion models. It replaces online softmax's running maximum with a loop-invariant per-row stabilizer whenever numerical safety can be certified. Using inexpensive query and key statistics, CLiS derives an upper bound on each row's attention logits before the key-block loop. Certified heads skip maximum reduction and accumulator rescaling on every KV block, while uncertified heads fall back to standard online softmax. By changing only attention stabilization, CLiS integrates into existing fused-attention kernels without additional training or changes to model weights or architecture. It preserves standard attention in exact arithmetic.

Results. We evaluate CLiS on Wan 2.2 and LTX-2 using TPU v6e and TPU7x, varying video resolution and duration over attention lengths from 17K to 184K tokens. Relative to tuned online softmax, CLiS reduces attention-kernel latency by up to 24.0% and DiT-step latency by up to 19.6%, without measurable degradation in generation quality. TPU adaptations of prior GPU methods either fail to deliver speedups or produce invalid outputs. A preliminary exploration of causal LLM training also finds up to 13.5% higher training throughput in continued pretraining and 7.7% in supervised fine-tuning (Section 5.5), suggesting potential applicability beyond diffusion attention.

References (49)