Many-Core Compiler Fuzzing

241
Опубликовано 22 июня 2016, 2:45
Parallel programming models for many-core systems, such as the OpenCL programming model, claim to allow the construction of portable many-core software. Though performance portability may be an elusive goal, functional portability should not be. Functional portability depends on reliable compilers for many-core programming languages. This presents a real challenge for industry because many-core devices, such as GPUs, are evolving rapidly, as are the associated many-core languages (e.g., a revision of the OpenCL specification appears approximately once every 18 months). Compiler-writers are thus continually playing catch-up. I will present recent ideas on how to apply random testing (fuzzing) to many-core compilers, in the context of OpenCL. The aim of this work is to help vendors to improve the quality of their compilers by discovering bugs quickly. Following up on successful prior works on sequential compiler testing, we have designed two techniques for generating random OpenCL kernels for purposes of compiler testing. The first approach builds on the Csmith project from the University of Utah (PLDI'11). Here, we generate random OpenCL kernels that are guaranteed to be free from undefined behavior and to behave deterministically. For such a kernel, differing results between two OpenCL implementations indicates that one of the implementations has compiled the kernel erroneously. The second approach builds on the "equivalence modulo inputs" idea from researchers at UC Davis (PLDI'14). Here we start with an OpenCL kernel and generate mutations from the kernel such that, for a given input, each mutant is guaranteed by construction to compute the same result as the original kernel. In this case, observable differences between mutants for the given input indicate compiler bugs. I will report on a large testing campaign with respect to 21 OpenCL (device, compiler) configurations. We found bugs in every configuration that we tested, including in compilers from all the major device vendors, many of which have been fixed in response to our reports. I will show some examples of the bugs the technique has uncovered, and will discuss open problems in this area. This is joint work with Christopher Lidbury, Andrei Lascu and Nathan Chong, and is due to appear at PLDI'15.
автотехномузыкадетское