arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.19284cs.DCcs.AIcs.AR
收藏

在多微小核心开源RISC-V平台上优化基础模型推理

Optimizing Foundation Model Inference on a Many-tiny-core Open-source RISC-V Platform

ETH Zürich(苏黎世联邦理工学院);University of Bologna(博洛尼亚大学);Politecnico di Torino(都灵理工大学)

Viviane Potocnik, Luca Colagrande, Tim Fischer, Luca Bertaccini, Daniele Jahier Pagliari, Alessio Burrello, Luca Benini

AI总结:

本研究首次在开源多微小核心RISC-V平台上实现Transformer模型端到端推理,利用ISA扩展和DMA引擎优化,在编码器和解码器模型上均实现显著加速,FPU利用率超越现有加速器。

摘要:

基于Transformer的基础模型在自然语言处理(NLP)和计算机视觉(CV)等多个领域变得至关重要。这些模型主要部署在高性能GPU或采用高度定制专有指令集的硬连线加速器上。迄今为止,基于RISC-V的通用平台鲜受关注。在本研究中,我们首次在开源多微小核心RISC-V平台上实现了Transformer模型的端到端推理结果,该平台实现了分布式Softmax原语,并利用ISA扩展进行SIMD浮点操作数流和指令重复,同时采用专用DMA引擎以减少昂贵的主存访问并容忍其延迟。我们重点研究了两种基础Transformer拓扑:仅编码器和仅解码器模型。对于仅编码器模型,我们在最优化实现和基线版本之间实现了高达12.8倍的加速。我们达到超过79%的FPU利用率和294 GFLOPS/W,在保持每计算单元可比吞吐量的同时,利用该硬件平台的性能是现有最先进(SoA)加速器的2倍以上。对于仅解码器拓扑,在非自回归(NAR)模式下实现了16.1倍加速,在自回归(AR)模式下相比基线实现达到35.6倍加速。与最好的SoA专用加速器相比,我们实现了2.04倍更高的FPU利用率。

英文摘要:

Transformer-based foundation models have become crucial for various domains, most notably natural language processing (NLP) or computer vision (CV). These models are predominantly deployed on high-performance GPUs or hardwired accelerators with highly customized, proprietary instruction sets. Until now, limited attention has been given to RISC-V-based general-purpose platforms. In our work, we present the first end-to-end inference results of transformer models on an open-source many-tiny-core RISC-V platform implementing distributed Softmax primitives and leveraging ISA extensions for SIMD floating-point operand streaming and instruction repetition, as well as specialized DMA engines to minimize costly main memory accesses and to tolerate their latency. We focus on two foundational transformer topologies, encoder-only and decoder-only models. For encoder-only models, we demonstrate a speedup of up to 12.8x between the most optimized implementation and the baseline version. We reach over 79% FPU utilization and 294 GFLOPS/W, outperforming State-of-the-Art (SoA) accelerators by more than 2x utilizing the HW platform while achieving comparable throughput per computational unit. For decoder-only topologies, we achieve 16.1x speedup in the Non-Autoregressive (NAR) mode and up to 35.6x speedup in the Autoregressive (AR) mode compared to the baseline implementation. Compared to the best SoA dedicated accelerator, we achieve 2.04x higher FPU utilization.

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

↑