MMInference: Versnelling van Pre-filling voor Langcontext-VLM's via Modaal-Bewuste Permutatie Sparse Attention
MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attention
April 22, 2025
Auteurs: Yucheng Li, Huiqiang Jiang, Chengruidong Zhang, Qianhui Wu, Xufang Luo, Surin Ahn, Amir H. Abdi, Dongsheng Li, Jianfeng Gao, Yuqing Yang, Lili Qiu
cs.AI
Samenvatting
De integratie van lange-contextmogelijkheden met visueel begrip ontsluit ongekend potentieel voor Vision Language Models (VLMs). De kwadratische aandachtcomplexiteit tijdens de pre-filling fase blijft echter een aanzienlijk obstakel voor implementatie in de praktijk. Om deze beperking te overwinnen, introduceren we MMInference (Multimodality Million tokens Inference), een dynamische sparse aandachtmethode die de pre-filling fase versnelt voor lange-context multimodale inputs. Ten eerste toont onze analyse aan dat de temporele en ruimtelijke lokaliteit van video-input leidt tot een uniek sparse patroon, het Grid-patroon. Tegelijkertijd vertonen VLMs aanzienlijk verschillende sparse distributies over verschillende modaliteiten. We introduceren een op permutatie gebaseerde methode om het unieke Grid-patroon te benutten en problemen bij modaliteitsgrenzen aan te pakken. Door offline te zoeken naar de optimale sparse patronen voor elke head, construeert MMInference de sparse distributie dynamisch op basis van de input. We bieden ook geoptimaliseerde GPU-kernels voor efficiënte sparse berekeningen. Opmerkelijk is dat MMInference naadloos integreert in bestaande VLM-pipelines zonder modelaanpassingen of fine-tuning. Experimenten op multimodale benchmarks – inclusief Video QA, Captioning, VisionNIAH en Mixed-Modality NIAH – met state-of-the-art lange-context VLMs (LongVila, LlavaVideo, VideoChat-Flash, Qwen2.5-VL) tonen aan dat MMInference de pre-filling fase versnelt tot wel 8,3x bij 1M tokens, terwijl de nauwkeurigheid behouden blijft. Onze code is beschikbaar op https://aka.ms/MMInference.
English
The integration of long-context capabilities with visual understanding
unlocks unprecedented potential for Vision Language Models (VLMs). However, the
quadratic attention complexity during the pre-filling phase remains a
significant obstacle to real-world deployment. To overcome this limitation, we
introduce MMInference (Multimodality Million tokens Inference), a dynamic
sparse attention method that accelerates the prefilling stage for long-context
multi-modal inputs. First, our analysis reveals that the temporal and spatial
locality of video input leads to a unique sparse pattern, the Grid pattern.
Simultaneously, VLMs exhibit markedly different sparse distributions across
different modalities. We introduce a permutation-based method to leverage the
unique Grid pattern and handle modality boundary issues. By offline search the
optimal sparse patterns for each head, MMInference constructs the sparse
distribution dynamically based on the input. We also provide optimized GPU
kernels for efficient sparse computations. Notably, MMInference integrates
seamlessly into existing VLM pipelines without any model modifications or
fine-tuning. Experiments on multi-modal benchmarks-including Video QA,
Captioning, VisionNIAH, and Mixed-Modality NIAH-with state-of-the-art
long-context VLMs (LongVila, LlavaVideo, VideoChat-Flash, Qwen2.5-VL) show that
MMInference accelerates the pre-filling stage by up to 8.3x at 1M tokens while
maintaining accuracy. Our code is available at https://aka.ms/MMInference.Summary
AI-Generated Summary