Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Towards a Compiler for Reals

Published: 10 March 2017 Publication History

Abstract

Numerical software, common in scientific computing or embedded systems, inevitably uses a finite-precision approximation of the real arithmetic in which most algorithms are designed. In many applications, the roundoff errors introduced by finite-precision arithmetic are not the only source of inaccuracy, and measurement and other input errors further increase the uncertainty of the computed results. Adequate tools are needed to help users select suitable data types and evaluate the provided accuracy, especially for safety-critical applications.
We present a source-to-source compiler called Rosa that takes as input a real-valued program with error specifications and synthesizes code over an appropriate floating-point or fixed-point data type. The main challenge of such a compiler is a fully automated, sound, and yet accurate-enough numerical error estimation. We introduce a unified technique for bounding roundoff errors from floating-point and fixed-point arithmetic of various precisions. The technique can handle nonlinear arithmetic, determine closed-form symbolic invariants for unbounded loops, and quantify the effects of discontinuities on numerical errors. We evaluate Rosa on a number of benchmarks from scientific computing and embedded systems and, comparing it to the state of the art in automated error estimation, show that it presents an interesting tradeoff between accuracy and performance.

References

[1]
Adolfo Anta, Rupak Majumdar, Indranil Saha, and Paulo Tabuada. 2010. Automatic verification of control system implementations. In EMSOFT.
[2]
Ali Ayad and Claude Marché. 2010. Multi-prover verification of floating-point programs. In IJCAR.
[3]
David H. Bailey, Yozo Hida, Xiaoye S. Li, and Brandon Thompson. 2013. C++/Fortran-90 double-double and quad-double package. Retrieved from http://crd-legacy.lbl.gov/∼dhbailey/mpdist/.
[4]
Florian Benz, Andreas Hildebrandt, and Sebastian Hack. 2012. A dynamic program analysis to find floating-point accuracy problems. In PLDI.
[5]
Bruno Blanchet, Patrick Cousot, Radhia Cousot, Jérome Feret, Laurent Mauborgne, Antoine Miné, David Monniaux, and Xavier Rival. 2003. A static analyzer for large safety-critical software. In PLDI.
[6]
Sylvie Boldo and Claude Marché. 2011. Formal verification of numerical programs: From C annotated programs to mechanical proofs. Mathematics in Computer Science 5, 4 (2011), 377--393.
[7]
Martin Brain, Cesare Tinelli, Philipp Rümmer, and Thomas Wahl. 2015. An automatable formal semantics for IEEE-754 floating-point arithmetic. In ARITH.
[8]
Angelo Brillout, Daniel Kroening, and Thomas Wahl. 2009. Mixed abstractions for floating-point arithmetic. In FMCAD.
[9]
CEA-LIST. 2015. Frama-C Software Analyzers. (2015). Retrieved from http://frama-c.com/index.html.
[10]
Swarat Chaudhuri, Sumit Gulwani, Roberto Lublinerman, and Sara Navidpour. 2011. Proving programs robust. In ESEC/FSE.
[11]
Liqian Chen, Antoine Miné, and Patrick Cousot. 2008. A sound floating-point polyhedra abstract domain. In APLAS.
[12]
Wei-Fan Chiang, Ganesh Gopalakrishnan, Zvonimir Rakamaric, and Alexey Solovyev. 2014. Efficient search for inputs causing high floating-point errors. In PPoPP.
[13]
Eva Darulova and Viktor Kuncak. 2011. Trustworthy numerical computation in scala. In OOPSLA.
[14]
Eva Darulova and Viktor Kuncak. 2014. Sound compilation of reals. In POPL.
[15]
Luiz H. de Figueiredo and Jorge Stolfi. 2004. Affine arithmetic: Concepts and applications. Numer. Algor. 37, 1--4 (2004).
[16]
Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In TACAS.
[17]
James Demmel, Ioana Dumitriu, Olga Holtz, and Plamen Koev. 2008. Accurate and efficient expression evaluation and linear algebra. Acta Numer. 17 (2008).
[18]
Theo Drane. 2013. Lossy Polynomial Datapath Synthesis. Ph.D. Dissertation. Imperial College London.
[19]
Jérôme Feret. 2004. Static analysis of digital filters. In ESOP.
[20]
Jérôme Feret. 2005. The arithmetic-geometric progression abstract domain. In VMCAI.
[21]
Altaf Abdul Gaffar, Oskar Mencer, Wayne Luk, and Peter Y. K. Cheung. 2004. Unifying bit-width optimisation for fixed-point and floating-point designs. In FCCM.
[22]
Ivan Gazeau, Dale Miller, and Catuscia Palamidessi. 2012. A non-local method for robustness analysis of floating point programs. In QAPL.
[23]
Khalil Ghorbal, Eric Goubault, and Sylvie Putot. 2009. The zonotope abstract domain taylor1+. In CAV.
[24]
Khalil Ghorbal, Eric Goubault, and Sylvie Putot. 2010. A logical product approach to zonotope intersection. In CAV.
[25]
David Goldberg. 1991. What every computer scientist should know about floating-point arithmetic. ACM Comput. Surv. 23, 1 (1991).
[26]
Eric Goubault and Sylvie Putot. 2011. Static analysis of finite precision computations. In VMCAI.
[27]
Eric Goubault and Sylvie Putot. 2013. Robustness analysis of finite precision implementations. In APLAS.
[28]
Stef Graillat, Vincent Lefèvre, and Jean-Michel Muller. 2014. On the Maximum Relative Error When Computing xn in Floating-point Arithmetic. Technical Report <ensl-00945033v2>. Laboratoire d’Informatique de Paris 6, Inria Grenoble Rhône-Alpes.
[29]
Leopold Haller, Alberto Griggio, Martin Brain, and Daniel Kroening. 2012. Deciding floating-point logic with systematic abstraction. In FMCAD.
[30]
John Harrison. 2006. Floating-point verification using theorem proving. In Formal Methods for Hardware Verification: 6th International School on Formal Methods for the Design of Computer, Communication, and Software Systems.
[31]
Nicholas J. Higham. 2002. Accuracy and Stability of Numerical Algorithms. Siam.
[32]
Computer Society IEEE. 2008. IEEE standard for floating-point arithmetic. IEEE Std 754-2008 (2008).
[33]
ISO/IEC. 2008. Programming Languages—C—Extensions to Support Embedded Processors. Technical Report ISO/IEC TR 18037.
[34]
Franjo Ivancic, Malay K. Ganai, Sriram Sankaranarayanan, and Aarti Gupta. 2010. Numerical stability analysis of floating-point computations using software model checking. In MEMOCODE.
[35]
Susmit Jha and Sanjit A. Seshia. 2013. Synthesis of optimal fixed-point implementations of numerical software routines. In Proceedings of the 6th International Workshop on Numerical Software Verification (NSV).
[36]
Dejan Jovanović and Leonardo de Moura. 2012. Solving non-linear arithmetic. In IJCAR.
[37]
Adam B. Kinsman and Nicola Nicolici. 2009. Finite precision bit-width allocation using sat-modulo theory. In DATE.
[38]
Michael O. Lam, Jeffrey K. Hollingsworth, Bronis R. de Supinski, and Matthew P. Legendre. 2013b. Automatically adapting programs for mixed-precision floating-point computation. In ICS.
[39]
Michael O. Lam, Jeffrey K. Hollingsworth, and G. W. Stewart. 2013a. Dynamic floating-point cancellation detection. Parallel Comput. 39, 3 (2013).
[40]
Dong-U. Lee, Altaf Abdul Gaffar, Ray C. C. Cheung, Oskar Mencer, Wayne Luk, and George A. Constantinides. 2006. Accuracy-guaranteed bit-width optimization. IEEE Trans. CAD Integr. Circ. Syst. 25, 10 (2006).
[41]
Michael D. Linderman, Matthew Ho, David L. Dill, Teresa H. Meng, and Garry P. Nolan. 2010. Towards program optimization through automated analysis of numerical precision. In CGO.
[42]
Rupak Majumdar, Indranil Saha, and Zilong Wang. 2010. Systematic testing for control applications. In MEMOCODE.
[43]
Arindam Mallik, Debjit Sinha, Prithviraj Banerjee, and Hai Zhou. 2007. Low-power optimization by smart bit-width allocation in a systemc-based asic design environment. IEEE Trans. CAD Integr. Circ. Syst. 26, 3 (2007).
[44]
Matthieu Martel. 2002. Static analysis of the numerical stability of loops. In SAS.
[45]
Antoine Miné. 2004. Relational abstract domains for the detection of floating-point run-time errors. In ESOP.
[46]
Ramon E. Moore. 1966. Interval Analysis. Prentice-Hall.
[47]
Gabriele Paganelli and Wolfgang Ahrendt. 2013. Verifying (in-)stability in floating-point programs by increasing precision, using SMT solving. In SYNASC.
[48]
Cindy Rubio-González, Cuong Nguyen, Hong Diep Nguyen, James Demmel, William Kahan, Koushik Sen, David H. Bailey, Costin Iancu, and David Hough. 2013. Precimonious: Tuning assistant for floating-point precision. In SC.
[49]
N. Stan Scott, Fabienne Jézéquel, Christophe Denis, and Jean Marie Chesneaux. 2007. Numerical ‘health check’ for scientific codes: The CADNA approach. Computer Physics Communications (2007).
[50]
Alexey Solovyev, Charles Jacobsen, Zvonimir Rakamaric, and Ganesh Gopalakrishnan. 2015. Rigorous estimation of floating-point round-off errors with symbolic taylor expansions. In FM.
[51]
Enyi Tang, Earl Barr, Xuandong Li, and Zhendong Su. 2010. Perturbing numerical calculations for statistical analysis of floating-point program (in)stability. In ISSTA.
[52]
Chris Woodford and Chris Phillips. 2012. Numerical Methods with Worked Examples. Vol. 2nd. Springer.
[53]
Randy Yates. 2013. Fixed-Point Arithmetic: An Introduction. Technical Report. Digital Signal Labs. Retrieved from http://www.digitalsignallabs.com/fp.pdf.

