快速混合精度实数求值
Fast Mixed-Precision Real Evaluation
AI总结:
针对实值表达式高精度求值中统一精度造成的计算浪费问题,提出一种利用低精度结果解析确定混合精度分配的快速新算法,其实现 Reval 相比 Sollya 实现了显著加速。
摘要:
将实值表达式求值至高精度是计算数学、物理学和数值计算中的关键基础模块。典型的实现方式是以统一精度对整个表达式求值,并不断将该精度翻倍,直到获得足够准确的结果。这种做法存在浪费:通常只有少数运算真正需要以高精度执行,而表达式的主体部分本可以快得多地完成计算。然而,迄今为止,此类非均匀精度分配在实际计算中仍难以实现。我们提出了一种快速的新算法,用于推导此类精度分配。该算法利用在较低精度下计算的结果,通过解析方式确定一种混合精度分配,从而获得足够准确的结果。我们的实现 Reval 与最先进的 Sollya 工具相比,实现了 1.72 倍的平均加速,在最困难的输入点上加速比提升至 5.21 倍。对有无精度调优所使用精度的检查表明,加速源于为大多数运算分配了较低的精度,尽管非均匀精度分配带来的额外优化也发挥了作用。
英文摘要:
Evaluating real numbers to high precision is important in computational science, numerical computing, and in hardware and software design. Efficient algorithms exist for computing arithmetic operations and common elementary functions, but composing these primitives into larger expressions remains a challenge. The typical expression-evaluation algorithm computes all primitives in the expression to a uniform precision, doubling that precision until a sufficiently-accurate result is achieved. This is wasteful: usually only a few operations really need to be performed at high precision, and the bulk of the expression could be computed at a much lower, faster precision. However, no rigorous algorithm currently exists to compute these non-uniform precision assignments, nor to leverage non-uniform precision to reduce the number of primitive computations needed to evaluate an expression. We propose a new algorithm for deriving such rigorous precision assignments and reducing the number of primitive computations needed. This algorithm can leverage results computed at lower precisions to analytically determine a precision for each primitive that will result in a sufficiently-accurate evaluation. It can also use information from constant subexpressions, movability flags, and repeat flags to skip the computation of certain primitives, further reducing the time to evaluate real expressions. Our implementation, Reval, achieves an average speed-up of 3.97x compared to the widely-used Sollya tool, with the speed-up increasing to 9.26x on the most difficult inputs. A detailed evaluation shows that this speed-up results from both assigning lower precisions to the majority of primitives and from computing fewer primitives overall.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。