Adaptive Precision Training (AdaPT): A dynamic quantized training approach for DNNs

Lorenz Kummer, Kevin Sidak, Tabea Reichmann, Wilfried N. Gansterer

TL;DR

This paper introduces AdaPT, a novel approach to training deep neural networks (DNNs) that dynamically adjusts the precision of computations on a per-layer basis. By intelligently switching precision levels during training, AdaPT achieves significant speedups and model size reductions without sacrificing accuracy, making DNNs more efficient for resource-constrained environments and time-critical applications.

What Problem Does This Paper Address?

The increasing size and complexity of deep neural networks (DNNs) present significant challenges for training and deployment, especially in resource-limited environments or applications where inference speed is critical. Quantization, a technique to reduce computational precision, offers a solution by decreasing memory usage and speeding up computations. However, existing quantization methods often fall into two camps: post-training quantization (which only speeds up inference) or fixed-precision training (which can lead to suboptimal resource utilization and accuracy degradation). Current approaches either require a full-precision fine-tuning phase or enforce a uniform bit-width across all layers, failing to leverage the fact that different layers might benefit from different precision levels. This paper aims to bridge this gap by proposing a dynamic, adaptive quantization strategy during training.

Methods

AdaPT introduces a novel "Quantization Friendly Initialization" strategy, specifically using a "TNVS" (Truncated Normal Variance Scaling) initializer, which has shown resilience in preliminary tests for quantized training. The core of AdaPT lies in its dynamic precision switching mechanism, which operates through two key operations:

  • PushDown Operation: This operation determines the lowest possible precision for a layer's weights without causing information loss, using the Kullback-Leibler Divergence (KLD) as a metric. It efficiently finds the minimum bit-width and fractional length for each layer.
  • PushUp Operation: This operation addresses the need to maintain sufficient precision for continued learning. It uses a gradient diversity heuristic to determine the precision required to prevent vanishing gradients, ensuring the network can still learn effectively.

These operations are integrated into a training loop where precision is adjusted dynamically, not just at the end of epochs but potentially within epochs. AdaPT uses fixed-point representation for its precision control, allowing for fine-grained adjustments. Additionally, AdaPT incorporates an L1 sparsifying regularizer to induce sparsity in weight tensors, further enhancing efficiency. The authors also propose a performance model to estimate speedups and memory reductions.

Datasets

The paper evaluates AdaPT on the following datasets:

  • CIFAR10/100: Standard image classification datasets used for training and evaluating AlexNet and ResNet20.
  • MNIST/FMNIST: Used for initial investigations into initializer choice and its correlation with quantized training performance (specifically for LeNet-5).

Key Insights and Ideas

  • Layer-wise Adaptive Precision: The most significant insight is that different layers in a DNN have varying precision requirements during training. AdaPT's ability to dynamically adjust precision on a per-layer basis is crucial for achieving both high accuracy and efficiency.
  • Information-Theoretic Precision Control: Using KLD to quantify information loss during precision reduction provides a principled way to determine the minimum necessary precision.
  • Gradient Diversity for Learning: Employing gradient diversity as a heuristic for the PushUp operation is a clever way to ensure that the network's learning capability is maintained even with reduced precision.
  • Initialization Matters: The paper highlights that the choice of weight initialization strategy can significantly impact the performance of quantized networks, suggesting a need for quantization-aware initialization.
  • Fixed-Point Advantage: The authors opt for fixed-point quantization over floating-point due to better control over numerical precision, which is essential for their adaptive strategy.

Key Results

  • Accuracy: AdaPT achieves top-1 accuracies comparable to or even surpassing float32 baselines and other state-of-the-art quantization methods like MuPPET on CIFAR10/100.
  • Speedup: AdaPT trained models show significant inference speedups, ranging from 1.63x to 3.56x compared to float32 baselines. Training speedups are also notable, with an average speedup of 1.27x reported for AlexNet/ResNet on CIFAR10/100.
  • Model Size Reduction: AdaPT achieves a model size reduction of 0.52x on average.
  • Sparsity: AdaPT effectively induces sparsity, with AlexNet reaching up to 80% sparsity in some layers and achieving a final model sparsity of 45% on CIFAR100.
  • Efficiency: The paper demonstrates that AdaPT's approach leads to reduced computational costs and memory consumption during training and inference.

Limitations and Future Work

  • Fixed-Point Hardware Dependency: AdaPT currently relies on fixed-point representation, which is not as ubiquitous as floating-point hardware. The authors plan to extend AdaPT to floating-point quantization (float16/float32) to improve compatibility with consumer hardware.
  • Exploration of Extreme Quantization: The paper suggests exploring AdaPT for very low bit-width networks (binarization/ternarization) by gradually reducing the quantization search space.
  • Intra-Training Pruning: The authors hypothesize that AdaPT's heuristics could be adapted for intra-training DNN pruning, which warrants future research.
  • Ablation Studies: Further ablation testing is planned to reduce the complexity of AdaPT.
  • Broader Applications: The potential usefulness of AdaPT in other research fields, such as Drug Discovery, is also mentioned as a future direction.

Summary updated

BibTeX
@inproceedings{kummer2023adaptive,
  author = {Lorenz Kummer and Kevin Sidak and Tabea Reichmann and Wilfried N. Gansterer},
  title = {{Adaptive Precision Training (AdaPT): A dynamic quantized training approach for DNNs}},
  booktitle = {SDM},
  year = {2023},
  doi = {10.1137/1.9781611977653.ch63},
}
Figure