Compilation and Other Software Techniques Enabling Approximate Computing

  • Weng-Fai Wong
  • Pooja Roy
  • Rajashi Ray
  • Nhut-Minh Ho


Successful application of approximate computing requires cooperation across the entire hardware–software stack. Generally, the hardware will need to provide some means of approximation. If so, it has to be reflected in the instruction set architecture and exposed to assembly programmers or the compiler. At the other end of the stack, users are often required to indicate the amount of accuracy or quality of service loss that is tolerable. The challenge would be to bring the two together in a synergistic and automated workflow so as to maximize the productivity of the developers. This is where the compiler, middleware, runtime, and automated software analysis come into the picture. In this chapter, we shall examine techniques for loop perforation, precision analysis, as well as how to utilize half precision, inexact hardware, and approximate memory with the aim of achieving more energy efficient or better performing code at the expense of user-acceptable loss of accuracy in the results. We shall also discuss the limitations of what current techniques can achieve.


  1. 1.
    Alvarez C, Corbal J, Valero M (2005) Fuzzy memoization for floating-point multimedia applications. IEEE Trans Comput 54(7):922–927CrossRefGoogle Scholar
  2. 2.
    Brown AW, Kelly PH, Luk W (2007) Profiling floating point value ranges for reconfigurable implementation. In: Proceedings of the 1st HiPEAC workshop on reconfigurable computing, pp 6–16Google Scholar
  3. 3.
    Cantin M-A, Savaria Y, Lavoie P (2002) A comparison of automatic word length optimization procedures. In: IEEE international symposium on circuits and systems (ISCAS), vol 2. IEEE, Piscataway, pp II-612–II-615Google Scholar
  4. 4.
    Constantinides GA, Cheung PY, Luk W (2003) Wordlength optimization for linear digital signal processing. IEEE Trans Comput Aided Des Integr Circuits Syst 22(10):1432–1442CrossRefGoogle Scholar
  5. 5.
    De Dinechin F, Lauter C, Melquiond G (2011) Certifying the floating-point implementation of an elementary function using gappa. IEEE Trans Comput 60(2):242–253MathSciNetCrossRefGoogle Scholar
  6. 6.
    Fousse L, Hanrot G, Lefèvre V, Pélissier P, Zimmermann P (2007) MPFR: a multiple-precision binary floating-point library with correct rounding. ACM Trans Math Softw 33(2), 13MathSciNetCrossRefGoogle Scholar
  7. 7.
    Gaffar AA, Mencer O, Luk W (2004) Unifying bit-width optimisation for fixed-point and floating-point designs. In: 12th annual ieee symposium on field-programmable custom computing machines. IEEE, Piscataway, pp. 79–88CrossRefGoogle Scholar
  8. 8.
    GCC, the GNU compiler collection.
  9. 9.
    Goldberg D (1991) What every computer scientist should know about floating-point arithmetic. ACM Comput Surv 23(1):5–48CrossRefGoogle Scholar
  10. 10.
    Guthaus MR, Ringenberg JS, Ernst D, Austin TM, Mudge T, Brown RB (2001) Mibench: a free, commercially representative embedded benchmark suite. In: Proceedings of the IEEE international workshop on workload characterization. IEEE, Piscataway, pp 3–14Google Scholar
  11. 11.
    Han K, Evans BL (2006) Optimum wordlength search using sensitivity information. EURASIP J Adv Signal Process
  12. 12.
    Ho N-M, Manogaran E, Wong W-F, Anoosheh A (2017) Efficient floating point precision tuning for approximate computing. In: Proceedings of the 22nd Asia and South Pacific design automation conference (ASP-DAC), pp 63–68Google Scholar
  13. 13.
    Hubara I, Courbariaux M, Soudry D, El-Yaniv R, Bengio Y (2016) Quantized neural networks: training neural networks with low precision weights and activations. CoRR, abs/1609.07061Google Scholar
  14. 14.
    Khedker UP, Dhamdhere DM (1994) A generalized theory of bit vector data flow analysis. ACM Trans Program Lang Syst (TOPLAS) 16(5):1472–1511CrossRefGoogle Scholar
  15. 15.
    Lam MO, Hollingsworth JK, de Supinski BR, LeGendre MP (2013) Automatically adapting programs for mixed-precision floating-point computation. In: Proceedings of the 27th international ACM conference on international conference on supercomputing. ACM, New York, pp 369–378Google Scholar
  16. 16.
    Lee D-U, Gaffar AA, Mencer O, Luk W (2005) Minibit: bit-width optimization via affine arithmetic. In: Proceedings of the 42nd annual design automation conference. ACM, New York, pp 837–840Google Scholar
  17. 17.
    Lee K, Shrivastava A, Issenin I, Dutt N, Venkatasubramanian N (2006) Mitigating soft error failures for multimedia applications by selective data protection. In: Proceedings of the 2006 international conference on compilers, architecture and synthesis for embedded systems, CASES ’06. ACM, New York, pp 411–420CrossRefGoogle Scholar
  18. 18.
    Li C, Luo W, Sapatnekar SS, Hu J (2015) Joint precision optimization and high level synthesis for approximate computing. In: Proceedings of the 52nd annual design automation conference. ACM, New York, p 104Google Scholar
  19. 19.
    McKay MD, Beckman RJ, Conover WJ (2000) A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics 42(1):55–61CrossRefGoogle Scholar
  20. 20.
    Misailovic S, Roy DM, Rinard MC (2011) Probabilistically accurate program transformations. In: Yahav E (ed) Static analysis. Springer, Berlin, pp 316–333CrossRefGoogle Scholar
  21. 21.
    Nepal K, Li Y, Bahar R, Reda S (2014) Abacus: a technique for automated behavioral synthesis of approximate computing circuits. In: Proceedings of the conference on design, automation and test in Europe. European Design and Automation Association, Leuven, p 361Google Scholar
  22. 22.
    Osborne WG, Cheung RC, Coutinho J, Luk W, Mencer O (2007) Automatic accuracy-guaranteed bit-width optimization for fixed and floating-point systems. In: Proceedings of the 2007 international conference on field programmable logic and applications (FPL). IEEE, Piscataway, pp 617–620CrossRefGoogle Scholar
  23. 23.
    Palaniappan SK, Gyori BM, Liu B, Hsu D, Thiagarajan P (2013) Statistical model checking based calibration and analysis of bio-pathway models. In: Gupta A, Henzinger, T (eds) Computational methods in systems biology. Lecture notes in computer science, vol 8130. Springer, Berlin, pp 120–134CrossRefGoogle Scholar
  24. 24.
    Quintao Pereira FM, Rodrigues RE, Sperle Campos VH (2013) A fast and low-overhead technique to secure programs against integer overflows. In: Proceedings of the IEEE/ACM international symposium on code generation and optimization (CGO). IEEE Computer Society, Washington, DC, pp 1–11Google Scholar
  25. 25.
    Rinard M (2006) Probabilistic accuracy bounds for fault-tolerant computations that discard tasks. In: Proceedings of the 20th annual international conference on supercomputing (ICS). ACM, New York, pp 324–334CrossRefGoogle Scholar
  26. 26.
    Rinard MC (2007) Using early phase termination to eliminate load imbalances at barrier synchronization points. SIGPLAN Not 42(10):369–386CrossRefGoogle Scholar
  27. 27.
    Roy P, Ray R, Wang C, Wong W-F (2014) Asac: automatic sensitivity analysis for approximate computing. In Proceedings of the 2014 SIGPLAN/SIGBED conference on languages, compilers and tools for embedded systems (LTCES). ACM, New York, pp 95–104Google Scholar
  28. 28.
    Roy P, Wang J, Wong W-F (2015) Pac: program analysis for approximation-aware compilation. In: 2015 International conference on compilers, architecture and synthesis for embedded systems (CASES). ACM, New York, pp 69–78CrossRefGoogle Scholar
  29. 29.
    Rubio-González C, Nguyen C, Nguyen HD, Demmel J, Kahan W, Sen K, Bailey DH, Iancu C, Hough D (2013) Precimonious: tuning assistant for floating-point precision. In: Proceedings of the international conference on high performance computing, networking, storage and analysis. ACM, New York, p 27Google Scholar
  30. 30.
    Rubio-González C, Nguyen C, Mehne B, Sen K, Demmel J, Kahan W, Iancu C, Lavrijsen W, Bailey DH, Hough D (2016) Floating-point precision tuning using blame analysis. In: Proceedings of the 38th international conference on software engineering. ACM, New York, pp 1074–1085Google Scholar
  31. 31.
    Sampson A, Dietl W, Fortuna E, Gnanapragasam D, Ceze L, Grossman D (2011) EnerJ: approximate data types for safe and general low-power computation. In: ACM SIGPLAN Notices, vol 46. ACM, New York, pp 164–174Google Scholar
  32. 32.
    Schkufza E, Sharma R, Aiken A (2014) Stochastic optimization of floating-point programs with tunable precision. ACM SIGPLAN Not 49(6):53–64CrossRefGoogle Scholar
  33. 33.
    Shi C, Brodersen RW (2004) Automated fixed-point data-type optimization tool for signal processing and communication systems. In: Proceedings of the 41st design automation conference. IEEE, Piscataway, pp 478–483Google Scholar
  34. 34.
    Sidiroglou-Douskos S, Misailovic S, Hoffmann H, Rinard M (2011) Managing performance vs. accuracy trade-offs with loop perforation. In: Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on foundations of software engineering, ESEC/FSE ’11. ACM, New York, pp 124–134Google Scholar
  35. 35.
  36. 36.
    The MPFR library (2012) Algorithms and proofs.
  37. 37.
    Vakili S, Langlois J, Bois G (2013) Enhanced precision analysis for accuracy-aware bit-width optimization using affine arithmetic. IEEE Trans Comput Aided Des Integr Circuits Syst 32(12):1853–1865CrossRefGoogle Scholar
  38. 38.
    Xu Q, Mytkowicz T, Kim NS (2018) Approximate computing: a survey. IEEE Des Test PP(99):1–1Google Scholar
  39. 39.
    Zuras D, Cowlishaw M, Aiken A, Applegate M, Bailey D, Bass S, Bhandarkar D, Bhat M, Bindel D, Boldo S, et al (2008) IEEE standard 754-2008 for floating-point arithmetic. IEEE, PiscatawayGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Weng-Fai Wong
    • 1
  • Pooja Roy
    • 2
  • Rajashi Ray
    • 3
  • Nhut-Minh Ho
    • 4
  1. 1.School of ComputingNational University of SingaporeSingaporeSingapore
  2. 2.Intel Technology India Pvt. Ltd.BengaluruIndia
  3. 3.Computer Science and Engineering DepartmentNational Institute of Technology Meghalaya, ShilongMeghalayaIndia
  4. 4.National University of SingaporeSchool of ComputingSingaporeSingapore

Personalised recommendations