A Compilation Model for Divergent Parallel Workloads
Alexander J Root, Christophe Gyurgyik, Devanshu Ladsaria, Rohan Sawhney, Jonathan Ragan-Kelley, Andrew Adams, Matt Pharr, Kayvon Fatahalian, Fredrik Kjolstad
Abstract
Efficient execution on modern parallel machines requires more than abundant parallelism; it demands instruction coherence, memory coherence, and load balance to maximize SIMD utilization and memory bandwidth. Efficiently mapping divergent parallel workloads to modern machines, where control flow, memory accesses, and unbounded iteration depend on per-thread runtime values, often requires global program restructuring that trades off increased coherence with reduced locality, parallelism, or extra work. We observe that the key optimizations used to accelerate divergent parallel programs can be expressed as compositions of well-known program transformations from the functional programming and loop optimization communities. We operationalize this insight through parallel dispatch graphs: a compilation model that represents divergent programs by representing control flow, data flow between logical stages, and parallel loops within a single abstraction. To facilitate rapid exploration of points in the optimization space, we provide a scheduling language that includes composable transformations of data-dependent control flow and data flow, together with standard loop transformations and hardware bindings. This separation of concerns allows the core algorithm to remain portable, while the execution schedule can be specialized to the specifics of target hardware and input data values. We evaluate our system using popular applications from the domain of spatial computing, and show that the optimization strategies of hand-optimized parallel tree traversals, path tracers, and Monte Carlo PDE solvers can be reproduced as schedules in our system. Our generated code matches or outperforms the hand-optimized implementations (geomeans 1.02--2.95× faster). Additionally, we demonstrate empirically that the best schedule varies across programs, machines, and inputs.
Create a lesson
Related papers
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminology · Cong Wang, Zhiyang Chen, Fan Long et al.
Tenon: A Unified Programming Framework for Retargetable PIM Compilation
Shared title terminology · Niansong Zhang, Shiran Guo, Zhiru Zhang
Compiling Imperative Hardware Protocol Specifications to Hardware
Shared title terminology · Nikil V. Shyamsunder, Ernest Ng, Adrian Sampson et al.
Compiling Matrix Formulas to Quantum Block Encodings
Shared title terminology · Daksh Shami, Charles Yuan
Super-Analysis for Aggressive yet Scalable Compiler Optimization
Shared title terminology · Amirali Ebrahimzadeh, Amir Shaikhha
MLIRBench - A Benchmark and Dataset for Compiler and Hardware-Aware Reasoning
Shared title terminology · Pranava Sai Maganti, Meghasyam Peddireddy, Muzakker Hossain et al.