Skip to main content
QUICK REVIEW

[Paper Review] OPQ: Compressing Deep Neural Networks with One-shot Pruning-Quantization

Peng Hu, Xi Peng|arXiv (Cornell University)|May 23, 2022
Advanced Neural Network ApplicationsComputer Science8 citations
TL;DR

This paper proposes One-shot Pruning-Quantization (OPQ), a novel method that analytically determines optimal pruning masks and quantization codebooks for deep neural networks using only pre-trained weights, eliminating iterative or manual tuning during finetuning. OPQ achieves state-of-the-art compression rates with minimal accuracy drop, particularly at high compression levels, by introducing a unified channel-wise quantization scheme that shares a single codebook per layer to reduce overhead.

ABSTRACT

As Deep Neural Networks (DNNs) usually are overparameterized and have millions of weight parameters, it is challenging to deploy these large DNN models on resource-constrained hardware platforms, e.g., smartphones. Numerous network compression methods such as pruning and quantization are proposed to reduce the model size significantly, of which the key is to find suitable compression allocation (e.g., pruning sparsity and quantization codebook) of each layer. Existing solutions obtain the compression allocation in an iterative/manual fashion while finetuning the compressed model, thus suffering from the efficiency issue. Different from the prior art, we propose a novel One-shot Pruning-Quantization (OPQ) in this paper, which analytically solves the compression allocation with pre-trained weight parameters only. During finetuning, the compression module is fixed and only weight parameters are updated. To our knowledge, OPQ is the first work that reveals pre-trained model is sufficient for solving pruning and quantization simultaneously, without any complex iterative/manual optimization at the finetuning stage. Furthermore, we propose a unified channel-wise quantization method that enforces all channels of each layer to share a common codebook, which leads to low bit-rate allocation without introducing extra overhead brought by traditional channel-wise quantization. Comprehensive experiments on ImageNet with AlexNet/MobileNet-V1/ResNet-50 show that our method improves accuracy and training efficiency while obtains significantly higher compression rates compared to the state-of-the-art.

Motivation & Objective

  • To address the inefficiency of iterative or manual tuning in existing pruning-quantization methods for DNN compression.
  • To enable simultaneous, analytical determination of layer-wise pruning ratios and quantization codebooks using only pre-trained model parameters.
  • To reduce the computational and hardware overhead of channel-wise quantization by enforcing a unified codebook per layer.
  • To achieve high compression rates without sacrificing model accuracy, especially at extreme compression levels.
  • To provide a one-shot, non-iterative framework that fixes compression modules during finetuning, improving training efficiency.

Proposed method

  • Formulates a unified pruning error using Laplace probability density functions to analytically compute layer-wise pruning ratios from pre-trained weights.
  • Derives magnitude-based pruning masks directly from the pre-trained model without iterative mask optimization.
  • Proposes a unified channel-wise quantization method where all channels in a layer share a single quantizer, eliminating per-channel codebook overhead.
  • Analytically computes quantization steps (Δi) per layer by minimizing the approximated quantization error, using the variance of pruned weights.
  • Fixes both pruning masks and quantization parameters during finetuning, updating only the network weights to compensate for compression-induced accuracy loss.
  • Employs error approximation techniques to validate the analytical solutions, showing strong alignment between theoretical and real-world pruning and quantization errors.

Experimental results

Research questions

  • RQ1Can pruning and quantization allocations be analytically determined from pre-trained weights alone, without iterative optimization?
  • RQ2Does a unified channel-wise quantization scheme that shares a single codebook per layer reduce overhead while maintaining high compression efficiency?
  • RQ3Can one-shot pruning-quantization achieve higher compression rates than existing methods without significant accuracy degradation?
  • RQ4How does the analytical error approximation compare to actual pruning and quantization errors in real models?
  • RQ5Is the proposed method effective across diverse architectures like AlexNet, MobileNet-V1, and ResNet-50 at extreme compression levels?

Key findings

  • OPQ achieves state-of-the-art compression rates on ImageNet with AlexNet, MobileNet-V1, and ResNet-50, significantly outperforming prior methods.
  • The method improves accuracy even at very high compression rates, demonstrating robustness to aggressive pruning and quantization.
  • The analytical pruning and quantization error approximations closely match real errors, validating the method's theoretical foundation.
  • The unified channel-wise quantization reduces hardware overhead compared to traditional channel-wise methods, enabling efficient deployment.
  • By fixing compression modules during finetuning, OPQ reduces training complexity and improves efficiency compared to iterative optimization approaches.
  • Experiments confirm that pre-trained models alone contain sufficient information to determine optimal pruning and quantization strategies in a one-shot manner.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.