Qiu, Chenguang and Wu, Jun and Ren, Haoqi and Zhang, Zhifeng (2023) Optimization of Tensor Operation in Compiler. In: Communications and Networking. 17th EAI International Conference, Chinacom 2022, Virtual Event, November 19-20, 2022, Proceedings.
77941.pdf
Download (1MB)
Abstract
This paper proposes an AI compiler architecture, which can compile the trained model and deploy it on DSP chip. The biggest difficulty in deploying the reasoning model on DSP is the multiplication between tensors. Tensor multiplication is the main operation and the most time-consuming operation in the process of model reasoning. Therefore, the operation efficiency of tensor multiplication directly restricts the performance of reasoning. However, there is no matrix computing unit in DSP chip, instead of vector computing unit. We define a new dialect in MLIR(Multi-Level Intermediate Representation) to efficiently compile AI models, especially GEMM and conv operations. The dialect is based on the basic features of mhlo, so this new dialect can make full use of the existing optimized pass of mhlo. Moreover, we have added some functions to support architecture related optimization, mainly the lower algorithm of operation, such as GEMM and conv. we finally map dialect to LLVM dialect and convert it into LLVM IR(immediate representation). The advantage of converting to LLVM IR is that more detailed instruction scheduling can be carried out at the backend of the compiler. We compare the efficiency of a speech model in the code generated by the traditional compiler clang and the code generated by our compiler. The experimental results show that this conversion method has greatly improved the efficiency.
| Item Type: | Conference or Workshop Item (UNSPECIFIED) |
|---|---|
| Uncontrolled Keywords: | MLIR, Deep learning, Compiler, Vector processor |
| Date Deposited: | 04 Mar 2026 19:56 |
| Last Modified: | 20 Nov 2026 12:03 |
| URI: | https://eprints.eai.eu/id/eprint/58597 |
