skip to main content
research-article
Open Access

Verified code generation for the polyhedral model

Published:04 January 2021Publication History
Skip Abstract Section

Abstract

The polyhedral model is a high-level intermediate representation for loop nests that supports elegantly a great many loop optimizations. In a compiler, after polyhedral loop optimizations have been performed, it is necessary and difficult to regenerate sequential or parallel loop nests before continuing compilation. This paper reports on the formalization and proof of semantic preservation of such a code generator that produces sequential code from a polyhedral representation. The formalization and proofs are mechanized using the Coq proof assistant.

Skip Supplemental Material Section

Supplemental Material

References

  1. Corinne Ancourt and François Irigoin. 1991. Scanning Polyhedra with DO Loops. In PPoPP'91: 3rd symposium on Principles & Practice of Parallel Programming. ACM, 39-50. https://doi.org/10.1145/109625.109631 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Riyadh Baghdadi, Jessica Ray, Malek Ben Romdhane, Emanuele Del Sozzo, Abdurrahman Akkas, Yunming Zhang, Patricia Suriana, Shoaib Kamil, and Saman P. Amarasinghe. 2019. Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code. In CGO 2019: International Symposium on Code Generation and Optimization. IEEE, 193-205. https: //doi.org/10.1109/CGO. 2019.8661197 Google ScholarGoogle ScholarCross RefCross Ref
  3. Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2016. Product programs and relational program logics. J. Log. Algebraic Methods Program. 85, 5 ( 2016 ), 847-859. https://doi.org/10.1016/j.jlamp. 2016. 05.004 Google ScholarGoogle ScholarCross RefCross Ref
  4. Cédric Bastoul. 2004. Code Generation in the Polyhedral Model Is Easier Than You Think. In PACT'04: Proceedings of the 13th International Conference on Parallel Architectures and Compilation Techniques. IEEE, 7-16. https://doi.org/10.1109/ PACT. 2004.11 Google ScholarGoogle ScholarCross RefCross Ref
  5. Ulysse Beaugnon, Alexey Kravets, Sven Van Haastregt, Riyadh Baghdadi, David Tweed, Javed Absar, and Anton Lokhmotov. 2014. VOBLA: a vehicle for optimized basic linear algebra. In LCTES'14: Proceedings of the 2014 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems. ACM, 115-124. https://doi.org/10.1145/2666357.2597818 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. J. Bernstein. 1966. Analysis of Programs for Parallel Processing. IEEE Transactions on Electronic Computers EC-15, 5 (Oct 1966 ), 757-763. https://doi.org/10.1109/PGEC. 1966.264565 Google ScholarGoogle ScholarCross RefCross Ref
  7. Pierre Boulet and Paul Feautrier. 1998. Scanning polyhedra without DO-loops. In PACT'98: conference on Parallel Architectures and Compilation Techniques. IEEE, 4-11. https://doi.org/10.1109/PACT. 1998.727127 Google ScholarGoogle ScholarCross RefCross Ref
  8. Sylvain Boulmé, Alexandre Maréchal, David Monniaux, Michaël Périn, and Hang Yu. 2018. The Verified Polyhedron Library: an Overview. In SYNASC 2018 : 20th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing. IEEE, 9-17. https://doi.org/10.1109/SYNASC. 2018.00014 Google ScholarGoogle ScholarCross RefCross Ref
  9. Chun Chen. 2012. Polyhedra Scanning Revisited. In PLDI 2012: conference on Programming Language Design and Implementation. ACM, 499-508. https://doi.org/10.1145/2254064.2254123 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Berkeley R. Churchill, Oded Padon, Rahul Sharma, and Alex Aiken. 2019. Semantic program alignment for equivalence checking. In PLDI 2019: conference on Programming Language Design and Implementation. ACM, 1027-1040. https: //doi.org/10.1145/3314221.3314596 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Bruno Cuervo Parrino, Julien Narboux, Eric Violard, and Nicolas Magaud. 2012. Dealing with arithmetic overflows in the polyhedral model. In IMPACT 2012 : 2nd International Workshop on Polyhedral Compilation Techniques. https: //hal.inria.fr/hal-00655485Google ScholarGoogle Scholar
  12. Paul Feautrier. 1991. Dataflow analysis of array and scalar references. Int. J. Parallel Program. 20, 1 ( 1991 ), 23-53. https: //doi.org/10.1007/BF01407931 Google ScholarGoogle ScholarCross RefCross Ref
  13. Paul Feautrier and Christian Lengauer. 2011. The Polyhedron Model. In Encyclopedia of Parallel Programming, David Padua (Ed.). Springer, 1581-1592.Google ScholarGoogle Scholar
  14. Alexis Fouilhé and Sylvain Boulmé. 2014. A Certifying Frontend for (Sub)polyhedral Abstract Domains. In VSTTE 2014: Verified Software: Theories, Tools and Experiments (LNCS, Vol. 8471 ). Springer, 200-215. https://doi.org/10.1007/978-3-319-12154-3_13 Google ScholarGoogle ScholarCross RefCross Ref
  15. 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
  16. Tobias Grosser, Sven Verdoolaege, and Albert Cohen. 2015. Polyhedral AST Generation Is More Than Scanning Polyhedra. ACM Trans. Program. Lang. Syst. 37, 4, Article 12 ( July 2015 ), 50 pages. https://doi.org/10.1145/2743016 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Guy Katz, Clark W. Barrett, David L. Dill, Kyle Julian, and Mykel J. Kochenderfer. 2017. Reluplex: An Eficient SMT Solver for Verifying Deep Neural Networks. In CAV 2017: Computer Aided Verification-29th International Conference (LNCS, Vol. 10426 ). Springer, 97-117. https://doi.org/10.1007/978-3-319-63387-9_5 Google ScholarGoogle ScholarCross RefCross Ref
  18. Ramana Kumar, Magnus O. Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: A Verified Implementation of ML. In POPL'14: 41st symposium Principles of Programming Languages. ACM, 179-191. https://doi.org/10.1145/2535838.2535841 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Sudipta Kundu, Zachary Tatlock, and Sorin Lerner. 2009. Proving Optimizations Correct using Parameterized Program Equivalence. In PLDI 2009: conference on Programming Language Design and Implementation. ACM, 327-337. https: //doi.org/10.1145/1542476.1542513 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Leslie Lamport. 1974. The Parallel Execution of DO Loops. Commun. ACM 17, 2 ( 1974 ), 83-93. https://doi.org/10.1145/ 360827.360844 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Xavier Leroy. 2009. Formal Verification of a Realistic Compiler. Commun. ACM 52, 7 ( 2009 ), 107-115. https://doi.org/10. 1145/1538788.1538814 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Lee-Chung Lu. 1991. A Unified Framework for Systemic Loop Transformation. In PPoPP 1991: 3rd Symposium on Principles & Practice of Parallel Programming. ACM, 28-38. https://doi.org/10.1145/109625.109630 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Steven S. Muchnick. 1997. Advanced compiler design and implementation. Morgan Kaufmann.Google ScholarGoogle Scholar
  24. Kedar S. Namjoshi and Nimit Singhania. 2016. Loopy: Programmable and Formally Verified Loop Transformations. In SAS 2016: Static Analysis, 23rd International Symposium (LNCS, Vol. 9837 ). Springer, 383-402. https://doi.org/10.1007/978-3-662-53413-7_19 Google ScholarGoogle ScholarCross RefCross Ref
  25. George C. Necula. 2000. Translation validation for an optimizing compiler. In PLDI 2000: conference on Programming Language Design and Implementation. ACM, 83-95. https://doi.org/10.1145/349299.349314 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Alexandre Pilkiewicz. 2010-2013. s2sLoop: a validator for polyhedral transformations. ( 2010-2013 ). https://github.com/ pilki/s2sLoopGoogle ScholarGoogle Scholar
  27. Amir Pnueli, Michael Siegel, and Eli Singerman. 1998. Translation Validation. In TACAS' 98 : Tools and Algorithms for Construction and Analysis of Systems (LNCS, Vol. 1384 ). Springer, 151-166. https://doi.org/10.1007/BFb0054170 Google ScholarGoogle ScholarCross RefCross Ref
  28. William Pugh. 1991. Uniform techniques for loop optimization. In ICS 1991: 5th international conference on Supercomputing. ACM, 341-352. https://doi.org/10.1145/109025.109108 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Fabien Quilleré, Sanjay Rajopadhye, and Doran Wilde. 2000. Generation of eficient nested loops from polyhedra. International Journal of Parallel Programming 28, 5 ( 2000 ), 469-498. https://doi.org/10.1023/A:1007554627716 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Jonathan Ragan-Kelley, Andrew Adams, Dillon Sharlet, Connelly Barnes, Sylvain Paris, Marc Levoy, Saman Amarasinghe, and Frédo Durand. 2017. Halide: Decoupling Algorithms from Schedules for High-performance Image Processing. Commun. ACM 61, 1 (Dec. 2017 ), 106-115. https://doi.org/10.1145/3150211 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Harenome Razanajato, Vincent Loechner, and Cédric Bastoul. 2017. Splitting Polyhedra to Generate More Eficient Code. In IMPACT 2017 : 7th International Workshop on Polyhedral Compilation Techniques. https://hal.inria.fr/hal-01505764Google ScholarGoogle Scholar
  32. Markus Schordan, Pei-Hung Lin, Daniel J. Quinlan, and Louis-Noël Pouchet. 2014. Verification of Polyhedral Optimizations with Constant Loop Bounds in Finite State Space Computations. In ISoLA 2014: Leveraging Applications of Formal Methods, Verification and Validation (LNCS, Vol. 8803 ). Springer, 493-508. https://doi.org/10.1007/978-3-662-45231-8_41 Google ScholarGoogle ScholarCross RefCross Ref
  33. Alexander Schrijver. 1998. Theory of Linear and Integer Programming. Wiley.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Gagandeep Singh, Timon Gehr, Markus Püschel, and Martin T. Vechev. 2019. An abstract domain for certifying neural networks. Proc. ACM Program. Lang. 3, POPL ( 2019 ), 41 : 1-41 : 30. https://doi.org/10.1145/3290354 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Ross Tate, Michael Stepp, Zachary Tatlock, and Sorin Lerner. 2011. Equality Saturation: A New Approach to Optimization. Log. Methods Comput. Sci. 7, 1 ( 2011 ). https://doi.org/10.2168/LMCS-7( 1 :10) 2011 Google ScholarGoogle ScholarCross RefCross Ref
  36. Konrad Trifunović, Albert Cohen, David Edelsohn, Feng Li, Tobias Grosser, Harsha Jagasia, Razya Ladelsky, Sebastian Pop, Jan Sjödin, and Ramakrishna Upadrasta. 2010. GRAPHITE Two Years After: First Lessons Learned From Real-World Polyhedral Compilation. In GROW' 10 : 2nd GCC Research Opportunities Workshop. https://hal.inria.fr/inria-00551516Google ScholarGoogle Scholar
  37. Jean-Baptiste Tristan, Paul Govereau, and Greg Morrisett. 2011. Evaluating value-graph translation validation for LLVM. In PLDI 2011: conference on Programming Language Design and Implementation. ACM, 295-305. https://doi.org/10.1145/ 1993498.1993533 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Jean-Baptiste Tristan and Xavier Leroy. 2010. A simple, verified validator for software pipelining. In POPL 2010: 37th symposium Principles of Programming Languages. ACM, 83-92. https://doi.org/10.1145/1706299.1706311 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Nicolas Vasilache, Oleksandr Zinenko, Theodoros Theodoridis, Priya Goyal, Zachary Devito, William S. Moses, Sven Verdoolaege, Andrew Adams, and Albert Cohen. 2020. The Next 700 Accelerated Layers: From Mathematical Expressions of Network Computation Graphs to Accelerated GPU Kernels, Automatically. ACM Trans. Archit. Code Optim. 16, 4 ( 2020 ), 38 : 1-38 : 26. https://doi.org/10.1145/3355606 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Sven Verdoolaege, Serge Guelton, Tobias Grosser, and Albert Cohen. 2014. Schedule Trees. In IMPACT 2014: 4th International Workshop on Polyhedral Compilation Techniques, Sanjay Rajopadhye and Sven Verdoolaege (Eds.). https://hal.inria.fr/hal00911894Google ScholarGoogle Scholar
  41. Sven Verdoolaege, Gerda Janssens, and Maurice Bruynooghe. 2012. Equivalence checking of static afine programs using widening to handle recurrences. ACM Trans. Program. Lang. Syst. 34, 3 ( 2012 ), 11 : 1-11 : 35. https://doi.org/10.1145/ 2362389.2362390 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Lenore D. Zuck, Amir Pnueli, Benjamin Goldberg, Clark W. Barrett, Yi Fang, and Ying Hu. 2005. Translation and Run-Time Validation of Loop Transformations. Formal Methods in System Design 27, 3 ( 2005 ), 335-360. https://doi.org/10.1007/s10703-005-3402-z Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Verified code generation for the polyhedral model

          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!