Skip to content

A GPU accelerated error-bounded lossy compression for scientific data.

License

Notifications You must be signed in to change notification settings

szcompressor/cuSZ

Repository files navigation

A CUDA-Based Error-Bounded Lossy Compressor for Scientific Data

cuSZ is a CUDA implementation of the widely used SZ lossy compressor for scientific data. It is the first error-bounded lossy compressor (circa 2020) on GPU for scientific data, aming to massively improve SZ's throughput on heterogeneous HPC systems.

(C) 2022 by Indiana University and Argonne National Laboratory. See COPYRIGHT in top-level directory.

  • developers: (framework) Jiannan Tian, (kernel/pipeline) Jinyang Liu, Shixun Wu, Cody Rivera, (deployment) Robert Underwood, (advisors, PIs) Dingwen Tao, Sheng Di, Franck Cappello
  • contributors (alphabetic): Jon Calhoun, Wenyu Gai, Megan Hickman Fulp, Xin Liang, Kai Zhao
  • Special thanks to Dominique LaSalle (NVIDIA) for serving as Mentor in Argonne GPU Hackaton 2021!

build from source code    |    use as a command-line tool    |    API reference

Kindly note: If you mention cuSZ in your paper, please refer to the detail below.

FAQ

There are technical differences between CPU-SZ and cuSZ, please refer to our academic papers for more information.

How does SZ/cuSZ work?

Prediction-based SZ algorithm comprises four major parts,

  1. User specifies error-mode (e.g., absolute value (abs), or relative to data value magnitude (r2r) and error-bound.
  2. Prediction errors are quantized in units of input error-bound (quant-code). Range-limited quant-codes are stored, whereas the out-of-range codes are otherwise gathered as outlier.
  3. The in-range quant-codes are fed into Huffman encoder. A Huffman symbol may be represented in multiple bytes.
  4. (CPU-only) additional DEFLATE method is applied to exploit repeated patterns. As of CLUSTER '21 cuSZ+ work, an RLE method performs a similar pattern-exploiting.
How does cuSZ evolve over years?

cuSZ and its variants use variable techniques to balance the need for data-reconstruction quality, compression ratio, and data-processing speed. A quick comparison is given below.

Notably, cuSZ (Tian et al., '20, '21) as the basic framework provides a balanced compression ratio and quality, while FZ-GPU (Zhang, Tian et al., '23) and SZp-CUDA/GSZ (Huang et al., '23, '24) prioritize data processing speed. cuSZ+ (hi-ratio) is an outcome of data compressibility research to demonstrate that certain methods (e.g., RLE) can work better in highly compressible cases (Tian et al., '21). The latest art, cuSZ-i (Liu, Tian, Wu et al., '24), attempts to utilize the QoZ-like methods (Liu et al., '22) to significantly enhance the data-reconstruction quality and the compression ratio.

                    prediction &                 statistics          lossless encoding          lossless encoding
                    quantization                                     passs (1)                  pass (2)

                  +----------------------+      +-----------+      +------------------+       +-----------------+
CPU-SZ     -----> | predictor {ℓ, lr, S} | ---> | histogram | ---> | ui2 Huffman enc. | ----> | DEFLATE (LZ+HF) |
'16, '17-ℓ, '18-lr, '21-S, '22-QoZ ------+      +-----------+      +------------------+       +-----------------+
(Di and Franck, Tao et al., Liang et al. Zhao et al., Liu et al.)

                  +----------------------+      +-----------+      +------------------+
cuSZ       -----> | predictor ℓ-(1,2,3)D | ---> | histogram | ---> | ui2 Huffman enc. | ----> ( n/a )
'20, '21          +----------------------+      +-----------+      +------------------+
(Tian et al.)
                  +----------------------+      +-----------+      +-------------------+      +---------+
cuSZ+        ---> | predictor ℓ-(1,2,3)D | ---> | histogram | ---> | de-redundancy RLE | ---> | HF enc. |
hi-ratio '21      +----------------------+      +-----------+      +-------------------+      +---------+
(Tian et al.)
                  +----------------------+                         +---------------+
FZ-GPU '23   ---> | predictor ℓ-(1,2,3)D | ---> ( n/a ) ---------> | de-redundancy | -------> ( n/a )
(Zhang, Tian et al.) --------------------+                         +---------------+

                  [ single kernel ]------------------------------------------------+           
SZp-CUDA/GSZ ---> | predictor ℓ-1D   ---------> ( n/a ) --------->   de-redundancy | -------> ( n/a )
'23, '24          +----------------------------------------------------------------+           
(Huang et al.)

                  +----------------+            +-----------+      +------------------+       +---------------+
cuSZ-i '24   ---> | predictor S-3D | ---------> | histogram | ---> | ui2 Huffman enc. | ----> | de-redundancy |
(Liu, Tian, Wu et al.) ------------+            +-----------+      +------------------+       +---------------+

ℓ: Lorenzo predictor; lr: linear-regression predictor; S: spline-interpolative predictor
What datasets are used?

We tested cuSZ using datasets from Scientific Data Reduction Benchmarks (SDRBench).

dataset dim. description
EXAALT 1D molecular dynamics simulation
HACC 1D cosmology: particle simulation
CESM-ATM 2D climate simulation
EXAFEL 2D images from the LCLS instrument
Hurricane ISABEL 3D weather simulation
NYX 3D adaptive mesh hydrodynamics + N-body cosmological simulation

We provide three small sample data in data by executing the script there. To download more SDRBench datasets, please use script/sh.download-sdrb-data.

cite cuSZ

Our published papers cover the essential design and implementation. If you mention cuSZ in your paper, please kindly cite using \cite{tian2020cusz,tian2021cuszplus,liu_tian_wu2024cuszi} and the BibTeX entries below (or standalone .bib file).

  1. PACT '20: cuSZ ( local copy | ACM | arXiv ) covers
    • basic framework: (fine-grained) N-D prediction-based error-controling "construction" + (coarse-grained) lossless encoding
  2. CLUSTER '21: cuSZ+ ( local copy | IEEEXplore | arXiv ) covers
    • optimization in throughput, featuring fine-grained N-D "reconstruction"
    • optimization in compression ratio, when data is deemed as "smooth"
  3. SC '24: cuSZ-i (The final paper will come to SC '24 proceedings.) The paper ( arXiv ) covers
    • spline-interpolation-based high-ratio data compression and high-quality data reconstruction
    • compresion ratio boost from incorporating the synergetic lossless encoding
