Skip to main content

Practical Floating-Point Divergence Detection

  • Conference paper
  • First Online:
Languages and Compilers for Parallel Computing (LCPC 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9519))

Included in the following conference series:

Abstract

Reducing floating-point precision allocation in HPC programs is of considerable interest from the point of view of obtaining higher performance. However, this can lead to unexpected behavioral deviations from the programmer’s intent. In this paper, we focus on the problem of divergence detection: when a given floating-point program exhibits different control flow (or 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.

Supported in part by NSF Grants CCF 1421726 and ACI 1535032. This work was also performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE- AC52-07NA27344 (LLNL-CONF-669095).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    \(a = e = d = 1.0000 \cdot 2^{-3}\), \(b = f = 1.0000 \cdot 2^{2}\), and \(c = 1.0001 \cdot 2^{-3}\) causes divergence.

  2. 2.

    Real arithmetic is simulated by allocating very high precision. Typically we aim for 64- or 128-bit precision.

  3. 3.

    In practice, we do occasionally encounter a sequence whose discrete signatures match perfectly, and ABS exhausts all possible midpoints. In such cases, ABS is restarted with a different random seed.

  4. 4.

    Current state-of-the-art SMT solvers work on micro-benchmarks with micro floating-point formats such as the program in Fig. 1b; they still cannot handle realistic floating-point programs used in our work.

References

  1. Bao, T., Zhang, X.: On-the-fly detection of instability problems in floating-point program execution. In: OOPSLA, pp. 817–832 (2013)

    Google Scholar 

  2. Bao, T., Zheng, Y., Zhang, X.: White box sampling in uncertain data processing enabled by program analysis. In: OOPSLA, pp. 897–914 (2012)

    Google Scholar 

  3. Benz, F., Hildebrandt, A., Hack, S.: A dynamic program analysis to find floating-point accuracy problems. In: PLDI, pp. 453–462 (2012)

    Google Scholar 

  4. de Berg, M., Cheong, O., van Kreveld, M., Overmars, M.: Computational Geometry: Algorithms and Applications, 3rd edn. Springer-Verlag TELOS, Heidelberg (2008)

    Book  Google Scholar 

  5. Bykat, A.: Convex hull of a finite set of points in two dimensions. Inf. Process. Lett. 7(6), 296–298 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  6. CGAL, Computational Geometry Algorithms Library. http://www.cgal.org

  7. Chaudhuri, S., Farzan, A., Kincaid, Z.: Consistency analysis of decision-making programs. In: POPL, pp. 555–567 (2014)

    Google Scholar 

  8. Chiang, W.-F., Gopalakrishnan, G., Rakamarić, Z.: Unsafe floating-point to unsigned integer casting check for GPU programs. In: NSV (2015)

    Google Scholar 

  9. Chiang, W.-F., Gopalakrishnan, G., Rakamarić, Z., Solovyev, A.: Efficient search for inputs causing high floating-point errors. In: PPOPP, pp. 43–52 (2014)

    Google Scholar 

  10. Darulova, E., Kuncak, V.: Sound compilation of reals. In: POPL, pp. 235–248 (2014)

    Google Scholar 

  11. de Moura, L., Bjørner, N.S.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  12. Ericson, C.: Real-Time Collision Detection, vol. 14. Elsevier, Amsterdam (2005)

    Google Scholar 

  13. Floyd, R.W.: Algorithm 97: shortest path. Commun. ACM 5(6), 345 (1962)

    Article  Google Scholar 

  14. Goldberg, D.: What every computer scientist should know about floating-point arithmetic. ACM Comput. Surv. (CSUR) 23, 5–48 (1991)

    Article  Google Scholar 

  15. Graham, R.L.: An efficient algorithm for determining the convex hull of a finite planar set. Inf. Process. Lett. 1, 132–133 (1972)

    Article  MATH  Google Scholar 

  16. Gu, Y., Wahl, T., Bayati, M., Leeser, M.: Behavioral non-portability in scientific numeric computing. In: Träff, J.L., Hunold, S., Versaci, F. (eds.) Euro-Par 2015. LNCS, vol. 9233, pp. 558–569. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  17. Harris, M., Sengupta, S., Owens, J.D.: Parallel prefix sum (scan) with CUDA. GPU Gems 3(39), 851–876 (2007)

    Google Scholar 

  18. Kettner, L., Mehlhorn, K., Pion, S., Schirra, S., Yap, C.: Classroom examples of robustness problems in geometric computations. Comput. Geom. Theor. Appl. 40(1), 61–78 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  19. Knuth, D.E.: Axioms and Hulls. LNCS, vol. 606. Springer, Heidelberg (1992). ISBN:3-540-55611-7

    MATH  Google Scholar 

  20. Lam, M.O., Hollingsworth, J.K., de Supinski, B.R., LeGendre, M.P.: Automatically adapting programs for mixed-precision floating-point computation. In: ICS, pp. 369–378 (2013)

    Google Scholar 

  21. Linderman, M.D., Ho, M., Dill, D.L., Meng, T.H.Y., Nolan, G.P.: Towards program optimization through automated analysis of numerical precision. In: CGO, pp. 230–237 (2010)

    Google Scholar 

  22. Meng, Q., Humphrey, A., Schmidt, J., Berzins, M.: Preliminary experiences with the uintah framework on intel Xeon phi, stampede. In: XSEDE, pp. 48:1–48:8 (2013)

    Google Scholar 

  23. Paganelli, G., Ahrendt, W.: Verifying (in-)stability in floating-point programs by increasing precision, using smt solving. In: SYNASC, pp. 209–216 (2013)

    Google Scholar 

  24. Panchekha, P., Sanchez-Stern, A., Wilcox, J.R., Tatlock, Z.: Automatically improving accuracy for floating point expressions. In: PLDI, pp. 1–11 (2015)

    Google Scholar 

  25. Rubio-González, C., Nguyen, C., Nguyen, H.D., Demmel, J., Kahan, W., Sen, K., Bailey, D.H., Iancu, C., Hough, D., Precimonious: tuning assistant for floating-point precision. In: SC, pp. 27:1–27:12 (2013)

    Google Scholar 

  26. Schkufza, E., Sharma, R., Aiken, A.: Stochastic optimization of floating-point programs with tunable precision. In: PLDI, pp. 53–64 (2014)

    Google Scholar 

  27. Shewchuk, J.R.: Adaptive precision floating-point arithmetic and fast robust geometric predicates. Discrete Comput. Geom. 18(3), 305–363 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  28. Solovyev, A., Jacobsen, C., Rakamaric, Z., Gopalakrishnan, G.: Rigorous estimation of floating-point round-off errors with symbolic taylor expansions. In: FM, pp. 532–550 (2015)

    Google Scholar 

  29. Taufer, M., Padron, O., Saponaro, P., Patel, S.: Improving numerical reproducibility and stability in large-scale numerical simulations on GPUs. In: IPDPS, pp. 1–9, April 2010

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Wei-Fan Chiang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Chiang, WF., Gopalakrishnan, G., Rakamarić, Z. (2016). Practical Floating-Point Divergence Detection. In: Shen, X., Mueller, F., Tuck, J. (eds) Languages and Compilers for Parallel Computing. LCPC 2015. Lecture Notes in Computer Science(), vol 9519. Springer, Cham. https://doi.org/10.1007/978-3-319-29778-1_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-29778-1_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-29777-4

  • Online ISBN: 978-3-319-29778-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics