skip to main content
research-article
Open Access
Artifacts Available / v1.1

FPL: fast Presburger arithmetic through transprecision

Published:15 October 2021Publication History
Skip Abstract Section

Abstract

Presburger arithmetic provides the mathematical core for the polyhedral compilation techniques that drive analytical cache models, loop optimization for ML and HPC, formal verification, and even hardware design. Polyhedral compilation is widely regarded as being slow due to the potentially high computational cost of the underlying Presburger libraries. Researchers typically use these libraries as powerful black-box tools, but the perceived internal complexity of these libraries, caused by the use of C as the implementation language and a focus on end-user-facing documentation, holds back broader performance-optimization efforts. With FPL, we introduce a new library for Presburger arithmetic built from the ground up in modern C++. We carefully document its internal algorithmic foundations, use lightweight C++ data structures to minimize memory management costs, and deploy transprecision computing across the entire library to effectively exploit machine integers and vector instructions. On a newly-developed comprehensive benchmark suite for Presburger arithmetic, we show a 5.4x speedup in total runtime over the state-of-the-art library isl in its default configuration and 3.6x over a variant of isl optimized with element-wise transprecision computing. We expect that the availability of a well-documented and fast Presburger library will accelerate the adoption of polyhedral compilation techniques in production compilers.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a recorded presentation of a talk on the paper "FPL: Fast Presburger Arithmetic through Transprecision", . In the paper, we introduce a new library for Presburger arithmetic built from the ground up in modern C++. Presburger arithmetic We carefully document its internal algorithmic foundations, use lightweight C++ data structures to minimize memory management costs, and deploy transprecision computing across the entire library to effectively exploit machine integers and vector instructions. On a newly-developed comprehensive benchmark suite for Presburger arithmetic, we show a 5.4x speedup in total runtime over the state-of-the-art library isl in its default configuration and 3.6x over a variant of isl optimized with element-wise transprecision computing. We expect that the availability of a well-documented and fast Presburger library will accelerate the adoption of polyhedral compilation techniques in production compilers.

