Volume 15 , Issue 2 , PP: 36-45, 2024 | Cite this article as | XML | Html | PDF | Full Length Article
Esraa H. Alwan 1 *
Doi: https://doi.org/10.54216/FPA.150203
Automatic vectorization is often utilized to improve the speed of compute-intensive programs on current CPUs. However, there is enormous space for improvement in present compiler auto-vectorization capabilities. Execution with optimizing code on these resource-controlled strategies is essential for both energy and performance efficiency. While vectorization suggests major performance developments, conventional compiler auto-vectorization techniques often fail. This study investigated the prospective of machine learning algorithms to enhance vectorization. The study proposes an ensemble learning method by employing Random Forest (RF), Feedforward Neural Network (FNN), and Support Vector Machine (SVM) algorithms to estimate the effectiveness of vectorization over Trimaran Single-Value Code (TSVC) loops. Unlike existing methods that depend on static program features, we leverage dynamic features removed from hardware counter-events to build efficient and robust machine learning models. Our approach aims to improve the performance of e-business microcontroller platforms while identifying profitable vectorization opportunities. We assess our method using a benchmark group of 155 loops with two commonly used compilers (GCC and Clang). The results demonstrated high accuracy in predicting vectorization benefits in e-business applications.
Automatic vectorization , ensemble learning , Random Forest , Feedforward Neural Network (FNN) , compiler optimization
[1] K. Stock, L. Pouchet, and P. Sadayappan, “Using machine learning to improve automatic vectorization,” ACMTrans. Archit. Code Optim., Vol. 8, No. 4, pp. 123, 2012.
[2] A. Haj-Ali, N. Ahmed, T. Willke, S. Shao, K. Asanovic, and I. Stoica.,”Neurovectorizer:End-toend vectorization with deep reinforcement learning”,In Proceedings of the 2020 International Symposium on Code Generation and Optimization, CGO 2020.ACM, pp. 242–255, 2020.
[3] H. Amiri, A. Shahbahrami, A. Pohl and B. Juurlink, “Performance evaluation of implicit and explicit SIMDization”, Microprocessors and Microsystems, Vol. 63, pp. 158-168, 2018.
[4] R. Barik, J. Zhao, and V. Sarkar. “Automatic vector instruction selection for dynamic compilation”,In Proceedings of the 19th International Conference on Parallel Architectures and Compilation Techniques, PACT’10, New York, NY, USA . ACM, pp. 573–574, 2010.
[5] S. Siso, W. Armour, and J. Thiyagalingam, “Evaluating auto-vectorizing compilers through objective withdrawal of useful information,” ACM Trans. Archit. Code Optim., Vol. 16, No. 4, 2019.
[6] C. D. Rickett, S.E. Choi, B.L. Chamberlain, “Compiling high-level languages for vector architectures” . In Proceedings of the 17th International Conference on Languages and Compilers for High Performance Computing (LCPC’04),pp.224–237, 2005
[7] A. Trouve, A. J. Cruz, D. B. Brahim, H. Fukuyama, K. J. Murakami, ´ H. A. Clarke, M. Arai, T. Nakahira, and E. Yamanaka, “Predicting vectorization profitability using binary classification,” IEICE Transactions, Vol. 97-D, No. 12, pp. 3124–3132, 2014.
[8] N. Watkinson and et. al. “Using hardware counters to predict vectorization”,In Languages and Compilers for Parallel Computing (LCPC 2017). Springer, 2017.
[9] H.Liu, R. Zhao, K. Nie, “Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program”, IEEE Access ,Vol. 6, pp.47112–47124, 2018.
[10] J. G. Feng, Y. P. He, and Q. M. Tao, “Evaluation of compilers’ capability of automatic vectorization based on source code analysis”,Scientific Programming, Vol. 2021, 2021.
[11] S. Maleki, Y. Gao, M. J. Garzaran et al., “An evaluation of vectorizing compilers,” in Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques (PACT), TX, USA, pp. 372–382, 2011.
[12] W. Gao, R. C. Zhao, L. Han, J. M. Peng, and R. Ding, “Research on SIMD automatic vectorization compiling optimization,” Ruan Jian Xue Bao/Journal Of Software, vol. 26, no. 6, pp. 1265–1284, 2015.
[13] M. Almohammed, A. Fanfakh, and E. Alwan, “Parallel genetic algorithm for optimizing compiler sequences ordering”, In Proc.CCIS, pp. 128-138, 2020.
[14] L. H. Alhasnawy, E. H. Alwan, and A. B. M. Fanfakh, “Using machine learning to predict the sequences of optimization passes” , in Proc. CCIS, pp.139-156, 2020.
[15] H. Liu, J. Xu, S. Chen, T. Guo, "Compiler Optimization Parameter Selection Method Based on Ensemble Learning", Electronics, Vol.11, No.15, pp.2452, 2022.
[16] R. Kruppe, J. Oppermann, L. Sommer, A. Koch. “Extending LLVM for lightweight SPMD vectorization: Using SIMD and vector instructions Easily from any language”, IEEE/ACM International Symposium on Code Generation and Optimization (CGO), pp. 278–279, 2019.
[17] M. Hohenauer, F. Engel, R. Leupers, G. Ascheid, and H. Meyr. “A simd optimization framework for retargetable compilers”. ACM Trans. Archit. Code Optim., Vol. 6, No.1,pp. 2:1–2:27, 2009.
[18] D. S. McFarlin, V. Arbatov, F. Franchetti, andM. Püschel, “Automatic simd vectorization offastfourier transforms for the larrabee and avx instructionsets”. In Proceedings of the International Conference onSupercomputing, ICS’11, New York,NY, USA, ACM. pp. 265–274, 2011.