arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2302.14017cs.CLcs.LG
收藏

Transformer推理的全栈优化:一项综述

Full Stack Optimization of Transformer Inference: a Survey

UC Berkeley(加州大学伯克利分校);NVIDIA(英伟达);ICSI(国际计算机科学研究所);LBNL(劳伦斯伯克利国家实验室)

Sehoon Kim, Coleman Hooper, Thanakul Wattanawong, Minwoo Kang, Ruohan Yan, Hasan Genc, Grace Dinh, Qijing Huang, Kurt Keutzer, Michael W. Mahoney, Yakun Sophia Shao, Amir Gholami

AI总结:

本综述梳理了Transformer推理效率优化的五类研究方向,并通过Gemmini加速器案例验证,证实全栈协同设计可实现最高88.7倍的推理加速且性能损耗极小。

摘要:

最先进的深度神经网络(DNN)架构设计的最新进展正朝着Transformer模型方向发展。这些模型在广泛的应用中实现了卓越的准确率。自Transformer模型最初被提出以来,这一趋势在过去几年中始终保持一致。然而,最新Transformer模型的推理所需的计算量和带宽正以显著速度增长,这使得它们在对延迟敏感的应用中的部署面临挑战。因此,人们越来越关注提升Transformer模型的效率,相关方法涵盖从改变架构设计,一直到开发专用的领域特定加速器等多个层面。在本研究中,我们调研了实现高效Transformer推理的不同方法,包括:(i)对现有Transformer架构中的瓶颈进行分析与性能剖析,以及它们与此前卷积模型的异同;(ii)Transformer架构对硬件的影响,包括层归一化(Layer Normalization)、Softmax和GELU等非线性运算以及线性运算对硬件设计的影响;(iii)针对固定Transformer架构的优化方法;(iv)为Transformer模型寻找合适的运算映射与调度所面临的挑战;(v)通过神经架构搜索调整架构以优化Transformer模型的方法。最后,我们通过在开源全栈DNN加速器生成器Gemmini上应用所调研的优化方法开展了案例研究,并展示了与Gemmini上此前的基准测试结果相比,上述每种方法如何带来性能提升。除此之外,我们发现结合上述方法的全栈协同设计方案可在Transformer推理中实现最高88.7倍的加速比,同时性能退化极小。

英文摘要:

Recent advances in state-of-the-art DNN architecture design have been moving toward Transformer models. These models achieve superior accuracy across a wide range of applications. This trend has been consistent over the past several years since Transformer models were originally introduced. However, the amount of compute and bandwidth required for inference of recent Transformer models is growing at a significant rate, and this has made their deployment in latency-sensitive applications challenging. As such, there has been an increased focus on making Transformer models more efficient, with methods that range from changing the architecture design, all the way to developing dedicated domain-specific accelerators. In this work, we survey different approaches for efficient Transformer inference, including: (i) analysis and profiling of the bottlenecks in existing Transformer architectures and their similarities and differences with previous convolutional models; (ii) implications of Transformer architecture on hardware, including the impact of non-linear operations such as Layer Normalization, Softmax, and GELU, as well as linear operations, on hardware design; (iii) approaches for optimizing a fixed Transformer architecture; (iv) challenges in finding the right mapping and scheduling of operations for Transformer models; and (v) approaches for optimizing Transformer models by adapting the architecture using neural architecture search. Finally, we perform a case study by applying the surveyed optimizations on Gemmini, the open-source, full-stack DNN accelerator generator, and we show how each of these approaches can yield improvements, compared to previous benchmark results on Gemmini. Among other things, we find that a full-stack co-design approach with the aforementioned methods can result in up to 88.7x speedup with a minimal performance degradation for Transformer inference.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