基于聚类的稀疏注意力重映射用于PIM上的高效LLM解码
Sparse Attention Remapping with Clustering for Efficient LLM Decoding on PIM
AI总结:
本文提出STARC方案,通过聚类KV对并映射到PIM银行结构对齐的连续内存区域,减少LLM解码的注意力层延迟和能耗,提升PIM架构下的长上下文推理效率。
摘要:
基于聚类的稀疏注意力重映射用于PIM上的高效LLM解码:Transformer-based模型是现代机器学习的基础,但其执行,特别是在大型语言模型(LLMs)中的自回归解码过程中,对内存系统施加了显著压力,由于频繁的内存访问和增长的关键值(KV)缓存。这在上下文长度增加时造成了带宽瓶颈。处理在内存(PIM)架构是一种有前途的解决方案,提供高内部带宽和计算并行性,接近内存。然而,当前PIM设计主要优化密集注意力,难以应对现代KV缓存稀疏技术引入的动态、不规则访问模式。因此,它们面临工作负载不平衡,降低吞吐量和资源利用率。在本工作中,我们提出STARC,一种新的稀疏优化数据映射方案,专门针对PIM架构上的高效LLM解码。STARC通过语义相似性对KV对进行聚类,并将它们映射到与PIM银行结构对齐的连续内存区域。在解码过程中,查询通过匹配预计算的质心来在聚类粒度上检索相关令牌,实现选择性注意力和并行处理,无需频繁重新聚类或数据移动开销。实验表明,在HBM-PIM系统上,与常见的按令牌稀疏方法相比,STARC将注意力层延迟减少了19%--31%,能耗减少了19%--27%。在KV缓存预算为1024的情况下,它在完全检索KV缓存的情况下实现了高达54%--74%的延迟减少和45%--67%的能耗减少。同时,STARC保持的模型精度与最先进的稀疏注意力方法相当,证明了其在使PIM架构上的高效和硬件友好的长上下文LLM推理中有效性。
英文摘要:
Transformer-based models are the foundation of modern machine learning, but their execution, particularly during autoregressive decoding in large language models (LLMs), places significant pressure on memory systems due to frequent memory accesses and growing key-value (KV) caches. This creates a bottleneck in memory bandwidth, especially as context lengths increase. Processing-in-memory (PIM) architectures are a promising solution, offering high internal bandwidth and compute parallelism near memory. However, current PIM designs are primarily optimized for dense attention and struggle with the dynamic, irregular access patterns introduced by modern KV cache sparsity techniques. Consequently, they suffer from workload imbalance, reducing throughput and resource utilization. In this work, we propose STARC, a novel sparsity-optimized data mapping scheme tailored specifically for efficient LLM decoding on PIM architectures. STARC clusters KV pairs by semantic similarity and maps them to contiguous memory regions aligned with PIM bank structures. During decoding, queries retrieve relevant tokens at cluster granularity by matching against precomputed centroids, enabling selective attention and parallel processing without frequent reclustering or data movement overhead. Experiments on the HBM-PIM system show that, compared to common token-wise sparsity methods, STARC reduces attention-layer latency by 19%--31% and energy consumption by 19%--27%. Under a KV cache budget of 1024, it achieves up to 54%--74% latency reduction and 45%--67% energy reduction compared to full KV cache retrieval. Meanwhile, STARC maintains model accuracy comparable to state-of-the-art sparse attention methods, demonstrating its effectiveness in enabling efficient and hardware-friendly long-context LLM inference on PIM architectures.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。