@inproceedings{tian2020cusz,
      title = {{{\textsc cuSZ}: An efficient GPU-based error-bounded lossy compression framework for scientific data}},
     author = {Tian, Jiannan and Di, Sheng and Zhao, Kai and Rivera, Cody and Fulp, Megan Hickman and Underwood, Robert and Jin, Sian and Liang, Xin and Calhoun, Jon and Tao, Dingwen and Cappello, Franck},
       year = {2020}, month = {10},
        doi = {10.1145/3410463.3414624}, isbn = {9781450380751},
  booktitle = {Proceedings of the ACM International Conference on Parallel Architectures and Compilation Techniques},
     series = {PACT '20}, address = {Atlanta (virtual event), GA, USA}}

@inproceedings{tian2021cuszplus,
      title = {Optimizing error-bounded lossy compression for scientific data on GPUs},
     author = {Tian, Jiannan and Di, Sheng and Yu, Xiaodong and Rivera, Cody and Zhao, Kai and Jin, Sian and Feng, Yunhe and Liang, Xin and Tao, Dingwen and Cappello, Franck},
       year = {2021}, month = {09},
        doi = {10.1109/Cluster48925.2021.00047},
  booktitle = {2021 IEEE International Conference on Cluster Computing (CLUSTER)},
     series = {CLUSTER '21}, address = {Portland (virtual event), OR, USA}}

@article{liu_tian_wu2024cuszi,
     title = {{{\scshape cuSZ}-{\itshape i}: High-ratio scientific lossy compression on
             GPUs with optimized multi-level interpolation}},
    author = {Jinyang Liu and Jiannan Tian and Shixun Wu and Sheng Di and Boyuan Zhang and Yafan Huang and Kai Zhao and Guanpeng Li and Dingwen Tao and Zizhong Chen and Franck Cappello},
      year = {2024}, month = {11},
      note = {Co-first authors: Jinyang Liu, Jiannan Tian, and Shixun Wu},
       doi = {10.48550/arXiv.2312.05492},
    series = {SC '24}, address = {Atlanta, GA, USA}}

acknowledgements

This R&D is supported by the Exascale Computing Project (ECP), Project Number: 17-SC-20-SC, a collaborative effort of two DOE organizations – the Office of Science and the National Nuclear Security Administration, responsible for the planning and preparation of a capable exascale ecosystem. This repository is based upon work supported by the U.S. Department of Energy, Office of Science, under contract DE-AC02-06CH11357, and also supported by the National Science Foundation under Grants CCF-1617488, CCF-1619253, OAC-2003709, OAC-1948447/2034169, and OAC-2003624/2042084.

acknowledgement