Abstract
Vision Transformers (ViTs) have achieved state-of-the-art performance in computer vision, yet their static computational demands pose challenges for real-time applications with fluctuating hardware resources. This paper investigates Resource-Dependent Dynamic (RDD) inference, revealing that in complex tasks like segmentation, convolutional layers—not attention—dominate the computational load. By leveraging the inherent resilience of these models to dynamic pruning, we demonstrate that significant energy savings and execution speedups can be achieved with minimal impact on accuracy.
Introduction
In real-time AI applications such as autonomous driving or live video conferencing, computational resources are rarely constant. System loads shift, and high-priority tasks may suddenly preempt GPU resources. Most current models are "static," requiring fixed computation regardless of the environment, which can lead to frame drops or system failure under constraint. This research addresses the need for RDD inference, allowing models to "dial down" complexity on the fly to maintain operational stability at a slight cost to accuracy.
Methodology
The researchers profiled the computational characteristics of popular ViT architectures, including SegFormer, Swin Transformer, and DETR-based models, across major benchmarks like ADE20K, Cityscapes, and COCO-2017.
Architectural Profiling and Simulation
The study analyzed the distribution of FLOPs (Floating Point Operations) and actual GPU runtime across model layers for varying image resolutions. Beyond standard NVIDIA RTX A5000 GPUs, the team utilized the MAGNet modular accelerator framework to simulate performance on custom, energy-efficient hardware.
Dynamic Adaptation Techniques
Two primary strategies for dynamic inference were explored:
- Dynamic Pruning: Bypassing computation in pretrained models by reducing channel counts in convolutional layers or skipping encoder blocks. This method is "free" as it requires no retraining.
- Model Switching: For models using ResNet backbones, Once-For-All (OFA) techniques were used to switch between pre-trained sub-networks of varying sizes based on available power.
The Convolution Surprise
A key insight from the profiling is that in segmentation and detection tasks, convolutions dominate the computational budget. Despite the "Transformer" label, these models rely on heavy convolutional decoders to fuse multi-scale features for high-resolution outputs.
As illustrated in the analysis, convolutions account for 68% of FLOPs in SegFormer and up to 89% in Swin Tiny. The researchers also noted that FLOP counts can be deceptive; because GPUs are highly optimized for convolutions, a convolutional layer may execute faster than an attention layer with fewer nominal FLOPs.
Key Results and Resilience
The study found that the task-specific decoder is the key to model resilience. In models like SegFormer, the sequential nature of decoder layers allows pruning-related savings to propagate backward more effectively than in the encoder.
- Energy Efficiency: Dynamic pruning of SegFormer B2 achieved 28% energy savings with only a 1.4% drop in mIoU. For ResNet-50 backbones, switching between OFA models saved 53% of energy with a 3.3% accuracy drop.
- GPU Performance: On a standard RTX A5000, the authors demonstrated an 11% reduction in execution time for SegFormer with less than 2% accuracy loss.
- Hardware Optimization: Using MAGNet, the team identified optimal memory buffer sizes (64-128 B/MAC) that balance throughput and area for these specific workloads.
Conclusion and Future Work
While retraining alternative execution paths can yield better accuracy-efficiency trade-offs, this paper proves that dynamic pruning of pretrained models is a highly effective and low-cost solution for real-time RDD inference. Future work will explore automated ways to identify resilient layers across diverse architectures and apply these principles to emerging foundation models like Segment Anything (SAM).
Summary updated