LGCLFeb 17, 2025

APB: Accelerating Distributed Long-Context Inference by Passing Compressed Context Blocks across GPUs

Tsinghua
arXiv:2502.12085v23 citationsh-index: 31Has CodeACL
Originality Highly original
AI Analysis

This addresses the problem of slow inference for long-context queries in LLM applications, offering a significant efficiency improvement for users needing timely processing of extended inputs.

The paper tackles the bottleneck of prefill speed in long-context inference for large language models by introducing APB, a framework that uses multi-host approximate attention and communication of compressed context blocks, achieving speedups of up to 9.2x compared to existing methods without performance loss.

While long-context inference is crucial for advancing large language model (LLM) applications, its prefill speed remains a significant bottleneck. Current approaches, including sequence parallelism strategies and compute reduction through approximate attention mechanisms, still fall short of delivering optimal inference efficiency. This hinders scaling the inputs to longer sequences and processing long-context queries in a timely manner. To address this, we introduce APB, an efficient long-context inference framework that leverages multi-host approximate attention to enhance prefill speed by reducing compute and enhancing parallelism simultaneously. APB introduces a communication mechanism for essential key-value pairs within a sequence parallelism framework, enabling a faster inference speed while maintaining task performance. We implement APB by incorporating a tailored FlashAttn kernel alongside optimized distribution strategies, supporting diverse models and parallelism configurations. APB achieves speedups of up to 9.2x, 4.2x, and 1.6x compared with FlashAttn, RingAttn, and StarAttn, respectively, without any observable task performance degradation. We provide the implementation and experiment code of APB in https://github.com/thunlp/APB.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes