Abstract
We consider the problem of identifying optimal parameters for two implementations of the general matrix multiplication (GEMM). Optimal parameters are chosen based on time modeling for two GEMM implementations, which is done by analyzing the structure of each implementation and the characteristics of the hardware. Each implementation has specific packing strategies that influence data movement and time of data access. The data movement, as well as constraints for the registers and each level of the two-level cache, is considered to ensure proper data usage. Based on the proposed models, an exhaustive search procedure for microkernel and tiling parameters was used to obtain the best parameters for each of the considered implementations of GEMM for multi-level intermediate representation (MLIR). The results show that the performance of MLIR-based code generation for these GEMM implementations, when different matrix sizes are used, is comparable with the performance that can be obtained for Basic Linear Algebra Subprograms (BLAS).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bondhugula, U.: High performance code generation in MLIR: an early case study with GEMM (2020). https://doi.org/10.48550/arXiv.2003.00532
Goto, K., Geijn, R.V.D.: Anatomy of high-performance matrix multiplication. ACM Trans. Math. Softw. 34, 12:1–12:25 (2008)
Huang, J., Geijn, R.: BLISlab: a sandbox for optimizing GEMM. arXiv, p. 1609.00076 (2016). https://doi.org/10.48550/arXiv.1609.00076
Lattner, C., et al.: MLIR: scaling compiler infrastructure for domain specific computation. In: 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Seoul, Korea, pp. 2–14 (2021)
Low, T.M., Igual, F., Smith, T., Quintana-Ortí, E.S.: Analytical modeling is enough for high-performance BLIS. ACM Trans. Math. Softw. (TOMS) 43, 1–18 (2016)
Lu, L., et al.: TENET: a framework for modeling tensor dataflow based on relation-centric notation (2021). https://doi.org/10.48550/arXiv.2105.01892
Zee, F.G.V., van de Geijn, R.A.: BLIS: a framework for rapidly instantiating BLAS functionality. ACM Trans. Math. Softw. 41, 14:1–14:33 (2015)
Zhang, H., Cheng, X., Zang, H., Park, D.H.: Compiler-level matrix multiplication optimization for deep learning. arXiv, p. 1909.10616 (2019). https://doi.org/10.48550/arXiv.1909.10616
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Romanov, A., Turkin, A., Myakinin, O., Tsupko, F., Gao, J. (2023). Parameter Estimation via Time Modeling for MLIR Implementation of GEMM. In: Olenev, N., Evtushenko, Y., Jaćimović, M., Khachay, M., Malkova, V. (eds) Optimization and Applications. OPTIMA 2023. Lecture Notes in Computer Science, vol 14395. Springer, Cham. https://doi.org/10.1007/978-3-031-47859-8_12
Download citation
DOI: https://doi.org/10.1007/978-3-031-47859-8_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-47858-1
Online ISBN: 978-3-031-47859-8
eBook Packages: Computer ScienceComputer Science (R0)