Named Commutative Blocks for Parallelization
Parisa Fathololumi, Adam Chen, Maurice Herlihy, Eric Koskinen
Abstract
This paper proposes a new way to exploit code commutativity to parallelize sequential programs. While prior work provided the ability to identify and exploit commutative function calls or adjacent code blocks, this paper describes the first method that dynamically exploits statically-verified commutativity conditions of arbitrary code regions. In this method, programmers give parameterized names to code blocks anywhere in the program, and provide commutativity expressions over those parameters and the global state. Novel algorithms exploit this commutativity and dependence information to automatically construct a program-specific parallelization scheme, yielding asynchronous tasks executed through a commutativity-aware scheduler. We furthermore show that commutativity conditions can be verified automatically, reducing reliance on manual effort and increasing confidence in correctness. We implement our approach in a new compiler and runtime system called Veracity2G that takes in a sequential program and produces a parallel version that dynamically exploits the commutativity conditions. We experimentally demonstrate that Veracity2G (i) strictly generalizes prior commutativity-based parallelization techniques, (ii) enables parallelization opportunities beyond the reach of existing methods, and (iii) automatically verifies commutativity conditions.
Create a lesson
Related papers
Deadlock-Free Parallel Regions for Projected Workflows
Shared title terminologycs.PLBenedikt Bollig
A Compilation Model for Divergent Parallel Workloads
Shared title terminologycs.PLAlexander J Root, Christophe Gyurgyik, Devanshu Ladsaria et al.
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminologycs.PLCong Wang, Zhiyang Chen, Fan Long et al.
Formalizing \mathsf{einsum} with Named Tensor Notation
Shared title terminologycs.PLYafei Yang, Chung-chieh Shan
Compiling Matrix Formulas to Quantum Block Encodings
Shared title terminologycs.PLDaksh Shami, Charles Yuan