arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.15016cs.PLcs.CLcs.LG
收藏

TPU-MLIR:一种使用MLIR的TPU编码器

TPU-MLIR: A Compiler For TPU Using MLIR

Sophgo Inc.(算能科技有限公司)

Pengchao Hu, Man Lu, Lei Wang, Guoyue Jiang

摘要:

多层中间表示(MLIR)通过提供可重用和可扩展的编译器基础结构,在降低构建特定领域编译器的成本方面显示出巨大的潜力。这项工作提出了TPU-MLIR,这是一个基于MLIR的端到端编译器,它将预训练的神经网络(NN)模型部署到称为张量处理单元(TPU)的自定义ASIC中。TPU-MLIR定义了两种新的方言来实现其功能:1。对深度学习图语义进行编码并且独立于深度学习框架的张量操作(TOP)方言,以及2. TPU内核方言,用于在TPU上提供标准内核计算。NN模型被翻译为TOP方言,然后根据芯片的配置针对不同的TPU降低到TPU方言。我们演示了如何使用MLIR通道流水线来组织和执行TPU上的优化,以生成机器码。本文还提出了一个验证过程,以确保每个转换阶段的正确性。

英文摘要:

Multi-level intermediate representations (MLIR) show great promise for reducing the cost of building domain-specific compilers by providing a reusable and extensible compiler infrastructure. This work presents TPU-MLIR, an end-to-end compiler based on MLIR that deploys pre-trained neural network (NN) models to a custom ASIC called a Tensor Processing Unit (TPU). TPU-MLIR defines two new dialects to implement its functionality: 1. a Tensor operation (TOP) dialect that encodes the deep learning graph semantics and independent of the deep learning framework and 2. a TPU kernel dialect to provide a standard kernel computation on TPU. A NN model is translated to the TOP dialect and then lowered to the TPU dialect for different TPUs according to the chip's configuration. We demonstrate how to use the MLIR pass pipeline to organize and perform optimization on TPU to generate machine code. The paper also presents a verification procedure to ensure the correctness of each transform stage.

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

↑