Sketching stencils

  title={Sketching stencils},
  author={Armando Solar-Lezama and Gilad Arnold and Liviu Tancau and Rastislav Bod{\'i}k and Vijay A. Saraswat and Sanjit A. Seshia},
  booktitle={PLDI '07},
Performance of stencil computations can be significantly improved through smart implementations that improve memory locality, computation reuse, or parallelize the computation. Unfortunately, efficient implementations are hard to obtain because they often involve non-traditional transformations, which means that they cannot be produced by optimizing the reference stencil with a compiler. In fact, many stencils are produced by code generators that were tediously handcrafted. In this paper, we… 

Figures and Tables from this paper

Sketching concurrent data structures
PSketch is a program synthesizer that helps programmers implement concurrent data structures using a new counterexample-guided inductive synthesis algorithm (CEGIS) that generalizes the original sketch synthesis algorithm from Solar-Lezama
Verified lifting of stencil computations
The benefits of verified lifting are demonstrated by first automatically summarizing Fortran source code into a high-level predicate language, and subsequently translating the lifted summaries into Halide, with the translated code achieving median performance speedups of 4.1X and up to 24X for non-trivial stencils as compared to the original implementation.
Program synthesis by sketching
Sketching is introduced, a new style of synthesis that offers a fresh approach to the synergy problem and shows that sketching is a viable approach to making synthesis practical in a general programming context.
Program sketching
  • Armando Solar-Lezama
  • Computer Science
    International Journal on Software Tools for Technology Transfer
  • 2012
CEGIS combines a SAT-based inductive synthesizer with an automated validation procedure, a bounded model-checker, that checks whether the candidate implementation produced by inductive synthesis is indeed correct and to produce new counterexamples.
Approximate Program Synthesis
This paper formalizes the approximate synthesis (AppSyn) problem as the task of finding an optimal program that is approximately correct, and shows how existing approximation techniques fit into this framework.
Specification-based sketching with Sketch
This paper describes the implementation of Sketch# on top of Spec# and its program verifier Boogie, and recounts the experience applying the tool to aid optimistic parallel execution frameworks, where it was used to discover and verify operation inverses, commutativity conditions, and operational transformations for several data structures.
Generating and auto-tuning parallel stencil codes
A software framework, Patus, which generates high performance stencil codes for different types of hardware platforms, including current multicore CPU and graphics processing unit architectures and the proposed key ingredients to achieve the goals of productivity, portability, and performance are domain specific languages (DSLs) and the auto-tuning methodology.
Mostly Automated Formal Verification of Loop Dependencies with Applications to Distributed Stencil Algorithms
This paper presents 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, and describes its Coq implementation.
StenSAL: A Single Assignment Language for Relentlessly Executing Explicit Stencil Algorithms
This work provides a description of the StenSAL language and grammar, some of the sanity checks that can be performed on Sten sAL programs before code generation, and how the compiler translates Sten SAL into Python.
Optimizing synthesis with metasketches
Many advanced programming tools---for both end-users and expert developers---rely on program synthesis to automatically generate implementations from high-level specifications. These tools often need


Combinatorial sketching for finite programs
SKETCH is a language for finite programs with linguistic support for sketching and its combinatorial synthesizer is complete for the class of finite programs, guaranteed to complete any sketch in theory, and in practice has scaled to realistic programming problems.
Programming by sketching for bit-streaming programs
StreamBit is developed as a sketching methodology for the important class of bit-streaming programs (e.g., coding and cryptography), which allows a programmer to write clean and portable reference code, and then obtain a high-quality implementation by simply sketching the outlines of the desired implementation.
Implicit and explicit optimizations for stencil computations
Several optimizations on both the conventional cache-based memory systems of the Itanium 2, Opteron, and Power5, as well as the heterogeneous multicore design of the Cell processor are examined, including both an implicit cache oblivious approach and a cache-aware algorithm blocked to match the cache structure.
Linear analysis and optimization of stream programs
It is demonstrated that several algorithmic transformations, traditionally hand-tuned by DSP experts, can be completely automated by the compiler, and a 450% performance improvement over the benchmark suite is demonstrated.
Telescoping Languages: A System for Automatic Generation of Domain Languages
The approach calls for using a library-preprocessing phase to extensively analyze and optimize collections of libraries that define an extended language, which enables script optimization to benefit from the intense analysis performed during preprocessing without repaying its price.
Compiling Stencils in High Performance Fortran
This paper presents a general- purpose compiler optimization strategy that generates efficient code for a wide class of stencil computations expressed using Fortran90 array constructs by orchestrating a set of program transformations that minimize both intraprocessor and interprocessor data movement implied by Fortran 90 array operations.
The memory behavior of cache oblivious stencil computations
A cache oblivious algorithm for stencil computations, which arise for example in finite-difference methods, applies to arbitrary stencils in n-dimensional spaces and exploits temporal locality optimally throughout the entire memory hierarchy.
Scalable error detection using boolean satisfiability
A software error-detection tool that exploits recent advances in boolean satisfiability (SAT) solvers, and is path sensitive, precise down to the bit level, and models pointers and heap data.
A programmer's guide to ZPL
This guide provides a complete introduction to ZPL and assumes that the reader is experienced with an imperative language such as C, Fortran, or Pascal, and explains in an intuitive manner how the constructs work.
Embedded Software Verification Using Symbolic Execution and Uninterpreted Functions
This paper provides an introduction to symbolic simulation and uninterpreted functions for automatic, formal verification of low-level embedded software, and a review of the results.