Adding approximate counters

We describe a general framework for adding the values of two approximate counters to produce a new approximate counter value whose expected estimated value is equal to the sum of the expected estimated values of the given approximate counters. (To the best of our knowledge, this is the first published description of any algorithm for adding two approximate counters.) We then work out implementation details for five different kinds of approximate counter and provide optimized pseudocode. For three of them, we present proofs that the variance of a counter value produced by adding two counter values in this way is bounded, and in fact is no worse, or not much worse, than the variance of the value of a single counter to which the same total number of increment operations have been applied. Addition of approximate counters is useful in massively parallel divide-and-conquer algorithms that use a distributed representation for large arrays of counters. We describe two machine-learning algorithms for topic modeling that use millions of integer counters, and confirm that replacing the integer counters with approximate counters is effective, speeding up a GPU-based implementation by over 65% and a CPU-based by nearly 50%, as well as reducing memory requirements, without degrading their statistical effectiveness.

[1]  Miklós Csürös,et al.  Approximate Counting with a Floating-Point Counter , 2009, COCOON.

[2]  Philippe Flajolet,et al.  Approximate counting: A detailed analysis , 1985, BIT.

[3]  George E. Forsythe,et al.  Reprint of a Note on Rounding-Off Errors , 1959 .

[4]  Douglas Stott Parker,et al.  Monte Carlo arithmetic: how to gamble with floating point and win , 2000, Comput. Sci. Eng..

[5]  Robert H. Morris,et al.  Counting large numbers of events in small registers , 1978, CACM.

[6]  Andrew C. Callahan Random rounding: Some principles and applications , 1976, ICASSP.

[7]  Alexander J. Smola,et al.  Exponential Stochastic Cellular Automata for Massively Parallel Inference , 2016, AISTATS.

[8]  Mark Moir,et al.  Scalable statistics counters , 2013, PPoPP '13.

[9]  Scott A. Mitchell,et al.  Flexible approximate counting , 2011, IDEAS '11.

[10]  Rade Stanojevic,et al.  Small Active Counters , 2007, IEEE INFOCOM 2007 - 26th IEEE International Conference on Computer Communications.

[11]  Jack Dongarra,et al.  MPI - The Complete Reference: Volume 1, The MPI Core , 1998 .

[12]  Jack Dongarra,et al.  MPI: The Complete Reference , 1996 .

[13]  Joseph Tassarotti,et al.  Efficient Training of LDA on a GPU by Mean-for-Mode Estimation , 2015, ICML.

[14]  Andrej Cvetkovski,et al.  An algorithm for approximate counting using limited memory resources , 2007, SIGMETRICS '07.

[15]  A. J. Walker Fast generation of uniformly distributed pseudorandom numbers with floating-point representation , 1974 .

[16]  D. Stott Parker,et al.  Monte Carlo Arithmetic: exploiting randomness in floating-point arithmetic , 1997 .