Abstract
Deep neural networks are often over-parameterized, yet finding optimal compression strategies for specific hardware remains a manual, labor-intensive process. This paper introduces CONDENSA, a programmable Python framework that enables the composition of compression strategies and utilizes a novel Bayesian optimization algorithm to automatically determine optimal target sparsity. CONDENSA achieves up to 188x memory reduction and 2.59x throughput speedups with high sample efficiency, requiring fewer than 10 trial evaluations per search.
Introduction
Modern Deep Neural Networks (DNNs) are computationally expensive and memory-intensive, complicating deployment on resource-constrained devices. While techniques like weight pruning and quantization can mitigate these issues, their practical application is challenging. The "best" strategy depends on the DNN architecture, target hardware, and specific objectives (e.g., memory vs. throughput). Currently, engineers manually tune hyperparameters like target sparsity—the proportion of weights to zero out—a process that can take weeks due to the need to train models to convergence for each trial. Existing tools often lack flexibility or rely on sample-inefficient algorithms like Reinforcement Learning.
The CONDENSA Framework
CONDENSA addresses these challenges through a programmable API and sample-efficient optimization.
The framework consists of three core components:
- Programmable Library: An imperative Python API allows users to compose operators like
prune,quantize, andfilter_pruneusing standard logic (loops, conditionals), enabling hardware-aware adaptation at runtime. - Sample-Efficient Bayesian Optimization (BO): A two-stage pipeline finds optimal global sparsity. Stage 1 uses a novel Domain-Restricted Upper Confidence Bound (DR-UCB) acquisition function to find the highest sparsity meeting an accuracy threshold. Stage 2 optimizes the hardware objective within that safe range.
- Learning-Compression (L-C) Optimizer: Based on the augmented Lagrangian method, this component distributes the global sparsity across individual layers while recovering lost accuracy.
Experimental Evaluation
The authors evaluated CONDENSA across diverse benchmarks, including CIFAR-10 (VGG-19, ResNet56), ImageNet (VGG-16), and WikiText-2 (LSTM). No new datasets were introduced, focusing instead on proving real-world applicability across standard image classification and language modeling tasks.
Results and Key Insights
CONDENSA demonstrates significant improvements in both memory footprint and inference speed across various architectures and datasets.
Key findings include:
- Memory and Throughput: For VGG-19 on CIFAR-10, a combined Pruning + Quantization (P+Q) scheme achieved a 188x memory reduction with a slight accuracy gain. Filter pruning yielded a 2.59x throughput speedup on NVIDIA Titan V GPUs.
- Sample Efficiency: Optimal configurations were found within a budget of only 10 iterations, significantly outperforming RL-based methods that require hundreds of evaluations.
- Accuracy Preservation: Compressed models consistently stayed within 2% of baseline accuracy, sometimes even exceeding it.
The efficiency stems from separating accuracy constraints from hardware objectives and using the DR-UCB algorithm to prune the search space. By searching for global sparsity and letting the L-C optimizer handle layer-wise distribution, CONDENSA simplifies the compression workflow without sacrificing performance.
Conclusion
While CONDENSA provides a powerful tool for automated compression, real-world hardware implementation details can sometimes cause discrepancies between theoretical ratios and actual speedups. Future work will focus on expanding the automated search to include hyperparameters like block sizes and mixed-precision quantization.
Summary updated