SOFA:一种通过跨阶段协同分块实现计算-存储优化的稀疏加速器
SOFA: A Compute-Memory Optimized Sparsity Accelerator via Cross-Stage Coordinated Tiling
AI总结:
针对Transformer推理中大规模令牌并行处理的存储与计算瓶颈,提出跨阶段协同的SOFA稀疏加速器,通过前导零预测、协同分块等机制实现能效与速度的显著提升。
摘要:
受益于自注意力机制,Transformer模型在长文本上下文理解方面已取得令人瞩目的能力。随着大语言模型(LLMs)日益普及,业界产生了高吞吐量推理需求,这就需要大规模令牌并行处理(LTPP)。然而,现有动态稀疏加速器难以有效处理LTPP,因为它们仅聚焦于单阶段优化,且大多数研究工作局限于计算性能提升。\n通过重新审视动态稀疏加速的端到端流程,我们发现了一个长期被忽视的优化契机:LTPP可利用各阶段之间的内在协同关系,避免过量内存访问与冗余计算。基于这一观察,我们提出SOFA——一种跨阶段计算-存储高效的算法-硬件协同设计方案,专门用于有效应对Transformer推理中LTPP带来的挑战。\n我们首先提出一种新颖的前导零计算范式,该范式通过基于对数的纯加法运算预测注意力稀疏性,避免了预测过程的高额开销。随后,我们提出分布式排序与排序更新式FlashAttention机制,二者遵循跨阶段协同分块原则,可实现各阶段之间细粒度、轻量级的协同,助力优化内存访问与延迟。此外,我们设计了SOFA加速器以高效支撑上述优化。\n在20个基准测试上开展的大量实验表明,SOFA相较于Nvidia A100 GPU实现了9.5倍的速度提升与71.5倍的能效提升。与8款当前最优(SOTA)加速器相比,SOFA的能效、面积效率与速度分别平均达到15.8倍、10.3倍与9.3倍。
英文摘要:
Benefiting from the self-attention mechanism, Transformer models have attained impressive contextual comprehension capabilities for lengthy texts. The requirements of high-throughput inference arise as the large language models (LLMs) become increasingly prevalent, which calls for large-scale token parallel processing (LTPP). However, existing dynamic sparse accelerators struggle to effectively handle LTPP, as they solely focus on separate stage optimization, and with most efforts confined to computational enhancements. By re-examining the end-to-end flow of dynamic sparse acceleration, we pinpoint an ever-overlooked opportunity that the LTPP can exploit the intrinsic coordination among stages to avoid excessive memory access and redundant computation. Motivated by our observation, we present SOFA, a cross-stage compute-memory efficient algorithm-hardware co-design, which is tailored to tackle the challenges posed by LTPP of Transformer inference effectively. We first propose a novel leading zero computing paradigm, which predicts attention sparsity by using log-based add-only operations to avoid the significant overhead of prediction. Then, a distributed sorting and a sorted updating FlashAttention mechanism are proposed with a cross-stage coordinated tiling principle, which enables fine-grained and lightweight coordination among stages, helping optimize memory access and latency. Further, we propose a SOFA accelerator to support these optimizations efficiently. Extensive experiments on 20 benchmarks show that SOFA achieves $9.5\times$ speed up and $71.5\times$ higher energy efficiency than Nvidia A100 GPU. Compared to 8 SOTA accelerators, SOFA achieves an average $15.8\times$ energy efficiency, $10.3\times$ area efficiency and $9.3\times$ speed up, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。