ONNXPruner: ONNX-Based General Model Pruning Adapter
Dongdong Ren, Wenbin Li, Tianyu Ding, Lei Wang, Qi Fan, Jing Huo, Hongbing Pan, Yang Gao
TL;DR
ONNXPruner introduces a general pruning adapter for ONNX models that abstracts pruning across frameworks by constructing node association trees for each pruned node and applying a tree-level evaluation to jointly assess pruned and associated channels. By standardizing models in ONNX and leveraging ONNX Runtime, it enables cross-framework deployment without extra architectural changes or retraining. The approach defines a four-type node attribute library and four pruning patterns (one-to-one, one-to-many, many-to-one, many-to-many) with explicit scoring formulas using channel-wise norms. Empirical results across CIFAR, ImageNet, and PASCAL VOC 2012 show that ONNXPruner can outperform several baselines, improve interoperability, and reduce integration overhead, highlighting its practical impact for scalable pruning workflows.
Abstract
Recent advancements in model pruning have focused on developing new algorithms and improving upon benchmarks. However, the practical application of these algorithms across various models and platforms remains a significant challenge. To address this challenge, we propose ONNXPruner, a versatile pruning adapter designed for the ONNX format models. ONNXPruner streamlines the adaptation process across diverse deep learning frameworks and hardware platforms. A novel aspect of ONNXPruner is its use of node association trees, which automatically adapt to various model architectures. These trees clarify the structural relationships between nodes, guiding the pruning process, particularly highlighting the impact on interconnected nodes. Furthermore, we introduce a tree-level evaluation method. By leveraging node association trees, this method allows for a comprehensive analysis beyond traditional single-node evaluations, enhancing pruning performance without the need for extra operations. Experiments across multiple models and datasets confirm ONNXPruner's strong adaptability and increased efficacy. Our work aims to advance the practical application of model pruning.
