This thesis details an emerging class of programming language designs, called user-schedulable languages, that provide a safe and productive performance engineering environment for modern, heterogeneous hardware. The defining trait of user-schedulable languages is the division of program specification into two key parts: the algorithm, which defines functionally what is to be computed, and the schedule, which defines how the computation should be carried out. Importantly, algorithms have semantics independent of any schedule, and schedules are semantics-preserving with respect to the algorithm. Thus, programmers are freed from a large class of bugs. Because algorithm languages tend to be functional and domain-specific, the scheduling language can be very expressive. Existing scheduling languages include many program transformations, from accelerator offloading to tricky tiling and interleaving strategies. Multiple schedules can be written for different sets of hardware targets and can be maintained independently from one another.
Here, we formally analyze the design of an existing and widely deployed user-schedulable language, Halide, and find and correct several serious bugs and design flaws through this analysis. We also detail both the design and implementation of a new user-schedulable language, Exo, whose design is informed by the lessons learned analyzing Halide. Unlike Halide, which models scheduling as a parameter to a monolithic lowering process, Exo uses a rewrite-based scheduling system. This system doubles as an instruction selection process for custom accelerator hardware; importantly, these instructions can be specified in user programs, rather than inside the compiler itself. We then discuss a novel, high-performance, reference-counting memory management strategy suitable for recursive programs with highly non-local control flow over a (co-)inductive data domain. Finally, practical considerations for language design are discussed; these are lessons learned from maintaining and deploying these systems in practice.
Details
Title
The Design and Implementation of User-Schedulable Languages
Researchers may make free and open use of the UC Berkeley Library’s digitized public domain materials. However, some materials in our online collections may be protected by U.S. copyright law (Title 17, U.S.C.). Use or reproduction of materials protected by copyright beyond that allowed by fair use (Title 17, U.S.C. § 107) requires permission from the copyright owners. The use or reproduction of some materials may also be restricted by terms of University of California gift or purchase agreements, privacy and publicity rights, or trademark law. Responsibility for determining rights status and permissibility of any use or reproduction rests exclusively with the researcher. To learn more or make inquiries, please see our permissions policies (https://www.lib.berkeley.edu/about/permissions-policies).