Structural pruning enables model acceleration by removing structurally-grouped parameters from neural networks. However, the parameter-grouping patterns vary widely across different models, making architecture-specific pruners, which rely on manually-designed grouping schemes, non-generalizable to new architectures. In this work, we study a highly-challenging yet barely-explored task, any structural pruning, to tackle general structural pruning of arbitrary architecture like CNNs, RNNs, GNNs and Transformers. The most prominent obstacle towards this goal lies in the structural coupling, which not only forces different layers to be pruned simultaneously, but also expects all removed parameters to be consistently unimportant, thereby avoiding structural issues and significant performance degradation after pruning. To address this problem, we propose a general and {fully automatic} method, \emph{Dependency Graph} (DepGraph), to explicitly model the dependency between layers and comprehensively group coupled parameters for pruning. In this work, we extensively evaluate our method on several architectures and tasks, including ResNe(X)t, DenseNet, MobileNet and Vision transformer for images, GAT for graph, DGCNN for 3D point cloud, alongside LSTM for language, and demonstrate that, even with a simple norm-based criterion, the proposed method consistently yields gratifying performances.
翻译:结构剪枝可以通过从神经网络中移除按结构分组的参数来使模型加速。然而,参数分组模式在不同的模型中差异很大,使得依赖于手动设计的分组方案的特定于体系结构的剪枝器无法推广到新的体系结构。在这项工作中,我们研究了一个极具挑战性但鲜有探索的任务,即任意结构剪枝,以解决任意体系结构(如CNN、RNN、GNN和Transformer)的普遍结构剪枝问题。这个目标最显著的障碍在于结构耦合,它不仅强制不同的层同时被剪枝,而且也期望所有被移除的参数一致地不重要,从而避免结构问题和严重的剪枝后性能降低。为了解决这个问题,我们提出了一种通用且完全自动的方法DepGraph(依赖图),以显式建模层之间的依赖关系,并为剪枝全面地分组耦合参数。在这项工作中,我们在多个体系结构和任务(包括图像的ResNe(X)t、DenseNet、MobileNet和Vision transformer,图的GAT,3D点云的DGCNN以及语言的LSTM)上进行了广泛的评估,并表明,即使使用简单的基于范数的判据,所提出的方法也能持续地产生令人满意的性能。