Abstract
Traditional channel-wise pruning methods struggle with efficient CNN models using depth-wise convolutions and inverted residual blocks. Prior depth pruning methods often fail due to normalization layer constraints or weight corruption during activation removal. We propose UPDP, a novel depth pruning method featuring a block pruning strategy and progressive training. Our approach extends to Vision Transformers and consistently outperforms existing methods. Pruned ConvNeXtV1 models using UPDP surpass most state-of-the-art efficient models with comparable inference performance.
Introduction: The Challenge of Modern Model Efficiency
As deep learning models transition to edge devices, efficiency becomes paramount. Traditional channel-wise pruning—making layers "thinner"—often clashes with modern architectures like MobileNetV2 and ConvNeXt, which utilize depth-wise convolutions and complex normalization (e.g., LayerNorm).
Existing depth pruning methods—making models "shorter"—face two primary hurdles:
- Abruptness: Sudden layer removal during fine-tuning can "shock" model weights, degrading performance.
- Incompatibility: Many methods are restricted to BatchNorm, making them incompatible with Vision Transformers (ViTs) or newer CNNs.
UPDP (Unified Progressive Depth Pruner) addresses these by providing a unified framework that ensures a smooth transition during the pruning process across diverse architectures.
Methods: The UPDP Framework
The UPDP framework operates in four distinct stages to transform complex baseline blocks into efficient, merged subnets.
- Supernet Training: A "supernet" is constructed where each block contains two paths: the original baseline and a "pruned" path. The sandwich rule is applied to train the largest and smallest subnets simultaneously.
- Subnet Searching: A genetic algorithm identifies the optimal configuration of pruned vs. unpruned blocks to meet target speedups.
- Progressive Training: To avoid "weight shock," a factor ($\lambda$) gradually shifts data flow from the complex block to a simplified version. This "smooth morphing" prevents catastrophic forgetting.
- Subnet Merging (Structural Reparameterization): Simplified blocks are mathematically fused. For instance, adjacent linear layers are multiplied, and BatchNorm layers are folded into convolutions, resulting in a physically shallower, faster model.
Key Results and Insights
UPDP-pruned models frequently outperform models designed from scratch for efficiency.
- ConvNeXtV1: The UPDP-P9 variant achieved 80.6% accuracy with a significant speedup, outperforming RegNetY and VanillaNet.
- MobileNetV2: UPDP reached 74.8% accuracy at a 1.75x speedup, exceeding previous SOTA depth pruning methods like DepthShrinker by 0.7%.
- Vision Transformers: On DeiT-Tiny, UPDP achieved a 1.26x speedup with 70.3% top-1 accuracy, surpassing specialized pruners like XPruner.
- Ablation Study: The progressive training strategy alone was shown to improve accuracy by 0.3% to 0.8% compared to standard "hard removal" of layers.
Conclusion and Future Work
UPDP demonstrates that strategic block removal and progressive training can significantly enhance model efficiency without sacrificing accuracy. While highly effective for image classification on standard GPUs (like the AMD MI100), future research could extend this to:
- Task Diversity: Applying the framework to object detection and semantic segmentation.
- Hardware Generalization: Testing across mobile CPUs and specialized AI accelerators.
- Large-Scale Transformers: Scaling the method to massive architectures like ViT-Huge or GPT-style models.
Summary updated