References

  1. Riyadh Baghdadi, Jessica Ray, Malek Ben Romdhane, Emanuele Del Sozzo, Abdurrahman Akkas, Yunming Zhang, Patricia Suriana, Shoaib Kamil, and Saman Amarasinghe. 2019. Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code. In Proceedings of the 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO 2019). IEEE Press, 193–205. isbn:9781728114361 https://dl.acm.org/doi/10.5555/3314872.3314896 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. 2008. The Parma Polyhedra Library: Toward a Complete Set of Numerical Abstractions for the Analysis and Verification of Hardware and Software Systems. Sci. Comput. Program., 72, 1–2 (2008), June, 3–21. issn:0167-6423 https://doi.org/10.1016/j.scico.2007.08.001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. S Bazaraa and J. J. Jarvis. 1977. Linear Programming and Network Flows. John Wiley & Sons, Ltd. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Uday Bondhugula and J. Ramanujam. 2007. Pluto: A practical and fully automatic polyhedral parallelizer and locality optimizer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Tianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Q. Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, Carlos Guestrin, and Arvind Krishnamurthy. 2018. TVM: An Automated End-to-End Optimizing Compiler for Deep Learning. In 13th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2018, Carlsbad, CA, USA, October 8-10, 2018, Andrea C. Arpaci-Dusseau and Geoff Voelker (Eds.). USENIX Association, 578–594. https://www.usenix.org/conference/osdi18/presentation/chen Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. David Detlefs, Greg Nelson, and James B. Saxe. 2005. Simplify: A Theorem Prover for Program Checking. J. ACM, 52, 3 (2005), May, 365–473. issn:0004-5411 https://doi.org/10.1145/1066100.1066102 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Paul Feautrier. 1988. Parametric integer programming. RAIRO-Operations Research, 22, 3 (1988), 243–268. https://doi.org/10.1051/ro/1988220302431 Google ScholarGoogle ScholarCross RefCross Ref
  8. Alexis Fouilhe. 2015. Revisiting the abstract domain of polyhedra : constraints-only representation and formal proof. Université Grenoble Alpes. https://tel.archives-ouvertes.fr/tel-01286086Google ScholarGoogle Scholar
  9. Tobias Grosser, Armin Größ linger, and Christian Lengauer. 2012. Polly – Performing polyhedral optimizations on a low-level intermediate representation. Parallel Processing Letters, 22, 04 (2012), https://doi.org/10.1142/S0129626412500107 Google ScholarGoogle ScholarCross RefCross Ref
  10. Tobias Grosser and Torsten Hoefler. 2016. Polly-ACC Transparent Compilation to Heterogeneous Hardware. In Proceedings of the 2016 International Conference on Supercomputing (ICS ’16). Association for Computing Machinery, New York, NY, USA. Article 1, 13 pages. isbn:9781450343619 https://doi.org/10.1145/2925426.2926286 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Tobias Grosser, Theodoros Theodoridis, Maximilian Falkenstein, Arjun Pitchanathan, Michael Kruse, Manuel Rigger, Zhendong Su, and Torsten Hoefler. 2020. Fast Linear Programming through Transprecision Computing on Small and Sparse Data. Proc. ACM Program. Lang., 4, OOPSLA (2020), Article 195, Nov., 28 pages. https://doi.org/10.1145/3428263 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Tobias Gysi, Tobias Grosser, Laurin Brandner, and Torsten Hoefler. 2019. A Fast Analytical Model of Fully Associative Caches. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019). Association for Computing Machinery, New York, NY, USA. 816–829. isbn:9781450367127 https://doi.org/10.1145/3314221.3314606 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Christoph Haase. 2018. A Survival Guide to Presburger Arithmetic. ACM SIGLOG News, 5, 3 (2018), July, 67–82. https://doi.org/10.1145/3242953.3242964 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Bertrand Jeannet and Antoine Miné. 2009. Apron: A Library of Numerical Abstract Domains for Static Analysis. In Proceedings of the 21st International Conference on Computer Aided Verification (CAV ’09). Springer-Verlag, Berlin, Heidelberg. 661–667. isbn:9783642026577 https://doi.org/10.1007/978-3-642-02658-4_52 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Wayne Kelly, Vadim Maslov, William Pugh, Evan Rosser, Tatiana Shpeisman, and Dave Wonnacott. 1996. The Omega calculator and library, version 1.1. 0. College Park, MD, 20742 (1996), 18.Google ScholarGoogle Scholar
  16. Tim King, Clark Barrett, and Cesare Tinelli. 2014. Leveraging linear and mixed integer programming for SMT. In 2014 Formal Methods in Computer-Aided Design (FMCAD). 139–146. https://doi.org/10.1109/FMCAD.2014.6987606 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In International Symposium on Code Generation and Optimization, 2004. CGO 2004.. 75–86. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Chris Lattner, Mehdi Amini, Uday Bondhugula, Albert Cohen, Andy Davis, Jacques Pienaar, River Riddle, Tatiana Shpeisman, Nicolas Vasilache, and Oleksandr Zinenko. 2021. MLIR: Scaling Compiler Infrastructure for Domain Specific Computation. In 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). 2–14. https://doi.org/10.1109/CGO51591.2021.9370308 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Vincent Loechner. 1999. PolyLib: A library for manipulating parameterized polyhedra.Google ScholarGoogle Scholar
  20. László Lovász and Herbert E. Scarf. 1992. The Generalized Basis Reduction Algorithm. Mathematics of Operations Research, 17, 3 (1992), 751–764. issn:0364765X, 15265471 http://www.jstor.org/stable/3689761Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Benoit Meister, Nicolas Vasilache, David Wohlford, Muthu Manikandan Baskaran, Allen Leung, and Richard Lethin. 2011. R-Stream Compiler. Springer US, Boston, MA. 1756–1765. isbn:978-0-387-09766-4 https://doi.org/10.1007/978-0-387-09766-4_515 Google ScholarGoogle ScholarCross RefCross Ref
  22. Kedar S. Namjoshi and Nimit Singhania. 2016. Loopy: Programmable and Formally Verified Loop Transformations. In Static Analysis - 23rd International Symposium, SAS 2016, Edinburgh, UK, September 8-10, 2016, Proceedings, Xavier Rival (Ed.) (Lecture Notes in Computer Science, Vol. 9837). Springer, 383–402. https://doi.org/10.1007/978-3-662-53413-7_19 Google ScholarGoogle ScholarCross RefCross Ref
  23. Nicholas Nethercote and Julian Seward. 2007. Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’07). Association for Computing Machinery, New York, NY, USA. 89–100. isbn:9781595936332 https://doi.org/10.1145/1250734.1250746 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Auguste Olivry, Julien Langou, Louis-Noël Pouchet, P. Sadayappan, and Fabrice Rastello. 2020. Automated Derivation of Parametric Data Movement Lower Bounds for Affine Programs. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, New York, NY, USA. 808–822. isbn:9781450376136 https://doi.org/10.1145/3385412.3385989 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Arjun Pitchanathan, Christian Ulmann, Michel Weber, Torsten Hoefler, and Tobias Grosser. 2021. Replication Package for Article: FPL: Fast Presburger Arithmetic through Transprecision. https://doi.org/10.1145/3462302Google ScholarGoogle Scholar
  26. Louis-Noël Pouchet. 2012. Polybench: The polyhedral benchmark suite.Google ScholarGoogle Scholar
  27. Louis-Noel Pouchet, Peng Zhang, P. Sadayappan, and Jason Cong. 2013. Polyhedral-Based Data Reuse Optimization for Configurable Computing. In Proceedings of the ACM/SIGDA International Symposium on Field Programmable Gate Arrays (FPGA ’13). Association for Computing Machinery, New York, NY, USA. 29–38. isbn:9781450318877 https://doi.org/10.1145/2435264.2435273 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley & Sons, Inc., USA. isbn:0471908541 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Ron Shamir. 1987. The Efficiency of the Simplex Method: A Survey. Management Science, 33, 3 (1987), 301–334. https://doi.org/10.1287/mnsc.33.3.301 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Gagandeep Singh, Markus Püschel, and Martin Vechev. 2015. Making Numerical Program Analysis Fast. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’15). Association for Computing Machinery, New York, NY, USA. 303–313. isbn:9781450334686 https://doi.org/10.1145/2737924.2738000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Nicolas Vasilache, Oleksandr Zinenko, Theodoros Theodoridis, Priya Goyal, Zachary DeVito, William S. Moses, Sven Verdoolaege, Andrew Adams, and Albert Cohen. 2018. Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions. arXiv e-prints, Article arXiv:1802.04730, Feb., arXiv:1802.04730 pages. arxiv:cs.PL/1802.04730.Google ScholarGoogle Scholar
  32. Sven Verdoolaege. 2010. isl: An Integer Set Library for the Polyhedral Model. In ICMS. 6327, 299–302. https://doi.org/10.1007/978-3-642-15582-6_49 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Sven Verdoolaege. 2015. Integer set coalescing. In International Workshop on Polyhedral Compilation Techniques, Date: 2015/01/19-2015/01/19, Location: Amsterdam, The Netherlands.Google ScholarGoogle Scholar
  34. Sven Verdoolaege. 2016. Presburger formulas and polyhedral compilation.Google ScholarGoogle Scholar
  35. Sven Verdoolaege, Juan Carlos Juega, Albert Cohen, José Ignacio Gómez, Christian Tenllado, and Francky Catthoor. 2013. Polyhedral Parallel Code Generation for CUDA. ACM Trans. Archit. Code Optim., 9, 4 (2013), Article 54, Jan., 23 pages. issn:1544-3566 https://doi.org/10.1145/2400682.2400713 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. FPL: fast Presburger arithmetic through transprecision

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!