Skip to main content

Mostly Automated Formal Verification of Loop Dependencies with Applications to Distributed Stencil Algorithms

  • Conference paper
  • First Online:
Interactive Theorem Proving (ITP 2016)

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

Included in the following conference series:

Abstract

The class of stencil programs involves repeatedly updating elements of arrays according to fixed patterns, referred to as stencils. Stencil problems are ubiquitous in scientific computing and are used as an ingredient to solve more involved problems. Their high regularity allows massive parallelization. Two important challenges in designing such algorithms are cache efficiency and minimizing the number of communication steps between nodes. In this paper, we introduce a mathematical framework for a crucial aspect of formal verification of both sequential and distributed stencil algorithms, and we describe its Coq implementation. We present a domain-specific embedded programming language with support for automating the most tedious steps of proofs that nested loops respect dependencies, applicable to sequential and distributed examples. Finally, we evaluate the robustness of our library by proving the dependency-correctness of some real-world stencil algorithms, including a state-of-the-art cache-oblivious sequential algorithm, as well as two optimized distributed kernels.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Notes

  1. 1.

    https://github.com/mit-plv/stencils.

  2. 2.

    In this paper, for all \(a,b\in \mathbb Z\), we write \([\![a,b]\!]\) for \(\{n \in \mathbb Z: a \le n \le b\}\).

References

  1. Betts, A., Chong, N., Donaldson, A., Qadeer, S., Thomson, P.: GPUVerify: a verifier for GPU kernels. In: Proceedings of the OOPSLA, pp. 113–132. ACM (2012)

    Google Scholar 

  2. Boldo, S., Clément, F., Filliâtre, J.-C., Mayero, M., Melquiond, G., Weis, P.: Formal proof of a wave equation resolution scheme: the method error. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 147–162. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  3. Boldo, S., Clément, F., Filliâtre, J.C., Mayero, M., Melquiond, G., Weis, P.: Wave equation numerical resolution: a comprehensive mechanized proof of a C program. J. Autom. Reasoning 50(4), 423–456 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  4. Epperson, J.F.: An Introduction to Numerical Methods and Analysis. Wiley, New York (2014)

    MATH  Google Scholar 

  5. Feautrier, P.: Automatic parallelization in the polytope model. In: Perrin, G.-R., Darte, A. (eds.) The Data Parallel Programming Model. LNCS, vol. 1132, pp. 79–103. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  6. Frigo, M., Strumpen, V.: Cache oblivious stencil computations. In: Proceedings of the Supercomputing, pp. 361–366. ACM (2005)

    Google Scholar 

  7. Frigo, M., Strumpen, V.: The cache complexity of multithreaded cache oblivious algorithms. Theory Comput. Syst. 45(2), 203–233 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  8. Gardner, M.: Mathematical games - The fantastic combinations of John Conway’s new solitaire game "Life". Sci. Am. 223(4), 120–123 (1970)

    Article  Google Scholar 

  9. Immler, F., Hölzl, J.: Numerical analysis of ordinary differential equations in Isabelle/HOL. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 377–392. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  10. Kelly, W., Pugh, W.: A unifying framework for iteration reordering transformations. In: Proceedings of the ICAPP, vol. 1, pp. 153–162. IEEE (1995)

    Google Scholar 

  11. LeVeque, R.J.: Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems, vol. 98. SIAM, Philadelphia (2007)

    Book  MATH  Google Scholar 

  12. Li, G., Gopalakrishnan, G.: Scalable SMT-based verification of GPU kernel functions. In: Proceedings of the FSE, pp. 187–196. ACM (2010)

    Google Scholar 

  13. Li, G., Li, P., Sawaya, G., Gopalakrishnan, G., Ghosh, I., Rajan, S.P.: GKLEE: concolic verification and test generation for GPUs. In: PPOPP, pp. 215–224 (2012)

    Google Scholar 

  14. Loechner, V.: PolyLib: a library for manipulating parameterized polyhedra(1999). http://camlunity.ru/swap/Library/Conflux/Techniques%20-%20Code%20Analysis%20and%20Transformations%20(Polyhedral)/Free%20Libraries/polylib.ps

  15. Maydan, D.E., Hennessy, J.L., Lam, M.S.: Efficient and exact data dependence analysis. In: Proceedings of the PLDI, PLDI 1991, pp. 1–14. ACM (1991)

    Google Scholar 

  16. Orchard, D., Mycroft, A.: Efficient and correct stencil computation via pattern matching and static typing. arXiv preprint arXiv:1109.0777 (2011)

  17. Pugh, W.: The Omega test: a fast and practical integer programming algorithm for dependence analysis. In: Proceedings of the Supercomputing, pp. 4–13. ACM (1991)

    Google Scholar 

  18. Solar-Lezama, A., Arnold, G., Tancau, L., Bodik, R., Saraswat, V., Seshia, S.: Sketching stencils. In: Proceedings of the PLDI, pp. 167–178. ACM (2007)

    Google Scholar 

  19. Tang, Y., Chowdhury, R.A., Kuszmaul, B.C., Luk, C.K., Leiserson, C.E.: The Pochoir stencil compiler. In: Proceedings of the SPAA, pp. 117–128. ACM (2011)

    Google Scholar 

  20. Valiant, L.G.: A bridging model for parallel computation. Commun. ACM 33(8), 103–111 (1990)

    Article  Google Scholar 

  21. Xu, Z., Kamil, S., Solar-Lezama, A.: MSL: a synthesis enabled language for distributed implementations. In: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 311–322. IEEE Press (2014)

    Google Scholar 

Download references

Acknowledgments

This work was supported in part by the U.S. Department of Energy, Office of Science, Advanced Scientific Computing Research Program, under Award Number DE-SC0008923; and by National Science Foundation grant CCF-1253229. We also thank Shoaib Kamil for feedback on this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Adam Chlipala .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Grégoire, T., Chlipala, A. (2016). Mostly Automated Formal Verification of Loop Dependencies with Applications to Distributed Stencil Algorithms. In: Blanchette, J., Merz, S. (eds) Interactive Theorem Proving. ITP 2016. Lecture Notes in Computer Science(), vol 9807. Springer, Cham. https://doi.org/10.1007/978-3-319-43144-4_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-43144-4_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-43143-7

  • Online ISBN: 978-3-319-43144-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics