zfp & fpzip: Floating Point Compression

Floating-point data compression

High-precision numerical data from computer simulations, observations, and experiments is often represented in floating point, and can easily reach terabytes to petabytes of storage.  Moving such large data sets to and from disk, across the internet, between compute nodes, and even through the memory hierarchy presents a significant performance bottleneck.  To address this problem, we have developed lossy and lossless high-speed data compressors that can greatly reduce the amount of data stored and moved.

For lossless compression, where each and every bit of each floating-point number has to be exactly preserved without any loss in accuracy, our memory efficient streaming fpzip compressor usually provides 1.5x-4x data reduction, depending on data precision and smoothness.

To achieve much higher compression ratios, lossy compression is needed, where small, often imperceptible or numerically negligible errors may be introduced.  Our zfp compressor for floating-point and integer data often achieves compression ratios on the order of 100:1, i.e. to less than one bit per value of compressed storage.  zfp frequently gives orders-of-magnitude more accurate results than competing compressors (including our own fpzip), while at up to 2 GB/s throughput also is many times faster.  It can achieve an exact bit rate, ensure that reconstructed values are within an absolute error tolerance, or meet a specified precision requirement.  zfp also comes with C++ compressed array classes that support random access and can be used in place of conventional C arrays or STL vectors, e.g. for numerical computations.

zfp and fpzip were both designed for compressing logically regular 1D, 2D, or 3D arrays of single- or double-precision floating-point numbers that exhibit spatial coherence (e.g. regularly sampled functions), and should not be used to compress unstructured data such as triangle mesh geometry, unorganized point sets, or streams of unrelated numbers.  Think of fpzip as the floating-point analogue to PNG image compression, and zfp as advanced JPEG for floating-point arrays.  Source code for both compressors is available for download below.

zfp

zfp is an open source C/C++ library for compressed floating-point arrays that support very high throughput read and write random access. zfp was written by Peter Lindstrom at Lawrence Livermore National Laboratory, and is based on the algorithm described in the following paper:

Peter Lindstrom, “Fixed-Rate Compressed Floating-Point Arrays,” IEEE Transactions on Visualization and Computer Graphics, 20(12):2674-2683, December 2014, doi:10.1109/TVCG.2014.2346458.

zfp was designed to achieve high compression ratios and therefore uses lossy but optionally error-bounded compression. Although bit-for-bit lossless compression is not always possible, zfp is usually accurate to within machine epsilon in near-lossless mode, and is often orders of magnitude more accurate and faster than other lossy compressors.

zfp is available for download below and is also hosted on GitHubHDF5 users may be interested in the H5Z-ZFP open source compression plugin written by Mark Miller.

For more information on zfp, please see the tabs on the left.

Above: Illustration of zfp’s ability to vary the compression ratio to any desired setting, from 10:1 on the left to 250:1 on the right, where the partitioning of the data set into small blocks is evident.  The visualization shows the density field from a Rayleigh-Taylor instability simulation.

fpzip

fpzip is a library for lossless or lossy compression of 2D or 3D floating-point scalar fields. Although written in C++, fpzip has a C interface.  fpzip was developed by Peter Lindstrom at LLNL, and is based on the algorithm described in the following paper:

Peter Lindstrom and Martin Isenburg, “Fast and Efficient Compression of Floating-Point Data,” IEEE Transactions on Visualization and Computer Graphics, 12(5):1245-1250, September-October 2006, doi:10.1109/TVCG.2006.143.

fpzip was primarily designed for lossless compression, but also has provision for lossy compression.  For lossy compression, our zfp compressor often outperforms fpzip.

For information on the API, usage, and licensing, please see the header file inc/fpzip.h in the tar file.

Questions and Comments on either zfp or fpzip

For bug reports and other questions, please contact Peter Lindstrom at pl@llnl.gov.

LLNL-WEB-664201

Software Releases

Name Version Date Size
ZFP 0.5.0 2016-02-29 333.79 KB
ZFP 0.4.1 2015-12-28 328.25 KB
ZFP 0.4.0 2015-12-05 175.78 KB
ZFP 0.3.1 2015-05-06 166.22 KB
ZFP 0.3.0 2015-03-15 165.77 KB
ZFP 0.2.1 2014-12-12 41.6 KB
ZFP 0.2.0 2014-12-02 40.85 KB
ZFP 0.1.0 2014-11-12 33.49 KB
FPZIP 1.1.0 2014-06-08 23.98 KB
FPZIP 1.0.1 2007-08-07 22.12 KB