A novel memory-efficient deep learning training framework via error-bounded lossy compression

Sian Jin, Guanpeng Li, Shuaiwen Leon Song, Dingwen Tao

TL;DR

Training massive deep learning models is heavily bottlenecked by the GPU memory required to store intermediate activation data. This paper introduces a novel training framework that uses error-bounded lossy compression (cuSZ) to slash activation memory by up to 13.5× with negligible accuracy loss. By theoretically modeling how compression errors propagate to gradients, the framework dynamically adjusts compression bounds to maximize memory savings and enable larger training batch sizes.

What Problem Does This Paper Address?

When training deep neural networks (DNNs), GPUs must store intermediate "activation" data during the forward pass so it can be reused to calculate gradients during the backward pass. As networks grow deeper and wider, these activations consume massive amounts of on-chip memory—often far exceeding the size of the model weights themselves.

Memory consumption and top-1 accuracy of different state-of-the-art neural networks.

Existing workarounds all come with steep trade-offs:

  • Recomputation drops activations and recalculates them when needed, which spikes training time.
  • Data migration swaps activations to the CPU RAM, but this is severely bottlenecked by PCIe or NVLink bandwidth.
  • Lossless compression is safe but only yields a meager ~2:1 compression ratio due to the high randomness of floating-point data.
  • Image-based lossy compression (like JPEG) offers higher compression but introduces uncontrolled errors and typically requires specialized hardware modifications.

The authors tackle this dilemma by asking: Can we use floating-point lossy compression to aggressively save memory without breaking the network's ability to converge?

Methods

The core innovation is a memory-driven training framework that integrates error-bounded lossy compression (specifically utilizing cuSZ, a high-throughput GPU-based compressor) directly into the training loop.

Unlike standard lossy compressors that operate blindly, this framework uses a strict, adaptive error-controlling mechanism:

  1. Error Modeling: The authors prove that while cuSZ introduces a uniform distribution of error to the activation data, the resulting error in the gradients actually follows a well-behaved normal (Gaussian) distribution due to the Central Limit Theorem during tensor operations.
  2. Adaptive Error Bounding: Every 1,000 iterations, the framework samples current training statistics—such as loss values, batch size, layer sparsity, and momentum. It plugs these into a newly derived analytical estimator to dynamically calculate the safest, most aggressive absolute error bound ($eb$) for each individual layer.
  3. Preserving Zeros: Because activation functions like ReLU introduce significant sparsity (lots of exact zeros), standard lossy compression can turn these zeros into tiny, noisy floating-point values. The authors modified the decompression stage with a custom filter to force these values back to exact zeros, preventing noise accumulation and preserving sparsity.
Data flow in a sample iteration of training CNNs.

Datasets

The framework was evaluated using the standard ImageNet-2012 dataset for image classification. Testing was performed across four widely-adopted convolutional neural network (CNN) architectures: AlexNet, VGG-16, ResNet-18, and ResNet-50.

Key Insights and Ideas

  • The Central Limit Theorem is a Savior: Even though lossy compression introduces uniform noise to activations, the aggregation during gradient computation (summing across channels and batches) transforms this noise into a symmetric normal distribution centered at zero.
  • Momentum Acts as a Natural Stabilizer: Because the gradient error is centralized and symmetric, standard optimization techniques like momentum naturally cancel out the compression noise over successive training iterations.
  • Dynamic over Static: A static compression bound across the entire training run either risks accuracy loss or leaves memory savings on the table. Dynamically adjusting the bounds based on the live state of the training loss allows for optimal compression at every epoch.

Key Results

  • Massive Memory Savings: The framework reduced activation memory footprint by up to 13.5× for AlexNet and consistently around 11× for VGG-16, ResNet-18, and ResNet-50. This outperforms state-of-the-art lossy compression methods (like JPEG-ACT) by 1.5× to 1.8×.
  • Negligible Accuracy Loss: The top-1 accuracy drop was virtually non-existent or strictly bounded within a tiny margin (e.g., ResNet-50 dropped only from 71.49% to 71.18%).
  • Net Performance Speedup: While introducing compression adds a ~17% computational overhead at a fixed batch size, the massive memory savings allow users to scale up the training batch size significantly. By utilizing larger batch sizes, the framework achieved up to a 1.27× raw throughput speedup over baseline training.

Limitations and Future Work

The primary limitation of this framework lies in networks dominated by $1 \times 1$ convolutions (such as certain layers in MobileNet or SqueezeNet). Calculating a $1 \times 1$ convolution is computationally trivial but still requires the same GPU compression/decompression overhead as larger kernels. For these specific layers, the performance overhead of compression can outweigh the benefits.

For future work, the authors plan to combine this lossy compression framework orthogonally with data migration and recomputation techniques to unlock even higher memory reduction ratios.

Summary updated

BibTeX
@inproceedings{jin2021novel,
  author = {Sian Jin and Guanpeng Li and Shuaiwen Leon Song and Dingwen Tao},
  title = {{A novel memory-efficient deep learning training framework via error-bounded lossy compression}},
  booktitle = {PPoPP},
  year = {2021},
  doi = {10.1145/3437801.3441597},
}
Figure