Abstract
Scientific data generation is rapidly outstripping storage and I/O capabilities, necessitating the use of error-bounded lossy compression. However, the extreme diversity of scientific data means that monolithic compression tools are often suboptimal for specific domains. This paper presents SZ3, a modular, C++ template-based framework that allows researchers to flexibly compose compression pipelines. By decomposing the compression process into five distinct stages—preprocessor, predictor, quantizer, encoder, and lossless compressor—SZ3 enables data-specific optimizations that improve compression ratios by up to 20% over state-of-the-art tools while maintaining high throughput exceeding 1 GB/s.
Introduction
Modern scientific simulations in fields such as climate modeling, quantum chemistry, and cosmology generate staggering amounts of data, often reaching hundreds of terabytes per run. Standard lossless compression techniques (e.g., GZIP) are largely ineffective for floating-point scientific data, typically achieving ratios of only 2:1. While lossy compression offers significantly higher reduction, scientists require strict error bounds to ensure the data remains scientifically valid for subsequent analysis.
The primary challenge is that scientific data is incredibly diverse; a compressor optimized for smooth atmospheric data may perform poorly on periodic quantum chemistry data. Existing compressors like SZ2 or ZFP are often monolithic and difficult to customize. SZ3 addresses this lack of flexibility by providing a framework where compression pipelines can be easily adapted to specific datasets without sacrificing performance.
The SZ3 Modular Architecture
The core of SZ3 is a modular abstraction that breaks the compression process into five distinct, interchangeable stages:
- Preprocessor: Handles data transformations, such as logarithmic transforms for relative error bounds.
- Predictor: Estimates data values based on neighbors using methods like Lorenzo, regression, or pattern-based predictors.
- Quantizer: Converts prediction errors into discrete integers while strictly enforcing user-defined error bounds.
- Encoder: Losslessly compresses the quantization indices using techniques like Huffman or Arithmetic encoding.
- Lossless Compressor: A final pass using standard libraries (e.g., ZSTD, GZIP) to remove any remaining redundancy.
Implementation and Customization
To prevent the "abstraction penalty" typically associated with modular code, SZ3 utilizes compile-time polymorphism via C++ templates. This allows the compiler to optimize the specific pipeline as if it were a single, hard-coded program. Additionally, a multidimensional iterator enables the same compression logic to work across 1D, 2D, and 3D datasets without requiring dimension-specific code.
Key Innovations and Insights
SZ3 introduces several key advancements over previous iterations:
- Unpred-aware Quantizer: In earlier versions of SZ, data that could not be accurately predicted was stored with minimal compression. SZ3 introduces an "Unpred-aware Quantizer" that uses bitplane-based encoding to find hidden correlations even in "noisy" residuals, improving compression ratios by up to 20%.
- Adaptivity: The framework's modularity allows for adaptive pipelines. For instance, in X-ray ptychography data from the Advanced Photon Source (APS), the authors found that 3D predictors were less effective than 1D predictors at low error bounds due to noise accumulation. SZ3 allows for the dynamic selection of predictors based on the user's specific error bound settings.
Results and Performance
The authors evaluated SZ3 across a wide range of scientific domains, including GAMESS (quantum chemistry), NYX (cosmology), and Miranda (turbulence). Key results include:
- Compression Ratios: The SZ3-Pastri pipeline, customized for GAMESS data, improved compression ratios by 20% over the previous best approach at the same level of data distortion.
- Throughput: The framework is highly efficient; a simplified "Truncation" pipeline reached a compression throughput of 1 GB/s, which is 4x faster than the next-best general-purpose compressor.
- Flexibility: The framework demonstrated that interpolation-based predictors (SZ3-Interp) are superior for high-compression scenarios, while Lorenzo/Regression (SZ3-LR) is better for high-accuracy needs.
Conclusion and Future Work
SZ3 provides a robust, flexible foundation for the next generation of scientific data compression. While currently optimized for Cartesian grids, future work will focus on extending the modular framework to support unstructured grids and hardware acceleration on GPUs and FPGAs.
Summary updated