Key Operator Vectorization for LeNet and ResNet Based on Buddy Compiler
Source abstract
Abstract
Deep learning has emerged as a prominent focus in both academia and industry, with a wide range of models being applied across diverse domains. Fast and efficient model inference is essential for the practical deployment of deep learning models. Under specific hardware constraints, accelerating inference remains a key research challenge. Common techniques for model acceleration include quantization, pruning, and vectorization. Although quantization and pruning primarily reduce model precision or complexity to enhance efficiency, this paper concentrates on vectorization, a technique that accelerates models by increasing the parallelism of operator execution. Based on the open-source Buddy-MLIR project, this work implements vectorization optimizations for Matmul, Conv2d, and Max Pooling operations to improve inference performance. These optimizations are designed as compiler passes and integrated into the Buddy-MLIR framework, offering a general solution for vectorizing such operators. Two optimization approaches are proposed: general vectorization and adaptive vectorization. Compared to the standard MLIR lowering pipeline and the fully optimized LLVM backend, the proposed general and adaptive vectorization methods reduce the inference latency of LeNet-5 by 26.7% and 37.3%, respectively. For the more complex ResNet-18 model, these methods achieve latency reductions of 79.9% and 82.6%, respectively.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Advanced Neural Network Applications · Parallel Computing and Optimization Techniques · Machine Learning and Data Classification
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
College of Computer Science, Beijing University of Technology, Beijing 100021, China
Funding
Beijing Natural Science Foundation
References (26)
Show source-provided references
1. (2025, August 17). Recent Advances in Deep Learning: An Overview. Available online: https://api.semanticscholar.org/CorpusID:49908818.
2. Chauhan, R., Ghanshala, K.K., and Joshi, R.C. (2018, January 15–17). Convolutional Neural Network (CNN) for Image Detection and Recognition. Proceedings of the 2018 First International Conference on Secure Cyber Computing and Communication (ICSCCC), Jalandhar, India.10.1109/ICSCCC.2018.8703316 ↗
3. Kim, Y. (2014, January 25–29). Convolutional Neural Networks for Sentence Classification. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar.10.3115/v1/D14-1181 ↗
4. Backpropagation Applied to Handwritten Zip Code Recognition10.1162/neco.1989.1.4.541 ↗
5. Visualizing and Understanding Convolutional Networks10.1007/978-3-319-10590-1_53 ↗
6. Gradient-based learning applied to document recognition10.1109/5.726791 ↗
7. ImageNet Classification with Deep Convolutional Neural Networks10.1145/3065386 ↗
8. He, K., Zhang, X., Ren, S., and Sun, J. (2016, January 27–30). Deep Residual Learning for Image Recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA.10.1109/CVPR.2016.90 ↗
9. From Distributed Machine to Distributed Deep Learning: A Comprehensive Survey10.1186/s40537-023-00829-x ↗
10. Explainable Deep Learning for Efficient and Robust Pattern Recognition: A Survey of Recent Developments10.1016/j.patcog.2021.108102 ↗
11. Masked Face Detection Via a Modified LeNet10.1016/j.neucom.2016.08.056 ↗
12. Jia, L., and Sun, Y. (2018, January 26–28). Digital Recognition Based on Improved LENET Convolution Neural Network. Proceedings of the International Conference on Machine Learning, Jinan, China.10.1145/3231884.3231886 ↗
13. Kim, K., Costa, T.B., Deveci, M., Bradley, A.M., Hammond, S.D., Guney, M.E., Knepper, S., Story, S., and Rajamanickam, S. (2017, January 12–17). Designing Vector-Friendly Compact BLAS and LAPACK Kernels. Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, Denver, CO, USA.10.1145/3126908.3126941 ↗
14. Importance of Explicit Vectorization for CPU and GPU Software Performance
15. Li, K., Yuan, L., Zhang, Y., Yue, Y., and Cao, H. (June, January 30). An Efficient Vectorization Scheme for Stencil Computation. Proceedings of the 2022 IEEE International Parallel and Distributed Processing Symposium, Lyon, France.10.1109/IPDPS53621.2022.00069 ↗
16. Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G.S., Davis, A., Dean, J., and Devin, M. (2016). TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems. arXiv.
17. (2025, August 17). XLA-TensorFlow, compiled. Google Developers Blog. Available online: https://developers.googleblog.com/en/xla-tensorflow-compiled/.
18. Simonyan, K., and Zisserman, A. (2014). Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv.
19. Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016, January 27–30). You Only Look Once: Unified, Real-Time Object Detection. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA.10.1109/CVPR.2016.91 ↗
20. Attention is All You Need
21. Lattner, C., Amini, M., Bondhugula, U., Cohen, A., Davis, A., Pienaar, J., Riddle, R., Shpeisman, T., Vasilache, N., and Zinenko, O. (March, January 27). MLIR: Scaling Compiler Infrastructure for Domain Specific Computation. Proceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Seoul, Republic of Korea.10.1109/CGO51591.2021.9370308 ↗
22. Lattner, C., and Adve, V. (2004, January 20–24). LLVM: A compilation framework for lifelong program analysis transformation. Proceedings of the International Symposium on Code Generation and Optimization, CGO 2004, San Jose, CA, USA.
23. Dataflow Machine Architecture
24. Lattner, C., Amini, M., Bondhugula, U., Cohen, A., Davis, A., Pienaar, J., Riddle, R., Shpeisman, T., Vasilache, N., and Zinenko, O. (2020). MLIR: A Compiler Infrastructure for the End of Moore’s Law. arXiv.
25. (2025, August 17). TableGen-LLVM 10 Documentation. LLVM. Available online: https://llvm.org/docs/TableGen/.
26. Survey on RISC-V System Architecture Research