Executive Summary
Spatially dynamic networks—which skip computations on "unimportant" image regions—often fail to deliver real-world speedups on GPUs due to inefficient memory access. LASNet bridges this gap by using a novel latency prediction model to guide the design of coarse-grained (patch-based) inference and hardware-aware scheduling, achieving up to a 46% reduction in actual latency without sacrificing accuracy.
The FLOPs-Latency Gap
In the quest for efficient deep learning, "dynamic neural networks" have emerged as a clever solution. Instead of treating every pixel in an image with equal importance, these models skip computations on redundant areas (like a blurry background) to save on Floating Point Operations (FLOPs).
However, researchers often encounter a frustrating "FLOPs-latency gap." While a model might theoretically require 50% fewer FLOPs, it often runs just as slowly as the original on a GPU. This happens because multi-core processors like GPUs thrive on massive, contiguous blocks of data. Previous dynamic methods operated at a fine-grained, pixel-to-pixel level, creating fragmented memory patterns that force the GPU to spend more time moving data than actually computing.
This paper addresses the need for a hardware-aware approach that considers scheduling and memory access as much as algorithmic complexity.
Introducing LASNet
To bridge the gap between theoretical computation and practical efficiency, the authors introduce LASNet (Latency-aware Spatial-wise Dynamic Network). The framework relies on three main pillars:
- Latency Prediction Model: Rather than guessing speed based on FLOPs, the authors built a predictor that estimates real-world execution time. It takes into account hardware specs (number of processing engines, bandwidth), layer parameters, and the "activation rate" (how much of the image is being processed).
- Coarse-grained Granularity: Instead of deciding whether to process every single pixel ($1 \times 1$), LASNet operates on patches (e.g., $4 \times 4$ or $8 \times 8$). While this is theoretically less flexible than pixel-level skipping, it results in much more contiguous memory blocks, which GPUs can process significantly faster.
- Advanced Operator Fusion: The authors optimized the "plumbing" of the network. They fused the "masker" (the part that decides what to skip) with the first convolution and combined "gather/scatter" operations. This reduces the overhead of moving data in and out of memory, which is often the primary bottleneck for dynamic models.
The model is trained using a Gumbel-Softmax trick to handle the non-differentiable nature of skipping regions, alongside a teacher-student distillation loss to maintain high accuracy.
Key Insights
- The Granularity Sweet Spot: The most surprising finding is that "less is more." By being less precise about which pixels to skip (using $8 \times 8$ patches instead of $1 \times 1$), the model becomes significantly faster on hardware. The latency predictor helps find the exact patch size where the benefits of contiguous memory outweigh the "waste" of computing a few extra background pixels.
- FLOPs are a Liar: The paper reinforces that FLOPs are an inaccurate proxy for efficiency on modern hardware. A model with higher FLOPs but better memory alignment can easily outperform a "low-FLOP" model in real-world latency.
- Hardware-Specific Optimization: The "realistic speedup" varies by device. On edge devices (like the Jetson TX2), which are often computation-bounded, the speedup closely tracks FLOP savings. On powerful server GPUs (like the V100), which are memory-bounded, the scheduling and patch-size optimizations are the primary drivers of speed.
Performance and Results
The researchers evaluated LASNet across standard computer vision benchmarks, including ImageNet for classification and COCO for object detection and instance segmentation. Testing spanned diverse hardware, from server-grade GPUs (Nvidia Tesla V100) to edge devices (Nvidia Jetson TX2).
- ResNet-101 Efficiency: On ImageNet, LASNet reduced the average latency of a ResNet-101 by 36% on a Tesla V100 and 46% on a Jetson TX2, all while maintaining or slightly improving top-1 accuracy.
- Superior to Baselines: LASNet consistently outperformed other dynamic methods like DynConv and SkipNet. In some cases, it achieved a 1.9% accuracy increase over static models with similar inference speeds.
- Generalization: When applied to object detection on COCO, LASNet-backed models were significantly faster than standard ResNet baselines while maintaining nearly identical mean Average Precision (mAP).
Limitations and Future Work
While highly effective, the latency predictor requires specific hardware parameters. This means the model needs to be re-calibrated if moving to a radically different hardware architecture, such as a specialized TPU. Additionally, while LASNet excels at spatial skipping, combining it with aggressive layer skipping without losing accuracy remains a challenge.
Looking ahead, the authors suggest this "coarse-grained" philosophy could be extended beyond CNNs to other architectures, such as Vision Transformers (ViTs), where token-dropping strategies face similar hardware-alignment hurdles.
Summary updated