Skip to main content

Towards Optimal Fast Matrix Multiplication on CPU-GPU Platforms

  • Conference paper
  • First Online:
Parallel and Distributed Computing, Applications and Technologies (PDCAT 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 13148))

  • 1527 Accesses

Abstract

Increasing computing power has become available through the use of GPUs, bringing new opportunities to accelerate fast matrix multiplication using GPUs. Although researchers have proposed several optimization schemes for the Strassen algorithm on the GPU, they have not fully utilized the computing resources of CPU. In this paper, we propose a CPU-GPU heterogeneous implementation for the Winograd algorithm based on task graph scheduling. It uses work-stealing scheduler to achieve balanced load. We also propose two recursive task graph extension strategies: homogeneous and heterogeneous extension. We invoke different execution strategies in different recursive levels and design a predictor based on the random forest regression model to make a decision. Finally, the experimental evaluations are performed on a CPU-GPU heterogeneous platform. It shows that the improved Winograd algorithm achieves an average speedup of 1.6x, 1.5x and 1.4x against to cuBLAS, Winograd on CPU, and Winograd on GPU for matrices with matrix dimension greater than 5000, respectively.

This work is supported by the National Natural Science Foundation of China (Grant Nos. 61972033).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Communication-optimal parallel algorithm for Strassen’s matrix multiplication. In: Proceedings of the Twenty-Fourth Annual ACM Symposium on Parallelism in Algorithms and Architectures, pp. 193–204 (2012)

    Google Scholar 

  2. Benson, A.R., Ballard, G.: A framework for practical parallel fast matrix multiplication. ACM SIGPLAN Not. 50(8), 42–53 (2015)

    Article  Google Scholar 

  3. Bini, D., et al.: O (n2. 7799) complexity for nxn approximate matrix multiplication (1979)

    Google Scholar 

  4. Coppersmith, D., Winograd, S.: Matrix multiplication via arithmetic progressions. In: Proceedings of the Nineteenth Annual ACM Symposium on Theory of Computing, pp. 1–6 (1987)

    Google Scholar 

  5. D’Alberto, P., Nicolau, A.: Adaptive Winograd’s matrix multiplications. ACM Trans. Math. Softw. (TOMS) 36(1), 1–23 (2009)

    Article  MathSciNet  Google Scholar 

  6. Demmel, J., Dumitriu, I., Holtz, O., Kleinberg, R.: Fast matrix multiplication is stable. Numer. Math. 106(2), 199–224 (2007)

    Article  MathSciNet  Google Scholar 

  7. Demmel, J., et al.: Communication-optimal parallel recursive rectangular matrix multiplication. In: 2013 IEEE 27th International Symposium on Parallel and Distributed Processing, pp. 261–272. IEEE (2013)

    Google Scholar 

  8. D’Alberto, P., et al.: The better accuracy of Strassen-Winograd algorithms (FastMMW). Adv. Linear Algebra Matrix Theory 4(01), 9 (2014)

    Article  Google Scholar 

  9. Huang, J., Smith, T.M., Henry, G.M., van de Geijn, R.A.: Implementing Strassen’s algorithm with BLIS. arXiv preprint arXiv:1605.01078 (2016)

  10. Huang, J., Yu, C.D., Geijn, R.A.v.d.: Strassen’s algorithm reloaded on GPUs. ACM Trans. Math. Softw. (TOMS) 46(1), 1–22 (2020)

    Google Scholar 

  11. Kumar, B., Huang, C.H., Sadayappan, P., Johnson, R.W.: A tensor product formulation of Strassen’s matrix multiplication algorithm with memory reduction. Sci. Program. 4(4), 275–289 (1995)

    Google Scholar 

  12. Lai, P.W., Arafat, H., Elango, V., Sadayappan, P.: Accelerating Strassen-Winograd’s matrix multiplication algorithm on GPUs. In: 20th Annual International Conference on High Performance Computing, pp. 139–148. IEEE (2013)

    Google Scholar 

  13. Le Gall, F.: Powers of tensors and fast matrix multiplication. In: Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation, pp. 296–303 (2014)

    Google Scholar 

  14. Li, J., Ranka, S., Sahni, S.: Strassen’s matrix multiplication on GPUs. In: 2011 IEEE 17th International Conference on Parallel and Distributed Systems, pp. 157–164. IEEE (2011)

    Google Scholar 

  15. Lipshitz, B., Ballard, G., Demmel, J., Schwartz, O.: Communication-avoiding parallel Strassen: implementation and performance. In: SC 2012: Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, pp. 1–11. IEEE (2012)

    Google Scholar 

  16. Pan, V.Y.: Strassen’s algorithm is not optimal trilinear technique of aggregating, uniting and canceling for constructing fast algorithms for matrix operations. In: 19th Annual Symposium on Foundations of Computer Science (SFCS 1978), pp. 166–176. IEEE (1978)

    Google Scholar 

  17. Ray, U., Hazra, T.K., Ray, U.K.: Matrix multiplication using Strassen’s algorithm on CPU & GPU. Int. J. Comput. Sci. Eng. 4(10), 98–105 (2016)

    Google Scholar 

  18. Stothers, A.J.: On the complexity of matrix multiplication (2010)

    Google Scholar 

  19. Strassen, V.: Gaussian elimination is not optimal. Numer. Math. 13(4), 354–356 (1969)

    Article  MathSciNet  Google Scholar 

  20. Strassen, V.: The asymptotic spectrum of tensors and the exponent of matrix multiplication. In: 27th Annual Symposium on Foundations of Computer Science (SFCS 1986), pp. 49–54. IEEE (1986)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yizhuo Wang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Shao, S., Wang, Y., Ji, W., Gao, J. (2022). Towards Optimal Fast Matrix Multiplication on CPU-GPU Platforms. In: Shen, H., et al. Parallel and Distributed Computing, Applications and Technologies. PDCAT 2021. Lecture Notes in Computer Science(), vol 13148. Springer, Cham. https://doi.org/10.1007/978-3-030-96772-7_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-96772-7_21

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-96771-0

  • Online ISBN: 978-3-030-96772-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics