Configurable Runtime Analysis for Floating-point Tuning


CRAFT aims to help programmers analyze their programs for numerical inaccuracies introduced by floating-point arithmetic. This includes detecting various events such as cancellations, as well as automated analysis to aid in precision-level decision-making.

Screen Shots




The CRAFT framework uses binary instrumentation and modification to analyze target programs at runtime, and provides graphical interfaces to interpret the results. We have demonstrated the framework’s capability by using it to implement many types of analysis. This includes simple analyses such as instruction counting, NaN detection, and range tracking, as well as three more complex analyses:

  1. We have developed a technique for detecting numerical cancellation. This technique instruments addition and subtraction operations, checking their operands for cancellation events at runtime. The analysis reports individual cancellations as well as aggregate cancellation statistics. We have demon- strated this analysis in various contexts, showing its efficacy and potential applications.
  2. We have developed techniques for implementing mixed-precision configurations and automatically finding valid mixed-precision replacements. This technique modifies a binary, replacing each floating-point instruction with new code that runs the original operation in the desired precision (single or double). Developers can now quickly prototype mixed-precision configurations without modifying the source code or recompiling. We have also described an automated search process that uses this prototyping technique to find individual program components that can be reconfigured to use single-precision arithmetic without causing the overall program to fail a verification test. This search process can focus on either the arithmetic operations themselves or the memory locations accessed by the operations. We have demonstrated this technique by running it on a variety of applications, highlighting the insights provided by the analysis. In one case, we obtained a speedup of nearly 2X by reconfiguring a microkernel to use single-precision arithmetic.
  3. We have developed a technique for performing generalized reduced-precision analysis. This technique truncates the results of floating-point operations, simulating the use of lower-precision arithmetic. We have also described an automated search process that uses this truncation technique to determine the precision level requirements of each program component. This search can be run incrementally to gain overview insights more quickly, with further iterations of the search leading to more detailed results. The result is a profile of a program’s precision level sensitivity, reported in histograms and program structure graphs. We have shown that this technique provides similar results to mixed-precision analysis with much lower overhead.

This work provides immediately useful, practical tools as well as a basis for further research. These techniques represent novel contributions to the fields of high performance computing and program analysis, and serve as the first major step towards the larger vision of automated extreme-scale floating-point precision and performance tuning.

For publications and presentations related to this project, please visit my research page.



Building and using this project currently requires some experience in systems development. Code and user interfaces may not be stabilized, and there are probably many bugs and issues yet to be resolved.

To obtain a copy of the source code, please access the Git repository:

See the README file for instructions regarding installation and setup. For support, please contact the author directly.


CRAFT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

For more license details, please read LICENSE in the main project directory.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>