arXiv:2501.06663cs.LGcs.AR2025-01被引 9

用张量压缩让FPGA在极小内存下完成Transformer训练

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

  • 通过双向张量压缩降低计算量和层内内存占用
  • 在6MB片上内存下实现36.7~93.5MB模型的端到端训练
  • 适合资源受限场景下的隐私保护与边缘模型训练

Transformer模型在众多机器学习任务中表现卓越,但其训练对算力和内存要求高,难以部署于边缘设备。本文首次提出基于低秩张量压缩的FPGA全端到端训练加速器。算法层面,设计双向收缩流程,显著降低计算浮点操作数(FLOPS)和层内内存开销;硬件层面,将所有压缩后的模型参数与梯度信息存于片上,构建纯片上内存训练框架,减少外部通信,降低延迟与能耗。针对各训练阶段定制计算核,结合层内并行与流水线优化运行效率。在ATIS数据集上,使用FP-32格式的36.7至93.5MB模型,在AMD Alevo U50 FPGA上实现单批次端到端训练,片上内存仅需<6MB BRAM和22.5MB URAM。相比未压缩训练的NVIDIA RTX 3090 GPU,内存减少30×至51×;每轮训练能耗降低最多达3.6×。

原文摘要 · Abstract (English)

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.

FPGATransformer内存压缩边缘训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。