Safe programmable speculative parallelism

Execution order constraints imposed by dependences can serialize computation, preventing parallelization of code and algorithms. Speculating on the value(s) carried by dependences is one way to break such critical dependences. Value speculation has been used effectively at a low level, by compilers and hardware. In this paper, we focus on the use of speculation by programmers as an algorithmic paradigm to parallelize seemingly sequential code. We propose two new language constructs, speculative composition and speculative iteration. These constructs enable programmers to declaratively express speculative parallelism in programs: to indicate when and how to speculate, increasing the parallelism in the program, without concerning themselves with mundane implementation details. We present a core language with speculation constructs and mutable state and present a formal operational semantics for the language. We use the semantics to define the notion of a correct speculative execution as one that is equivalent to a non-speculative execution. In general, speculation requires a runtime mechanism to undo the effects of speculative computation in the case of mis predictions. We describe a set of conditions under which such rollback can be avoided. We present a static analysis that checks if a given program satisfies these conditions. This allows us to implement speculation efficiently, without the overhead required for rollbacks. We have implemented the speculation constructs as a C# library, along with the static checker for safety. We present an empirical evaluation of the efficacy of this approach to parallelization.

[1]  Josep Torrellas,et al.  Eliminating squashes through learning cross-thread violations in speculative parallelization for multiprocessors , 2002, Proceedings Eighth International Symposium on High Performance Computer Architecture.

[2]  Antonia Zhai,et al.  Improving value communication for thread-level speculation , 2002, Proceedings Eighth International Symposium on High Performance Computer Architecture.

[3]  Dan Grossman,et al.  High-level small-step operational semantics for transactions , 2008, POPL '08.

[4]  Kunle Olukotun,et al.  The Atomos transactional programming language , 2006, PLDI '06.

[5]  Keshav Pingali,et al.  Optimistic parallelism requires abstractions , 2009, CACM.

[6]  Suresh Jagannathan,et al.  Safe futures for Java , 2005, OOPSLA '05.

[7]  Mikko H. Lipasti,et al.  Value locality and load value prediction , 1996, ASPLOS VII.

[8]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[9]  Chen Ding,et al.  Software behavior oriented parallelization , 2007, PLDI '07.

[10]  Martín Abadi,et al.  Semantics of transactional memory and automatic mutual exclusion , 2011, TOPL.

[11]  Dean M. Tullsen,et al.  Storageless value prediction using prior register values , 1999, ISCA.

[12]  Marc H. Scholl,et al.  Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery , 2001, SGMD.

[13]  Easwaran Raman,et al.  Spice: speculative parallel iteration chunk execution , 2008, CGO '08.

[14]  Dean M. Tullsen,et al.  Mitosis compiler: an infrastructure for speculative threading based on pre-computation slices , 2005, PLDI '05.

[15]  Leo A. Meyerovich,et al.  Parallelizing the web browser , 2009 .

[16]  H SchollMarc,et al.  Transactional information systems , 2001 .

[17]  Luis Ceze,et al.  Implicit parallelism with ordered transactions , 2007, PPoPP.

[18]  Shmuel Tomi Klein,et al.  Parallel Huffman Decoding with Applications to JPEG Files , 2003, Comput. J..

[19]  Martin C. Rinard,et al.  Purity and Side Effect Analysis for Java Programs , 2005, VMCAI.

[20]  Gottfried Vossen,et al.  Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery , 2002 .

[21]  Butler W. Lampson Lazy and speculative execution in computer systems , 2008, ICFP.

[22]  Somesh Jha,et al.  Multi-byte Regular Expression Matching with Speculation , 2009, RAID.

[23]  Monica S. Lam,et al.  In search of speculative thread-level parallelism , 1999, 1999 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00425).

[24]  James Demmel,et al.  the Parallel Computing Landscape , 2022 .

[25]  Mark A. Franklin,et al.  Parallel Simulated Annealing using Speculative Computation , 1991, IEEE Trans. Parallel Distributed Syst..