[论文解读] CHARM: Composing Heterogeneous Accelerators for Matrix Multiply on Versal ACAP Architecture
CHARM 设计并自动组装多种异构 MM 加速器在 AMD/Xilinx Versal ACAP 上,以支持大和小矩阵乘法,并在端到端吞吐量上相比单一加速器获得显著提升。
Dense matrix multiply (MM) serves as one of the most heavily used kernels in deep learning applications. To cope with the high computation demands of these applications, heterogeneous architectures featuring both FPGA and dedicated ASIC accelerators have emerged as promising platforms. For example, the AMD/Xilinx Versal ACAP architecture combines general-purpose CPU cores and programmable logic with AI Engine processors optimized for AI/ML. With 400 AIEs, it provides up to 6.4 TFLOPs performance for 32-bit floating-point data. However, machine learning models often contain both large and small MM operations. While large MM operations can be parallelized efficiently across many cores, small MM operations typically cannot. We observe that executing some small MM layers from the BERT natural language processing model on a large, monolithic MM accelerator in Versal ACAP achieved less than 5% of the theoretical peak performance. Therefore, one key question arises: How can we design accelerators to fully use the abundant computation resources under limited communication bandwidth for applications with multiple MM layers of diverse sizes? We identify the biggest system throughput bottleneck resulting from the mismatch of massive computation resources of one monolithic accelerator and the various MM layers of small sizes in the application. To resolve this problem, we propose the CHARM framework to compose multiple diverse MM accelerator architectures working concurrently towards different layers in one application. We deploy the CHARM framework for four different applications, including BERT, ViT, NCF, MLP, on the AMD Versal ACAP VCK190 evaluation board. Our experiments show that we achieve 1.46 TFLOPs, 1.61 TFLOPs, 1.74 TFLOPs, and 2.94 TFLOPs inference throughput for BERT, ViT, NCF and MLP, which obtain 5.40x, 32.51x, 1.00x and 1.00x throughput gains compared to one monolithic accelerator.
研究动机与目标
- 引入DL模型如 BERT、ViT、NCF 和 MLP 等不同大小层之间高效 MM 的需求与动机。
- 开发一个框架,在带宽约束下分配资源并组合多样化加速器,以最大化总体吞吐量。
- 实现设计空间探索、代码生成与运行时调度的自动化,以支持 Versal ACAP 上的端到端 DL 工作负载。
- 展示实际部署并提供开源工具,以在 Versal 硬件上实现可重复性。
提出的方法
- 提出 CHARM 架构,在 Versal ACAP 上组合多种异构 MM 加速器和非 MM 内核,配备专用运行时。
- 开发包含 CDSE(单个加速器的设计空间探索)、CDAC(异构加速器组装器)、CACG(自动代码生成)和 CRTS(运行时调度器)的 CHARM 框架。
- 使用两步排序的工作负载分区与资源分区算法,将 MM 内核映射到具有优化吞吐量的多样化加速器。
- 对数据移动和计算进行建模,推导出可指导 DSE 与格形分块选择(A,B,C,X,Y,Z)的优化公式。
- 实现 AIE、PL 和主机代码的自动生成,并与 Versal 工具链集成,生成端到端二进制。
- 在 VCK190 板上以 BERT、ViT、NCF 和 MLP 进行演示,为每个工作负载实现多 TFLOP 的吞吐量。
实验结果
研究问题
- RQ1在带宽受限的情况下,当端到端 DL 模型包含大小差异很大的 MM 层时,如何维持高吞吐量?
- RQ2对于实际 DL 工作负载如 BERT 和 ViT,异构 MM 加速器的组合是否优于单一加速器?
- RQ3需要哪些设计空间探索、数据流策略与自动化手段,才能高效分配资源并调度多样化加速器?
- RQ4自动代码生成与运行时调度如何实现 Versal ACAP 上的实际端到端部署?
主要发现
- CHARM 在 VCK190 上的推理吞吐量为 1.46 TFLOPs(BERT)、1.61 TFLOPs(ViT)、1.74 TFLOPs(NCF)和 2.94 TFLOPs(MLP)。
- 与单一加速器相比,CHARM 在 BERT、ViT、NCF、MLP 的吞吐量提升分别为 5.29×、32.51×、1.00× 和 1.00×。
- CHARM 通过让大型 MM 层分配给更大的加速器、小型 MM 层分配给较小的加速器,展现出更高的资源利用率,降低填充和数据移动的浪费。
- 该框架实现了设计空间探索、代码生成与运行时调度的自动化,使具备异构加速器的端到端 DL 工作负载成为可能。
- 作者提供用于 Versal 的开源工具,作为白盒实现以复现实验结果。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。