In recent years, half precision floating-point arithmetic has gained wide support in hardware and software stack thanks to the advance of artificial intelligence and machine learning applications. Operating at half precision can significantly reduce the memory footprint comparing to operating at single or double precision. For memory bound applications such as time domain wave simulations, this is an attractive feature. However, the narrower width of the half precision data format can lead to degradation of the solution quality due to larger roundoff errors. In this work, we illustrate with carefully designed numerical experiments the negative impact caused by the accumulation of roundoff errors in wave simulations. Specifically, the energy-conserving property of the wave equations is employed as a convenient diagnosis tool. The corresponding remedy in the form of compensated sum is then provided, with its efficacy demonstrated using numerical examples involving both acoustic and elastic wave equations on hardware that natively support half precision arithmetic.
Read full abstract