Cited By

View all
  • (2024)A Step-Function Abstract Domain for Granular Floating-Point Error AnalysisProceedings of the 10th ACM SIGPLAN International Workshop on Numerical and Symbolic Abstract Domains10.1145/3689609.3689997(26-33)Online publication date: 17-Oct-2024
  • (2024)Numerical Fuzz: A Type System for Rounding Error AnalysisProceedings of the ACM on Programming Languages10.1145/36564568:PLDI(1954-1978)Online publication date: 20-Jun-2024
  • (2024)Floating-Point TVPI Abstract DomainProceedings of the ACM on Programming Languages10.1145/36563958:PLDI(442-466)Online publication date: 20-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 39, Issue 2
June 2017
194 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/3062396
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 10 March 2017
Accepted: 01 November 2016
Revised: 01 April 2016
Received: 01 August 2015
Published in TOPLAS Volume 39, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Roundoff error
  2. compilation
  3. discontinuity error
  4. fixed-point arithmetic
  5. floating-point arithmetic
  6. loops
  7. sensitivity analysis
  8. verification

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • European Research Council (ERC) project “Implicit Programming”

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)152
  • Downloads (Last 6 weeks)18
Reflects downloads up to 14 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)A Step-Function Abstract Domain for Granular Floating-Point Error AnalysisProceedings of the 10th ACM SIGPLAN International Workshop on Numerical and Symbolic Abstract Domains10.1145/3689609.3689997(26-33)Online publication date: 17-Oct-2024
  • (2024)Numerical Fuzz: A Type System for Rounding Error AnalysisProceedings of the ACM on Programming Languages10.1145/36564568:PLDI(1954-1978)Online publication date: 20-Jun-2024
  • (2024)Floating-Point TVPI Abstract DomainProceedings of the ACM on Programming Languages10.1145/36563958:PLDI(442-466)Online publication date: 20-Jun-2024
  • (2024)A Holistic Approach to Automatic Mixed-Precision Code Generation and Tuning for Affine ProgramsProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638484(55-67)Online publication date: 2-Mar-2024
  • (2024)Detecting Numerical Deviations in Deep Learning Models Introduced by the TVM Compiler2024 IEEE 35th International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE62328.2024.00018(73-83)Online publication date: 28-Oct-2024
  • (2024)The Impact of Profiling Versus Static Analysis in Precision TuningIEEE Access10.1109/ACCESS.2024.340183112(69475-69487)Online publication date: 2024
  • (2023)Transpilers: A Systematic Mapping Review of Their Usage in Research and IndustryApplied Sciences10.3390/app1306366713:6(3667)Online publication date: 13-Mar-2023
  • (2023)Formal Verification of a Controller Implementation in Fixed-Point Arithmetic2023 European Control Conference (ECC)10.23919/ECC57647.2023.10178283(1-6)Online publication date: 13-Jun-2023
  • (2023)Hardware and Software Support for Mixed Precision Computing: a Roadmap for Embedded and HPC Systems2023 Design, Automation & Test in Europe Conference & Exhibition (DATE)10.23919/DATE56975.2023.10137092(1-6)Online publication date: Apr-2023
  • (2023)MinUn: Accurate ML Inference on MicrocontrollersProceedings of the 24th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems10.1145/3589610.3596278(26-39)Online publication date: 13-Jun-2023
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media