Layer-adaptive Structured Pruning Guided by Latency

Siyuan Pan, Linna Zhang, Jie Zhang, Xiaoshuang Li, Liang Hou, Xiaobing TuarXiv 2023 · DOI

Abstract

This paper introduces SP-LAMP, a structured pruning framework that optimizes neural networks for actual hardware execution time rather than theoretical FLOPs. By combining a novel global importance score that accounts for inter-layer connections with a "group knapsack" optimization strategy, the authors achieve significant speedups (up to 8.45×) with minimal impact on accuracy.

Introduction

In deep learning deployment, "smaller" models are not necessarily "faster." Traditional compression techniques focus on reducing Floating Point Operations (FLOPs) or parameter counts. However, hardware accelerators like GPUs and mobile chips possess architectural characteristics—such as memory bandwidth bottlenecks and parallelization limits—that cause models with identical FLOP counts to exhibit vastly different real-world latencies.

Existing latency-aware pruning methods often suffer from two primary issues:

  1. Local Perspective: Filter importance is evaluated layer-by-layer, ignoring the impact of a filter in one layer on subsequent layers.
  2. Aggressive Optimization: Standard optimization algorithms, such as the 0-1 Knapsack, can inadvertently prune all filters in a layer, breaking the network's signal path.

Methodology

The proposed framework, SP-LAMP, addresses these challenges through a three-stage hardware-intelligent approach.

Overview of the SP-LAMP pruning pipeline, including importance scoring, latency profiling, and the group knapsack solver.

SP-LAMP Importance Scoring

The Structured Pruning Layer-Adaptive Magnitude-based Pruning (SP-LAMP) score is a global metric that extends the original LAMP score to filter-level pruning. It calculates importance by considering the Frobenius norm of a filter in the current layer weighted by the norm of the corresponding channel in the next layer. This captures the critical inter-layer dependencies often missed by local methods.

Latency Profiling

To accurately guide pruning, the authors construct a latency lookup table based on real-world hardware measurements (e.g., NVIDIA 2080Ti). By using tools like nn-Meter, the framework captures how pruning specific filters affects execution speed, accounting for non-linear "latency jumps" caused by hardware cache or parallelization thresholds.

Detail of the profiled latency lookup table used to map filter configurations to real-world execution time.

Group Knapsack Solver

Pruning is formulated as a resource allocation problem: maximizing total importance within a fixed latency budget. Unlike standard 0-1 knapsack solvers, the group knapsack approach ensures that every layer retains at least one filter (the one with the highest SP-LAMP score). This "survival of the fittest" constraint prevents layer collapse during aggressive pruning.

Experimental Results

The researchers evaluated SP-LAMP on ImageNet-1K and CIFAR-10 benchmarks across various architectures:

  • ResNet-50 (ImageNet): Achieved a 1.28× speedup with a 1.7% increase in top-1 accuracy, or a 1.66× speedup with negligible accuracy loss.
  • ResNet-18 (CIFAR-10): Demonstrated a massive 8.45× speedup while maintaining competitive accuracy (3.54% drop).
  • MobileNetV2: Outperformed state-of-the-art competitors like ResRep and MetaPruning in the accuracy-latency trade-off, even on architectures already optimized for efficiency.

Discussion and Insights

A key observation is the non-linear nature of latency reduction. Latency often remains stagnant until a specific pruning threshold is reached, at which point it "jumps" down as the model fits into hardware-specific optimization windows. By deriving a global score that considers the distortion of the entire model output, SP-LAMP automatically determines non-uniform sparsity across the network, identifying redundant layers while preserving critical ones.

Conclusion

SP-LAMP provides a robust framework for hardware-aware model compression. While building latency lookup tables is hardware-specific and can be time-consuming, the resulting models offer superior real-world performance. Future work may extend this layer-adaptive approach to mixed-precision quantization, assigning bit-widths based on latency-accuracy contributions.

Summary updated

BibTeX
@misc{pan2023layer,
  author = {Siyuan Pan and Linna Zhang and Jie Zhang and Xiaoshuang Li and Liang Hou and Xiaobing Tu},
  title = {{Layer-adaptive Structured Pruning Guided by Latency}},
  year = {2023},
  eprint = {2305.14403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.14403},
}
Figure