Skip to main content

Compiling Linear Algebra Expressions into Efficient Code

  • Conference paper
  • First Online:
Book cover Computational Science – ICCS 2022 (ICCS 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13351))

Included in the following conference series:

Abstract

In textbooks, linear algebra expressions often use indices to specify the elements of variables. This index form expressions cannot be directly translated into efficient code, since optimized linear algebra libraries and frameworks require expressions in index-free form. To address this problem, we developed Lina, a tool that automatically converts linear algebra expressions with indices into index-free linear algebra expressions that we map efficiently to NumPy and Eigen code.

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 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Ascher, D., Dubois, P.F., Hinsen, K., Hugunin, J., Oliphant, T., et al.: Numerical Python (2001)

    Google Scholar 

  2. Barthels, H., Psarras, C., Bientinesi, P.: Linnea: automatic generation of efficient linear algebra programs. ACM Trans. Math. Softw. 47(3), 1–26 (2021)

    Article  MathSciNet  Google Scholar 

  3. Baumgartner, G., et al.: Synthesis of high-performance parallel programs for a class of ab initio quantum chemistry models. Proc. IEEE 93(2), 276–292 (2005)

    Article  Google Scholar 

  4. Bilmes, J.A., Asanovic, K., Chin, C., Demmel, J.: Author retrospective for optimizing matrix multiply using PHiPAC: a portable high-performance ANSI C coding methodology. In: ACM International Conference on Supercomputing 25th Anniversary Volume. ACM (2014)

    Google Scholar 

  5. Buitinck, L., et al.: API design for machine learning software: experiences from the Scikit-learn project. In: ECML PKDD Workshop (2013)

    Google Scholar 

  6. Cai, X., Langtangen, H.P., Moe, H.: On the performance of the python programming language for serial and parallel scientific computations. Sci. Program. 13(1) (2005)

    Google Scholar 

  7. Franchetti, F., et al.: SPIRAL: extreme performance portability. Proc. IEEE 106(11), 1935–1968 (2018)

    Article  Google Scholar 

  8. Guennebaud, G., Jacob, B., et al.: Eigen v3. http://eigen.tuxfamily.org (2010)

  9. Harris, C.R., et al.: Array programming with NumPy. Nature 585(7825), 357–362 (2020)

    Article  Google Scholar 

  10. The Mathworks Inc, Natick, Massachusetts: MATLAB version R2021a (2021)

    Google Scholar 

  11. Matthews, D.A.: High-performance tensor contraction without transposition. SIAM J. Sci. Comput. 40(1), C1–C24 (2018)

    Article  MathSciNet  Google Scholar 

  12. Nuzman, D., et al.: Vapor SIMD: auto-vectorize once, run everywhere. In: Proceedings of the CGO 2011. IEEE Computer Society (2011)

    Google Scholar 

  13. Owen, A.B.: A robust hybrid of lasso and ridge regression. Contemp. Math. 443(7), 59–72 (2007)

    Article  MathSciNet  Google Scholar 

  14. Psarras, C., Barthels, H., Bientinesi, P.: The linear algebra mapping problem. arXiv preprint arXiv:1911.09421 (2019)

  15. Sethi, R., Ullman, J.D.: The generation of optimal code for arithmetic expressions. J. ACM 17(4), 715–728 (1970)

    Article  MathSciNet  Google Scholar 

  16. Spampinato, D.G., Fabregat-Traver, D., Bientinesi, P., Püschel, M.: Program generation for small-scale linear algebra applications. In: Proceedings of the 2018 International Symposium on Code Generation and Optimization. ACM (2018)

    Google Scholar 

  17. Vasilache, N., et al.: Tensor comprehensions: framework-agnostic high-performance machine learning abstractions. CoRR abs/1802.04730 (2018)

    Google Scholar 

Download references

Acknowledgements

This work was supported by the Carl Zeiss Foundation within the project Interactive Inference and from the Ministry for Economics, Sciences and Digital Society of Thuringia (TMWWDG), under the framework of the Landesprogramm ProDigital (DigLeben-5575/10-9).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Julien Klaus .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Klaus, J., Blacher, M., Giesen, J., Rump, P.G., Wiedom, K. (2022). Compiling Linear Algebra Expressions into Efficient Code. In: Groen, D., de Mulatier, C., Paszynski, M., Krzhizhanovskaya, V.V., Dongarra, J.J., Sloot, P.M.A. (eds) Computational Science – ICCS 2022. ICCS 2022. Lecture Notes in Computer Science, vol 13351. Springer, Cham. https://doi.org/10.1007/978-3-031-08754-7_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-08754-7_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-08753-0

  • Online ISBN: 978-3-031-08754-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics