Ad

MInference: Sparse Attention for Long Context LLMs

MInference accelerates long-context LLM inference by dynamically approximating sparse attention patterns, achieving up to 10x speedup on A100 while maintaining accuracy.
Screenshot of microsoft/MInference homepage

MInference speeds up long-context LLM inference by approximating and dynamically calculating sparse attention. The project addresses the bottleneck of slow inference latency when processing long sequences in large language models. It achieves this by analyzing long-context LLMs' attention patterns offline and computing optimal sparse kernels online, resulting in significant speed improvements without sacrificing accuracy. The primary technology involves dynamic sparse attention mechanisms.

MInference stands out by its ability to achieve substantial speedups (up to 10x) on Nvidia A100 GPUs for long-context LLMs. It supports a wide range of popular LLMs including LLaMA-3 and GLM-4. The project's dynamic sparse attention approach is adaptable to various long-context paradigms like pre-filling, KV cache management, and retrieval, making it a versatile solution. Deep integration with existing projects like vLLM further enhances its applicability.

  • Pre-filling Acceleration: Reduces inference latency for long-context LLMs by up to 10x.
  • Dynamic Sparse Attention: Approximates attention patterns offline and computes kernels online for efficiency.
  • Broad Model Support: Compatible with a wide range of popular LLMs including LLaMA-3, GLM-4, and Phi models.
  • Versatile Use Cases: Applicable to pre-filling, KV cache compression, retrieval, and loading scenarios.
  • Easy Integration: Simple installation via pip and integration with existing LLM frameworks.

MInference is an active project with recent updates and community engagement, evidenced by frequent commits and integrations into other projects like vLLM and Qwen2.5-1M. It has garnered significant attention in the research community, including spotlight acceptance at NeurIPS'24 and presentations at ICML'25. Extensive documentation and a growing list of supported models indicate ongoing development and community support.

MInference benefits researchers and developers working with long-context LLMs by drastically reducing inference times. It enables faster experimentation and deployment of these models for applications requiring processing of extensive information, such as document analysis, code generation, and conversational AI. By providing a highly efficient attention mechanism, it lowers computational costs and expands the practical applicability of long-context language models.

Summarize:
Share:
Stars
1,230
Forks
84
Issues
99
Created
2 years ago
Commit
16 days ago
License
MIT
Archived
No
Updated 13 hours ago

Similar Repositories