Description |
Virtually all real-valued computations are carried out using floating-point data types and operations. The precision of these data types must be set with the goals of reducing the overall round-off error, but also emphasizing reduced data movement and cache occupancy costs. Tools for floating-point error analysis and precision allocation are fundamental to program understanding and optimization. In this dissertation, we focus on tools for (1) determining the input settings to a floating point routine that maximizes its result error, (2) detecting the inputs which lead to unexpected behavioral deviations from the programmer’s intent, and (3) rigorously allocating precision based on formal analysis via Symbolic Taylor Expansions, and error analysis based on interval functions. Tools for floating-point error estimation can help support activities such as precision allocation, performance optimization, and auto-tuning. We benchmark current abstraction-based error estimation methods, and show that they often do not work at scale. We show that while concrete-testing-based error estimation methods based on maintaining shadow values at higher precision can search out higher error-inducing inputs, suitable heuristic search guidance is key to finding higher errors. We develop a heuristic search algorithm called Binary Guided Random Testing (BGRT). In all of our benchmarks, including many real-world routines, BGRT returns higher guaranteed errors compared to three other search techniques we investigated. In addition to error estimation, we also focus on the problem of divergence detection: when a given floating-point program differs in terms of other discrete outputs with respect to the same program interpreted under reals. This problem has remained open even for everyday programs such as those that compute convex-hulls. We propose a classification of the divergent behaviors exhibited by programs, and propose efficient heuristics to generate inputs causing divergence. Our experimental results demonstrate that our input generation heuristics are far more efficient than random input generation for divergence detection, and can exhibit divergence even for programs with thousands of inputs. For precision allocation, we focus on optimizing arithmetic library routines. We present a rigorous approach based on formal analysis via Symbolic Taylor Expansions, and error analysis based on interval functions. This approach is implemented in an automated tool called FPTUNER that generates and solves a quadratically constrained quadratic program to obtain a precision-annotated version of the given expression. FPTUNER automatically introduces all the requisite precision up/- down casting operations. It also allows users to flexibly control precision allocation through constraints, including capping the number of high precision operators, grouping a collection of operators to allocate the same precision for them (to facilitate vectorization), etc. Our evaluation, including real energy measurements on an ARM (Jetson) hardware platform, demonstrate the degree to which precision choices can be exercised, especially controlling compiler optimizations, and the energy impacts of these allocations. |