FuseMax: 利用扩展的Einsums优化注意力加速器设计
FuseMax: Leveraging Extended Einsums to Optimize Attention Accelerator Design
AI总结:
FuseMax通过利用扩展的Einsums优化注意力加速器设计,实现高计算利用率和低能耗,比现有方法在速度和能效上均有显著提升。
摘要:
Transformer中的注意力是一个关键的工作负载,最近因其作为定制加速的目标而受到显著关注。然而,尽管先前的工作成功地减少了注意力的内存带宽需求,但它们在构成注意力计算的运算符之间造成了负载不平衡(导致严重的计算利用率不足),并且需要与序列长度成比例的片上内存(预计会随时间增长)。本文缓解了这些问题,使注意力能够实现接近100%的计算利用率,没有片外内存交通瓶颈,并且片上缓冲区大小需求与序列长度无关。主要的概念贡献是利用最近提出的一种抽象——Einsum的级联——来描述、形式化和分类文献中出现的注意力算法空间。特别是,我们展示了如何利用Einsum级联来推断内核必须通过其输入数据的次数的非平凡下界,这对所需的片上缓冲区容量或内存交通有影响。我们展示了如何利用这一概念将注意力算法的空间划分为几个类别,并使用这些类别来指导我们的设计过程。基于上述的分类,我们提出了FuseMax——一种将注意力映射到空间数组式架构上的新方法。在等面积比较中,FuseMax在注意力上比先前的最先进方法FLAT平均快6.7倍,同时使用79%的能量。同样,在完整的端到端Transformer推理中,FuseMax比FLAT平均快5.3倍,使用83%的能量。
英文摘要:
Attention for transformers is a critical workload that has recently received significant "attention" as a target for custom acceleration. Yet, while prior work succeeds in reducing attention's memory-bandwidth requirements, it creates load imbalance between operators that comprise the attention computation (resulting in severe compute under-utilization) and requires on-chip memory that scales with sequence length (which is expected to grow over time). This paper ameliorates these issues, enabling attention with nearly 100% compute utilization, no off-chip memory traffic bottlenecks, and on-chip buffer size requirements that are independent of sequence length. The main conceptual contribution is to use a recently proposed abstraction -- the cascade of Einsums -- to describe, formalize, and taxonomize the space of attention algorithms that appear in the literature. In particular, we show how Einsum cascades can be used to infer non-trivial lower bounds on the number of passes a kernel must take through its input data, which has implications for either required on-chip buffer capacity or memory traffic. We show how this notion can be used to meaningfully divide the space of attention algorithms into several categories and use these categories to inform our design process. Based on the above characterization, we propose FuseMax -- a novel mapping and binding of attention onto a spatial array-style architecture. On attention, in an iso-area comparison, FuseMax achieves an average 6.7x speedup over the prior state-of-the-art, FLAT, while using 79\% of the energy. Similarly, on full end-to-end transformer inference, FuseMax achieves an average 5.3x speedup over FLAT using 83 of the energy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。