Skip to main content
QUICK REVIEW

[Paper Review] Fast exact summation using small and large superaccumulators

Radford M. Neal|arXiv (Cornell University)|May 21, 2015
Numerical Methods and AlgorithmsComputer Science7 references11 citations
TL;DR

This paper introduces a fast exact summation method using hybrid small and large superaccumulators—fixed-point integers with high precision—to compute the exact sum of double-precision floating-point numbers and correctly round to the nearest floating-point value. The approach achieves near-memory-bandwidth-limited performance, with less than twice the time of simple summation on modern 64-bit processors, enabling efficient serial and parallel exact summation without loss of reproducibility.

ABSTRACT

I present two new methods for exactly summing a set of floating-point numbers, and then correctly rounding to the nearest floating-point number. Higher accuracy than simple summation (rounding after each addition) is important in many applications, such as finding the sample mean of data. Exact summation also guarantees identical results with parallel and serial implementations, since the exact sum is independent of order. The new methods use variations on the concept of a "superaccumulator" - a large fixed-point number that can exactly represent the sum of any reasonable number of floating-point values. One method uses a "small" superaccumulator with sixty-seven 64-bit chunks, each with 32-bit overlap with the next chunk, allowing carry propagation to be done infrequently. The small superaccumulator is used alone when summing a small number of terms. For big summations, a "large" superaccumulator is used as well. It consists of 4096 64-bit chunks, one for every possible combination of exponent bits and sign bit, plus counts of when each chunk needs to be transferred to the small superaccumulator. To add a term to the large superaccumulator, only a single chunk and its associated count need to be updated, which takes very few instructions if carefully implemented. On modern 64-bit processors, exactly summing a large array using this combination of large and small superaccumulators takes less than twice the time of simple, inexact, ordered summation, with a serial implementation. A parallel implementation using a small number of processor cores can be expected to perform exact summation of large arrays at a speed that reaches the limit imposed by memory bandwidth. Some common methods that attempt to improve accuracy without being exact may therefore be pointless, at least for large summations, since they are slower than computing the sum exactly.

Motivation & Objective

  • To develop a fast, exact method for summing floating-point numbers that guarantees correct rounding to the nearest representable value.
  • To overcome the performance bottleneck of existing exact summation techniques, especially for large arrays.
  • To enable reproducible, order-independent results in both serial and parallel implementations.
  • To reduce the fixed computational overhead of exact summation for small-scale problems.
  • To support high-accuracy statistical computations, such as exact sample mean calculation in R.

Proposed method

  • Uses a 'small' superaccumulator with 67 overlapping 64-bit chunks, each with 32-bit overlap to allow infrequent carry propagation.
  • Employs a 'large' superaccumulator with 4096 chunks—one per possible combination of sign and exponent bits—each tracking how many times it is updated.
  • Updates the large superaccumulator by modifying only one chunk and its associated count per term, minimizing instruction count.
  • Transfers non-zero chunks from the large to the small superaccumulator only when needed, reducing overhead.
  • Combines both superaccumulators: small for small sums, large for big sums, with efficient merging of partial results in parallel.
  • Uses integer arithmetic to represent the exact sum in fixed-point format, avoiding floating-point rounding errors during accumulation.

Experimental results

Research questions

  • RQ1Can exact summation be performed at near-memory-bandwidth-limited speed on modern 64-bit processors?
  • RQ2Can a hybrid superaccumulator design reduce the fixed cost of exact summation for small arrays?
  • RQ3Does using a large superaccumulator with per-exponent tracking enable efficient parallelization of exact summation?
  • RQ4Can exact summation outperform inexact but faster methods in terms of both accuracy and performance for large-scale problems?
  • RQ5Is the performance of exact summation limited by memory bandwidth rather than computation, especially in parallel settings?

Key findings

  • The hybrid small and large superaccumulator method achieves exact summation in less than twice the time of simple, inexact summation on modern 64-bit processors.
  • For large arrays, the method reaches the memory bandwidth limit, suggesting that performance is no longer CPU-bound but constrained by data movement.
  • With 4 cores, the method can achieve peak memory bandwidth utilization on an Intel Xeon E3-1230 v2, indicating that only a few cores are needed for optimal performance on large datasets.
  • The small superaccumulator method is 10–20× slower than simple summation for very small sums due to fixed initialization and scanning costs.
  • The large superaccumulator enables efficient parallelization: splitting the array and summing parts in parallel produces identical results to serial execution, ensuring reproducibility.
  • The method demonstrates that non-exact, faster summation techniques may be unnecessary for large-scale applications, as exact methods can be both accurate and efficient.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.