从张量加速器ISA描述自动生成ML编译器后端
Automatically Generating ML Compiler Backends from Tensor Accelerator ISA Descriptions
AI总结:
本文提出ACT工具,可基于ISA描述自动生成张量加速器的XLA编译器后端,其生成的后端性能优于商用编译器,且提升了AWS Trainium的代码生成覆盖率。
摘要:
机器学习(ML)编译器在实现ML工作负载的高性能实现中发挥关键作用,这些编译器利用现有的CPU和GPU后端生成特定设备的代码。近年来,为进一步加速这些工作负载,设计了许多张量加速器(或称AI加速器),其中包括AWS Trainium等商用产品已公开可用。然而,与通用硬件相比,大多数张量加速器缺乏具备稳健代码生成支持的成熟ML编译器后端,且张量加速器设计迭代周期快,手动开发和维护ML编译器后端难度大。因此,为实现新型张量加速器设计在ML基础设施中的更快集成,需提升编译器后端构建过程的敏捷性。本文介绍ACT,这是一款仅需指令集架构(ISA)描述即可自动生成张量加速器编译器后端的工具,这些后端与生产级ML编译器XLA集成。ACT采用新型ISA参数化编译算法,生成的编译器后端包含基于等式饱和的指令选择阶段和基于约束编程的内存分配阶段。我们为6个工业界(如AWS Trainium、Intel AMX)和学术界(如Gemmini)的加速器平台生成了编译器后端,结果表明,这些生成的后端性能与商用编译器后端及专家编写的内核库相当或更优,同时保持较低的编译开销。值得注意的是,ACT生成的AWS NKI ISA后端使AWS Trainium的代码生成覆盖率较AWS生产编译器neuronx-cc提升了2.3倍。ACT是围绕我们的ISA描述语言TAIDL构建的更大开源生态系统的一部分。
英文摘要:
Machine learning (ML) compilers play a key role in enabling high-performance implementations of ML workloads. These compilers use existing CPU and GPU backends to generate device-specific code. In recent years, many tensor accelerators (or AI accelerators) have been designed to further accelerate these workloads, with commercial products like AWS Trainium publicly available. However, compared to commodity hardware, a majority of tensor accelerators do not have mature ML compiler backends with robust code generation support. Moreover, tensor accelerator designs are subject to fast iteration cycles, making it difficult to manually develop and maintain ML compiler backends. Therefore, to enable faster integration of novel tensor accelerator designs in ML infrastructure, we need to make the compiler backend construction process more agile. We introduce ACT, a compiler backend generator that automatically generates compiler backends for tensor accelerators, given just the instruction set architecture (ISA) descriptions. These backends are integrated with XLA, a production ML compiler. ACT uses a novel ISA-parameterized compilation algorithm to generate a compiler backend with an equality-saturation-based instruction selection phase and a constraint-programming-based memory allocation phase. We generated compiler backends for 6 accelerator platforms from industry (e.g., AWS Trainium, Intel AMX) and academia (e.g., Gemmini). We showed that these generated backends match or outperform commercial compiler backends and expert-written kernel libraries, while maintaining low compilation overheads. Notably, ACT-generated backend for AWS NKI ISA improved the code generation coverage for AWS Trainium by 2.3x compared with AWS's production compiler, neuronx-cc. ACT is part of a larger open-source ecosystem (https://github.com/act-compiler/act) built around our ISA description language, TAIDL.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。