Abstract
Multiplication of huge matrices generates more cache misses than smaller matrices. 2D block decomposition of matrices that can be placed in L1 CPU cache decreases the cache misses since the operations will access data only stored in L1 cache. However, it also requires additional reads, writes, and operations compared to 1D partitioning, since the blocks are read multiple times.
In this paper we propose a new hybrid 2D/1D partitioning to exploit the advantages of both approaches. The idea is first to partition the matrices in 2D blocks and then to multiply each block with 1D partitioning to achieve minimum cache misses. We select also a block size to fit in L1 cache as 2D block decomposition, but we use rectangle instead of squared blocks in order to minimize the operations but also cache associativity. The experiments show that our proposed algorithm outperforms the 2D blocking algorithm for huge matrices on AMD Phenom CPU.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Communication-optimal parallel algorithm for strassen’s matrix multiplication. In: Proceedinbgs of the 24th ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2012, pp. 193–204. ACM, NY (2012)
Bataineh, S., Khalil, I.M., Khreishah, A., Shi, J.Y.: Performance evaluation of matrix multiplication on a network of work stations with communication delay. JCIS: Journal of Communication and Information Sciences 1(2), 32–44 (2011)
DeFlumere, A., Lastovetsky, A., Becker, B.: Partitioning for parallel matrix-matrix multiplication with heterogeneous processors: The optimal solution. In: 21st International Heterogeneity in Computing Workshop (HCW 2012). IEEE Computer Society Press, Shanghai (2012)
Drevet, C.E., Islam, M.N., Schost, E.: Optimization techniques for small matrix multiplication. ACM Comm. Comp. Algebra 44(3/4), 107–108 (2011)
Gusev, M., Ristov, S.: Matrix multiplication performance analysis in virtualized shared memory multiprocessor. In: MIPRO, 2012 Proceedings of the 35th International Convention, pp. 264–269. IEEE Conference Publications (2012)
Gusev, M., Ristov, S.: Performance gains and drawbacks using set associative cache. Journal of Next Generation Information Technology (JNIT) 3(3), 87–98 (2012)
Hennessy, J.L., Patterson, D.A.: Computer Architecture: A Quantitative Approach, 5th edn. (2012)
Jenks, S.: Multithreading and thread migration using mpi and myrinet. In: Proc. of the Parallel and Distrib. Computing and Systems, PDCS 2004 (2004)
Playne, D.P., Hawick, K.A.: Comparison of gpu architectures for asynchronous communication with finite-di erencing applications. Concurrency and Computation: Practice and Experience 24(1), 73–83 (2012)
Ristov, S., Gusev, M.: Superlinear speedup for matrix multiplication. In: Proceedings of the 34th International Conference on Information Technology Interfaces, ITI 2012, pp. 499–504 (2012)
So, B., Ghuloum, A.M., Wu, Y.: Optimizing data parallel operations on many-core platforms. In: First Workshop on Software Tools for Multi-Core Systems (STMCS), pp. 66–70 (2006)
Williams, S., Oliker, L., Vuduc, R., Shalf, J., Yelick, K., Demmel, J.: Optimization of sparse matrix-vector multiplication on emerging multicore platforms. Parallel Comput. 35(3), 178–194 (2009)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gusev, M., Ristov, S., Velkoski, G. (2013). Hybrid 2D/1D Blocking as Optimal Matrix-Matrix Multiplication. In: Markovski, S., Gusev, M. (eds) ICT Innovations 2012. ICT Innovations 2012. Advances in Intelligent Systems and Computing, vol 207. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-37169-1_2
Download citation
DOI: https://doi.org/10.1007/978-3-642-37169-1_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-37168-4
Online ISBN: 978-3-642-37169-1
eBook Packages: EngineeringEngineering (R0)