Skip to main content
QUICK REVIEW

[Paper Review] NPAS: A Compiler-aware Framework of Unified Network Pruning and Architecture Search for Beyond Real-Time Mobile Acceleration

Zhengang Li, Geng Yuan|arXiv (Cornell University)|Dec 1, 2020
Advanced Neural Network ApplicationsComputer Science77 references5 citations
TL;DR

NPAS proposes a compiler-aware framework that unifies structured neural network pruning and neural architecture search (NAS) for real-time mobile inference. By integrating fine-grained, layer-agnostic pruning with a compiler-optimized code generation pipeline and a reinforcement learning-based search with Bayesian optimization, NPAS achieves 3.9ms ImageNet inference latency with 71% Top-1 accuracy on a mobile phone—surpassing prior work in both speed and accuracy.

ABSTRACT

With the increasing demand to efficiently deploy DNNs on mobile edge devices, it becomes much more important to reduce unnecessary computation and increase the execution speed. Prior methods towards this goal, including model compression and network architecture search (NAS), are largely performed independently and do not fully consider compiler-level optimizations which is a must-do for mobile acceleration. In this work, we first propose (i) a general category of fine-grained structured pruning applicable to various DNN layers, and (ii) a comprehensive, compiler automatic code generation framework supporting different DNNs and different pruning schemes, which bridge the gap of model compression and NAS. We further propose NPAS, a compiler-aware unified network pruning, and architecture search. To deal with large search space, we propose a meta-modeling procedure based on reinforcement learning with fast evaluation and Bayesian optimization, ensuring the total number of training epochs comparable with representative NAS frameworks. Our framework achieves 6.7ms, 5.9ms, 3.9ms ImageNet inference times with 78.2%, 75% (MobileNet-V3 level), and 71% (MobileNet-V2 level) Top-1 accuracy respectively on an off-the-shelf mobile phone, consistently outperforming prior work.

Motivation & Objective

  • To close the gap between model compression and NAS by enabling unified, compiler-aware optimization of DNNs for mobile acceleration.
  • To develop a generalizable, fine-grained structured pruning scheme applicable across diverse DNN layers (e.g., CONV, FC) beyond 3×3 convolutions.
  • To accelerate the joint search for optimal pruning schemes and network architectures under strict latency constraints on mobile devices.
  • To enable end-to-end mobile inference acceleration by combining compiler-level code generation with hardware-aware model compression.
  • To achieve Pareto-optimal trade-offs between model accuracy and inference latency on real mobile hardware.

Proposed method

  • Proposes block-punched pruning for CONV layers of varying kernel sizes and block-based pruning for FC layers, enabling fine-grained, structured sparsity across diverse DNN layers.
  • Develops a unified, compiler-based automatic code generation framework that supports multiple DNN architectures and pruning schemes, enabling efficient inference on mobile CPUs and GPUs.
  • Introduces a three-phase NPAS framework: (1) replacing mobile-inefficient operations, (2) a meta-modeling-based RL search with fast evaluation and Bayesian optimization to reduce search cost, and (3) pruning algorithm search using magnitude, ADMM, and geometric median methods.
  • Employs fast one-shot pruned model retraining (2 epochs) and end-to-end latency measurement on target mobile devices (Samsung Galaxy S10) to guide search under real latency constraints.
  • Leverages pre-trained models and knowledge distillation in Phase 3 to maintain accuracy during pruning, with 100 epochs for pruning and 100 for fine-tuning.
  • Uses a fast auto-tuning compiler to measure actual inference latency on mobile hardware, ensuring realistic performance evaluation during search.

Experimental results

Research questions

  • RQ1Can a unified framework effectively combine structured pruning and NAS while being aware of compiler-level optimizations for mobile acceleration?
  • RQ2Can fine-grained, layer-agnostic structured pruning improve both model accuracy and hardware efficiency beyond existing coarse-grained or 3×3-only approaches?
  • RQ3How can the search space for joint pruning and architecture search be efficiently navigated under strict mobile latency constraints?
  • RQ4To what extent can compiler-aware optimizations reduce inference latency without sacrificing model accuracy?
  • RQ5Can a meta-modeling approach with reinforcement learning and Bayesian optimization achieve search efficiency comparable to standard NAS while maintaining high accuracy?

Key findings

  • NPAS achieves 3.9ms ImageNet inference latency with 71% Top-1 accuracy on a Samsung Galaxy S10 mobile phone, outperforming prior NAS and pruning methods.
  • On mobile GPU, NPAS achieves 5.9ms latency with 75% Top-1 accuracy (MobileNet-V3 level), and 3.9ms with 71% Top-1 accuracy (MobileNet-V2 level).
  • The compiler optimizations alone accelerate inference by up to 141% on mobile GPU compared to MNN, demonstrating the impact of code generation.
  • NPAS reduces model computation (MACs) by up to 50% compared to baseline models while maintaining or improving accuracy under latency constraints.
  • The overall search time is reduced to 15 GPU days for EfficientNet-B0, with Phase 1 taking only 5 epochs and Phase 3 just 1.5 days, thanks to fast evaluation and Bayesian optimization.
  • NPAS achieves Pareto optimality in accuracy-latency trade-off, consistently outperforming MNN, PyTorch Mobile, and TFLite across both CPU and GPU on mobile devices.

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.