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

通过张量压缩优化的超内存高效Transformer片上FPGA训练

Ultra Memory-Efficient On-FPGA Training of Transformers via Tensor-Compressed Optimization

Department of Electrical and Computer Engineering, University of California, Santa Barbara(加州大学圣芭芭拉分校电子与计算机工程系);Intel Corporation(英特尔公司);Department of Computer Science, North Carolina State University(北卡罗来纳州立大学计算机科学系);School of Electrical and Computer Engineering, Georgia Institute of Technology(佐治亚理工学院电气与计算机工程学院)

Jiayi Tian, Jinming Lu, Hai Li, Xiangwei Wang, Cong Hao, Ian Young, Zheng Zhang

AI总结:

针对边缘设备Transformer训练的内存瓶颈,提出基于张量压缩的FPGA加速器,通过双向收缩流和片上内存实现端到端训练,内存减少30-51倍,能耗降低3.6倍。

摘要:

Transformer模型在广泛的机器学习任务中已取得最先进的性能。由于隐私、领域适应和片上科学机器学习等方面的考虑,在资源受限的边缘设备上训练Transformer的兴趣日益增长。然而,Transformer训练所需的巨大计算和内存需求往往超出边缘设备的能力。利用低秩张量压缩,本文提出了首个用于端到端Transformer训练的片上FPGA加速器。在算法方面,我们提出了一种用于张量化Transformer训练的双向收缩流,与现有张量操作相比,显著降低了计算FLOPS和层内内存成本。在硬件方面,我们将所有高度压缩的模型参数和梯度信息存储在芯片上,为训练的每个阶段创建了一个仅片上内存的框架。这减少了片外通信,并最小化了延迟和能量成本。此外,我们为每个训练阶段实现了自定义计算内核,并采用层内并行和流水线技术来进一步提高运行时间和内存效率。通过在ATIS数据集上使用FP-32数据格式、模型大小在36.7至93.5 MB之间的Transformer模型进行实验,我们的张量化FPGA加速器能够在AMD Alevo U50 FPGA上进行单批次端到端训练,内存预算小于6 MB的BRAM和22.5 MB的URAM。与在NVIDIA RTX 3090 GPU上的未压缩训练相比,我们的片上FPGA训练实现了30倍至51倍的内存减少。与在NVIDIA RTX 3090 GPU上的张量Transformer训练相比,我们的FPGA加速器每个epoch的能量成本也降低了高达3.6倍。

英文摘要:

Transformer models have achieved state-of-the-art performance across a wide range of machine learning tasks. There is growing interest in training transformers on resource-constrained edge devices due to considerations such as privacy, domain adaptation, and on-device scientific machine learning. However, the significant computational and memory demands required for transformer training often exceed the capabilities of an edge device. Leveraging low-rank tensor compression, this paper presents the first on-FPGA accelerator for end-to-end transformer training. On the algorithm side, we present a bi-directional contraction flow for tensorized transformer training, significantly reducing the computational FLOPS and intra-layer memory costs compared to existing tensor operations. On the hardware side, we store all highly compressed model parameters and gradient information on chip, creating an on-chip-memory-only framework for each stage in training. This reduces off-chip communication and minimizes latency and energy costs. Additionally, we implement custom computing kernels for each training stage and employ intra-layer parallelism and pipe-lining to further enhance run-time and memory efficiency. Through experiments on transformer models within $36.7$ to $93.5$ MB using FP-32 data formats on the ATIS dataset, our tensorized FPGA accelerator could conduct single-batch end-to-end training on the AMD Alevo U50 FPGA, with a memory budget of less than $6$-MB BRAM and $22.5$-MB URAM. Compared to uncompressed training on the NVIDIA RTX 3090 GPU, our on-FPGA training achieves a memory reduction of $30\times$ to $51\times$. Our FPGA accelerator also achieves up to $3.6\times$ less energy cost per epoch compared with tensor Transformer training on an NVIDIA RTX 3090 GPU.

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

↑