[论文解读] SPDY: Accurate Pruning with Speedup Guarantees
SPDY 提出一种基于动态规划的方法,可自动确定分层稀疏性配置,在保证特定硬件上目标推理加速的同时最小化精度损失。它结合高效的动态规划求解器与局部搜索过程,从少量校准数据中学习分层误差分数,在视觉与语言模型的一次性剪枝和渐进式剪枝中均优于现有剪枝方法。
The recent focus on the efficiency of deep neural networks (DNNs) has led to significant work on model compression approaches, of which weight pruning is one of the most popular. At the same time, there is rapidly-growing computational support for efficiently executing the unstructured-sparse models obtained via pruning. Yet, most existing pruning methods minimize just the number of remaining weights, i.e. the size of the model, rather than optimizing for inference time. We address this gap by introducing SPDY, a new compression method which automatically determines layer-wise sparsity targets achieving a desired inference speedup on a given system, while minimizing accuracy loss. SPDY is composed of two new techniques: the first is an efficient dynamic programming algorithm for solving the speedup-constrained layer-wise compression problem assuming a set of given layer-wise sensitivity scores; the second is a local search procedure for determining accurate layer-wise sensitivity scores. Experiments across popular vision and language models show that SPDY guarantees speedups while recovering higher accuracy relative to existing strategies, both for one-shot and gradual pruning scenarios, and is compatible with most existing pruning approaches. We also extend our approach to the recently-proposed task of pruning with very little data, where we achieve the best known accuracy recovery when pruning to the GPU-supported 2:4 sparsity pattern.
研究动机与目标
- 弥合现有剪枝方法仅优化模型大小而非特定硬件上推理速度的差距。
- 实现自动、系统感知的分层稀疏性配置生成,保证目标加速的同时最小化精度退化。
- 克服启发式或均匀稀疏性分配的局限,通过极小量校准数据学习分层敏感度分数。
- 确保与一次性剪枝和渐进式剪枝的兼容性,并可扩展至低数据与 2:4 稀疏性设置。
- 提供通用框架,可超越非结构化剪枝,适用于其他压缩技术如量化或低秩近似。
提出的方法
- 将分层稀疏性选择问题建模为约束优化任务,目标是在最小化精度损失的前提下实现目标加速。
- 提出一种时间复杂度为线性(相对于层数与每层稀疏性选择数)的动态规划算法,实现对约束压缩问题的高效且精确求解。
- 引入局部搜索过程,通过在小规模校准集上评估重构稀疏模型的性能,自动学习分层误差分数。
- 采用 AdaPrune 的改进版本进行稀疏模型重构,实现对不同稀疏性配置影响的精确估计。
- 利用校准数据上的全局剪枝行为推断敏感度分数,考虑层间相互作用,提升对单层启发式方法的鲁棒性。
- 支持任意可加约束(如 FLOPs、能耗、参数量),使框架可扩展至加速之外的其他目标。
实验结果
研究问题
- RQ1能否开发一种通用方法,自动确定在给定硬件平台上保证特定推理加速的分层稀疏性水平?
- RQ2如何学习分层误差分数,使其能捕捉全局网络行为,并在精度上超越标准启发式方法(如权重幅度)?
- RQ3所提方法在多样化的模型与剪枝范式下,是否在精度与加速一致性方面均优于现有剪枝策略?
- RQ4该方法能否扩展至低数据或推理后 2:4 稀疏性设置并保持强性能?
- RQ5所学稀疏性配置在不同训练范式(如一次性剪枝 vs. 渐进式剪枝)之间具有多大程度的泛化能力?
主要发现
- SPDY 在所有测试模型中均实现高于最先进基线的精度,包括 ResNet50、YOLOv5m 和 BERT,尤其在高加速比下表现更优。
- 对于 YOLOv5m,SPDY 在 2.00× 加速下实现 mAP@0.5 为 61.50,优于次佳方法超过 2.5 个百分点。
- 在 BERT SQuAD 上,SPDY 在 4.00× 加速下保持 87.14 的 F1 分数,F1 降低量较次佳方法减少 1.4 分。
- 与均匀稀疏性或 GMP 剪枝相比,SPDY 在实现相同加速比时整体模型稀疏性更低,这可能有助于微调后获得更高精度。
- 对中间剪枝模型反复应用 SPDY(即从中间剪枝模型重新运行)可带来进一步精度提升,表明具有渐进式优化的潜力。
- SPDY 的稀疏性配置具有良好的泛化能力:在 AC/DC 训练的模型上应用时仍表现优异,表明其具备类似彩票原理的架构感知可迁移性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。