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).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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.
Real arithmetic is simulated by allocating very high precision. Typically we aim for 64- or 128-bit precision.
- 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.
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
Bao, T., Zhang, X.: On-the-fly detection of instability problems in floating-point program execution. In: OOPSLA, pp. 817–832 (2013)
Bao, T., Zheng, Y., Zhang, X.: White box sampling in uncertain data processing enabled by program analysis. In: OOPSLA, pp. 897–914 (2012)
Benz, F., Hildebrandt, A., Hack, S.: A dynamic program analysis to find floating-point accuracy problems. In: PLDI, pp. 453–462 (2012)
de Berg, M., Cheong, O., van Kreveld, M., Overmars, M.: Computational Geometry: Algorithms and Applications, 3rd edn. Springer-Verlag TELOS, Heidelberg (2008)
Bykat, A.: Convex hull of a finite set of points in two dimensions. Inf. Process. Lett. 7(6), 296–298 (1978)
CGAL, Computational Geometry Algorithms Library. http://www.cgal.org
Chaudhuri, S., Farzan, A., Kincaid, Z.: Consistency analysis of decision-making programs. In: POPL, pp. 555–567 (2014)
Chiang, W.-F., Gopalakrishnan, G., Rakamarić, Z.: Unsafe floating-point to unsigned integer casting check for GPU programs. In: NSV (2015)
Chiang, W.-F., Gopalakrishnan, G., Rakamarić, Z., Solovyev, A.: Efficient search for inputs causing high floating-point errors. In: PPOPP, pp. 43–52 (2014)
Darulova, E., Kuncak, V.: Sound compilation of reals. In: POPL, pp. 235–248 (2014)
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)
Ericson, C.: Real-Time Collision Detection, vol. 14. Elsevier, Amsterdam (2005)
Floyd, R.W.: Algorithm 97: shortest path. Commun. ACM 5(6), 345 (1962)
Goldberg, D.: What every computer scientist should know about floating-point arithmetic. ACM Comput. Surv. (CSUR) 23, 5–48 (1991)
Graham, R.L.: An efficient algorithm for determining the convex hull of a finite planar set. Inf. Process. Lett. 1, 132–133 (1972)
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)
Harris, M., Sengupta, S., Owens, J.D.: Parallel prefix sum (scan) with CUDA. GPU Gems 3(39), 851–876 (2007)
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)
Knuth, D.E.: Axioms and Hulls. LNCS, vol. 606. Springer, Heidelberg (1992). ISBN:3-540-55611-7
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)
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)
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)
Paganelli, G., Ahrendt, W.: Verifying (in-)stability in floating-point programs by increasing precision, using smt solving. In: SYNASC, pp. 209–216 (2013)
Panchekha, P., Sanchez-Stern, A., Wilcox, J.R., Tatlock, Z.: Automatically improving accuracy for floating point expressions. In: PLDI, pp. 1–11 (2015)
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)
Schkufza, E., Sharma, R., Aiken, A.: Stochastic optimization of floating-point programs with tunable precision. In: PLDI, pp. 53–64 (2014)
Shewchuk, J.R.: Adaptive precision floating-point arithmetic and fast robust geometric predicates. Discrete Comput. Geom. 18(3), 305–363 (1997)
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)
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)