Spava: Accelerating Long-Video Understanding via Sequence-Parallelism-aware Approximate Attention
Yuxiang Huang, Mingye Li, Xu Han, Chaojun Xiao, Weilin Zhao, Ao Sun, Ziqi Yuan, Hao Zhou, Fandong Meng, Zhiyuan Liu
TL;DR
Spava tackles the efficiency challenge of long-video inference in large multimodal models by introducing a sequence-parallelism-aware approximate attention framework that distributes computation and communication across multiple GPUs. It combines frame-level parallelism, context splitting with a ZigZag virtual-host scheme, and local KV compression via passing blocks to maintain long-range dependencies without embedding compression. System-level optimizations—visual load balancing, fused forward passes, load-balanced approximate attention, and overlapped communication—drive large speedups while preserving task performance, achieving up to 12.72x speedups over strong baselines and near-lossless accuracy on several models and benchmarks. The approach demonstrates practical impact for scalable long-video understanding in real-world settings, enabling longer and more complex videos to be processed efficiently on multi-GPU clusters.
Abstract
The efficiency of long-video inference remains a critical bottleneck, mainly due to the dense computation in the prefill stage of Large Multimodal Models (LMMs). Existing methods either compress visual embeddings or apply sparse attention on a single GPU, yielding limited acceleration or degraded performance and restricting LMMs from handling longer, more complex videos. To overcome these issues, we propose Spava, a sequence-parallel framework with optimized attention that accelerates long-video inference across multiple GPUs. By distributing approximate attention, Spava reduces computation and increases parallelism, enabling efficient processing of more visual embeddings without compression and thereby improving task performance. System-level optimizations, such as load balancing and fused forward passes, further unleash the potential of Spava, delivering speedups of 12.72x, 1.70x, and 1.18x over FlashAttn, ZigZagRing, and APB, without notable performance loss. Code available at https://github.com/thunlp/APB
