MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attention

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Li, Yucheng, Jiang, Huiqiang, Zhang, Chengruidong, Wu, Qianhui, Luo, Xufang, Ahn, Surin, Abdi, Amir H., Li, Dongsheng, Gao, Jianfeng, Yang, Yuqing, Qiu, Lili
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866913854376640512
author Li, Yucheng
Jiang, Huiqiang
Zhang, Chengruidong
Wu, Qianhui
Luo, Xufang
Ahn, Surin
Abdi, Amir H.
Li, Dongsheng
Gao, Jianfeng
Yang, Yuqing
Qiu, Lili
author_facet Li, Yucheng
Jiang, Huiqiang
Zhang, Chengruidong
Wu, Qianhui
Luo, Xufang
Ahn, Surin
Abdi, Amir H.
Li, Dongsheng
Gao, Jianfeng
Yang, Yuqing
Qiu, Lili
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2504_16083
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attention
Li, Yucheng
Jiang, Huiqiang
Zhang, Chengruidong
Wu, Qianhui
Luo, Xufang
Ahn, Surin
Abdi, Amir H.
Li, Dongsheng
Gao, Jianfeng
Yang, Yuqing
Qiu, Lili
Computer Vision and Pattern Recognition
Machine Learning
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.
title MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attention
topic Computer Vision and Pattern Recognition
Machine Learning
url https://arxiv.org/abs/2504.16083