Progressive Compressed Records: Taking a Byte out of Deep Learning Data

Michael Kuchnik, George Amvrosiadis, Virginia Smith · DOI

TL;DR

Deep learning training is increasingly bottlenecked by data loading (I/O). This paper introduces Progressive Compressed Records (PCRs), a novel data format that uses progressive JPEG compression and a smart layout to allow dynamic data fidelity selection. This enables significant reductions in training time (up to 2x) and bandwidth usage without sacrificing accuracy.

What Problem Does This Paper Address?

The paper tackles the growing problem of I/O bottlenecks in deep learning training. As compute power for accelerators like TPUs and GPUs has advanced exponentially, the speed at which data can be fetched from storage and networks hasn't kept pace. This disparity means that training time is often dominated by data loading rather than computation. Existing solutions like resizing images reduce data size but are task-specific and can degrade performance. Storing multiple versions of a dataset at different compression levels is infeasible due to storage costs. The authors aim to provide a flexible and efficient way to manage data I/O for deep learning training.

Methods

The core innovation is Progressive Compressed Records (PCRs). This format combines two key ideas:

  • Progressive Compression: Instead of a single compressed version of an image, PCRs store multiple "scans" of the image, each representing a different level of fidelity. These scans are ordered by importance, allowing for progressive decoding. This is achieved using a modified JPEG compression approach.
  • Efficient Storage Layout: PCRs organize these scans into "scan groups" within records. This layout allows the data loader to read only up to a specific scan group, effectively selecting the desired data fidelity on the fly. This avoids duplicating the entire dataset for different fidelity levels.

The authors also propose a methodology for autotuning image fidelity at runtime. This involves either using a gradient similarity metric to determine how much compression a model can tolerate or using metrics like MSSIM to estimate accuracy loss.

Datasets

The paper evaluates PCRs on several standard image datasets:

  • ImageNet
  • HAM10000 (skin lesion images)
  • Stanford Cars
  • CelebAHQ (celebrity images)

Key Insights and Ideas

  • Deep Learning is Surprisingly Tolerant to Compression: Many deep learning tasks can tolerate significant data compression (over 50% reduction in original encoding) without a noticeable drop in accuracy.
  • Dynamic Fidelity is Key: The optimal level of data compression is not static; it depends on the specific model, hardware, and task. PCRs enable this dynamic adaptation.
  • I/O Bottlenecks are Real and Costly: Even at relatively small scales, data loading can become a significant bottleneck, especially with powerful accelerators.
  • Progressive Compression Offers a Sweet Spot: Unlike simple resizing or static compression, progressive compression allows for a spectrum of fidelity, enabling fine-grained control over the data-compute trade-off.
  • Gradient Similarity as a Proxy for Accuracy: The angle between gradients computed on full-fidelity and compressed data can serve as a reliable indicator of whether the compressed data will lead to similar model performance.

Key Results

  • Up to 2x Speedup: PCRs enabled training speedups of up to 2x on average compared to standard formats like TFRecords, primarily by reducing I/O bandwidth requirements.
  • Bandwidth Reduction: Using lower fidelity scans (e.g., scan 5) reduced the data size by up to 10x, leading to proportional increases in training throughput.
  • No Accuracy Loss: In many cases, significant speedups were achieved without any loss in final test accuracy, especially when using appropriate scan groups.
  • Autotuning Effectiveness: The proposed autotuning heuristic successfully adapted compression levels at runtime, matching accuracy while achieving speedups.
  • Overhead is Manageable: While progressive decoding has some CPU overhead, it was found to be absorbable by modern multi-core CPUs or even GPUs, especially in I/O-bound scenarios.

Limitations and Future Work

  • Hardware Acceleration: The authors suggest that leveraging hardware JPEG decoders could further reduce the CPU overhead associated with decoding.
  • Alternative Compression Methods: Exploring other progressive compression techniques beyond JPEG, such as neural compression, is a promising avenue.
  • Non-Image Data Modalities: Extending PCRs to other data types like audio and video is a natural next step.
  • QoS/Congestion Information: Tuning scan selection based on real-time Quality of Service or network congestion information is an area for future research.
  • Static Schedules: While autotuning is presented, the paper acknowledges that static schedules might still be useful in some contexts, and further research could optimize these.

Summary updated

BibTeX
@article{kuchnik2021progressive,
  author = {Michael Kuchnik and George Amvrosiadis and Virginia Smith},
  title = {{Progressive Compressed Records: Taking a Byte out of Deep Learning Data}},
  journal = {Proc. VLDB Endow.},
  year = {2021},
  doi = {10.14778/3476249.3476308},
}
Figure