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

用MLIR编译ONNX神经网络模型

Compiling ONNX Neural Network Models Using MLIR

IBM T.J. Watson Research Center(IBM托马斯·J·沃森研究中心);IBM Research - Tokyo(IBM东京研究院);Massachusetts Institute of Technology (MIT)(麻省理工学院)

Tian Jin, Gheorghe-Teodor Bercea, Tung D. Le, Tong Chen, Gong Su, Haruki Imai, Yasushi Negishi, Anh Leu, Kevin O'Brien, Kiyokuni Kawachiya, Alexandre E. Eichenberger

摘要:

深度神经网络模型正变得越来越流行,并已用于各种任务,如计算机视觉、语音识别和自然语言处理。机器学习模型通常在资源丰富的环境中训练,然后部署在不同的环境中,如高可用性机器或边缘设备。为了帮助模型的可移植性,开源社区提出了开放神经网络交换(ONNX)标准。在本文中,我们提出了一个高层次的,我们的onnx-mlir编译器,生成代码的推理的深度神经网络模型描述的ONNX格式的初步报告。Onnx-mlir是一个开源编译器,使用最近集成在LLVM项目中的多级中间表示(MLIR)基础设施实现。Onnx-mlir依赖于MLIR的方言概念来实现其功能。我们在这里提出了两种新的方言:(1)编码ONNX标准语义的ONNX特定方言,以及(2)为所有ONNX方言操作提供公共降低点的基于循环的方言。每个中间表示分别促进其自身的基于图级和基于循环的优化的特征集。我们说明我们的方法,通过以下几个模型,通过建议的表示,我们包括一些早期的优化工作和性能结果。

英文摘要:

Deep neural network models are becoming increasingly popular and have been used in various tasks such as computer vision, speech recognition, and natural language processing. Machine learning models are commonly trained in a resource-rich environment and then deployed in a distinct environment such as high availability machines or edge devices. To assist the portability of models, the open-source community has proposed the Open Neural Network Exchange (ONNX) standard. In this paper, we present a high-level, preliminary report on our onnx-mlir compiler, which generates code for the inference of deep neural network models described in the ONNX format. Onnx-mlir is an open-source compiler implemented using the Multi-Level Intermediate Representation (MLIR) infrastructure recently integrated in the LLVM project. Onnx-mlir relies on the MLIR concept of dialects to implement its functionality. We propose here two new dialects: (1) an ONNX specific dialect that encodes the ONNX standard semantics, and (2) a loop-based dialect to provide for a common lowering point for all ONNX dialect operations. Each intermediate representation facilitates its own characteristic set of graph-level and loop-based optimizations respectively. We illustrate our approach by following several models through the proposed representations and we include some early optimization work and performance results.

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

↑