TL;DR
This paper introduces SparseTem, a novel framework that significantly accelerates CNN-based video encoders by exploiting temporal continuity. By intelligently skipping redundant computations between video frames and employing clever memory management, SparseTem achieves substantial speedups with minimal accuracy loss and reduced memory overhead, making efficient video processing more accessible.
What Problem Does This Paper Address?
Deep learning models are crucial for video processing tasks like object detection and autonomous driving. While Convolutional Neural Networks (CNNs) are excellent feature extractors, their high computational demands make them bottlenecks in video encoders. Existing methods to speed up CNNs often overlook the inherent temporal redundancy in videos – the fact that consecutive frames are usually very similar. This redundancy means many computations are repeated unnecessarily. The paper tackles two main challenges in exploiting this redundancy through "Diff Computation": 1) the significant memory overhead required to handle non-linear operations, and 2) accuracy degradation due to imbalanced sparsity across different network layers.
Methods
SparseTem introduces two key innovations to address the challenges of Diff Computation:
- SparseBatch Scheduling: This method eliminates the need to cache intermediate feature maps for non-linear operations, a major source of memory overhead in prior work. Instead of processing frames independently or in complex micro-batches, SparseBatch reorders computations to resolve dependencies between adjacent frames within a single batch. This allows for efficient processing of "diff frames" (frames with only changes from a reference frame) without requiring extra memory buffers, effectively changing the computation flow from a "Z" shape to an "N" shape.
- Online Truncation Threshold Adjustment: Diff Computation can lead to imbalanced sparsity across different layers of a CNN. Some layers might become too sparse, hindering acceleration, while others might retain too much information, leading to accuracy loss. SparseTem addresses this by dynamically adjusting a truncation threshold for each layer. This mechanism uses an iterative binary search to find the optimal threshold, balancing sparsity and maintaining performance across all layers, unlike fixed thresholds that can be suboptimal for different inputs or layers.
Datasets
The paper evaluates SparseTem on two standard video datasets:
- UCF101: Used for action recognition.
- MOT16: Used for object detection.
Key Insights and Ideas
- Temporal continuity is a goldmine for CNN acceleration: The core idea is that videos are inherently redundant, and this redundancy can be exploited to skip computations without significant performance degradation.
- Memory overhead is a critical bottleneck for Diff Computation: Prior methods that tried to handle non-linear operations in Diff Computation introduced substantial memory overhead by caching feature maps, limiting their practical use. SparseBatch directly tackles this.
- Sparsity imbalance is a hidden accuracy killer: Simply skipping computations based on differences isn't enough. The distribution of these differences (sparsity) across different network layers matters greatly for accuracy. The online adjustment mechanism is crucial for mitigating this.
- Generalizability is key: SparseTem is designed to be a framework that can be applied to various CNN-based video encoders, not just a specific architecture.
Key Results
SparseTem demonstrates significant improvements:
- Speedup: Achieves up to 1.79x speedup for EfficientDet and 4.72x speedup for CRNN compared to the original cuDNN-based models. It also outperforms the SOTA DeltaCNN, achieving more than 1.79x acceleration.
- Memory Reduction: Significantly reduces memory overhead, with reductions of 68.1% compared to DeltaCNN and 28.6% compared to cuDNN. For instance, DeltaCNN consumes 3.1 times more memory than SparseTem at a batch size of 14.
- Accuracy: Maintains minimal accuracy drop, typically within 1%, making it a practical trade-off for the substantial gains in speed and memory.
- Throughput: Figure 5 shows substantial improvements in throughput (videos per second) across different resolutions.
Limitations and Future Work
- Accuracy vs. Sparsity Trade-off: While SparseTem minimizes accuracy loss, there's still a trade-off. High sparsity levels, especially for models like CRNN, can lead to noticeable accuracy drops. The paper suggests that architectures with more robust components (like EfficientDet's FPN) are more resilient to high sparsity.
- Computational Cost of Online Adjustment: The online adjustment mechanism, while effective, adds a small computational overhead. The paper mentions iterative binary search for threshold optimization, implying potential for further optimization of this process.
- Future Work: The authors believe SparseTem can play a pivotal role in advancing video processing, especially in memory-constrained environments. Future work could explore further optimizing the online adjustment mechanism and extending SparseTem to other types of video processing models or hardware accelerators.
Summary updated