[Paper Review] 26ms Inference Time for ResNet-50: Towards Real-Time Execution of all DNNs on Smartphone
CADNN is a programming framework that enables real-time DNN inference on smartphones by combining advanced ADMM-based weight pruning with architecture-aware optimizations, achieving 26ms inference time for ResNet-50 and up to 8.8× speedup over TensorFlow Lite and 6.4× over TVM on CPU and GPU.
With the rapid emergence of a spectrum of high-end mobile devices, many applications that required desktop-level computation capability formerly can now run on these devices without any problem. However, without a careful optimization, executing Deep Neural Networks (a key building block of the real-time video stream processing that is the foundation of many popular applications) is still challenging, specifically, if an extremely low latency or high accuracy inference is needed. This work presents CADNN, a programming framework to efficiently execute DNN on mobile devices with the help of advanced model compression (sparsity) and a set of thorough architecture-aware optimization. The evaluation result demonstrates that CADNN outperforms all the state-of-the-art dense DNN execution frameworks like TensorFlow Lite and TVM.
Motivation & Objective
- Address the performance gap between peak mobile hardware capability and actual DNN inference performance on smartphones.
- Overcome the challenges of irregular computation patterns and memory access caused by model compression (e.g., sparsity from pruning).
- Minimize accuracy loss while maximizing model compression rates using advanced pruning techniques.
- Develop a comprehensive optimization stack tailored to mobile CPU and GPU architectures for compressed DNNs.
- Achieve real-time inference (sub-30ms) for large DNNs like ResNet-50 on consumer mobile devices.
Proposed method
- Employ ADMM (Alternating Direction Method of Multipliers) for structured weight pruning, enabling high compression rates with minimal accuracy loss.
- Transform computation patterns by fusing multiple layers (e.g., Conv + BatchNorm + ReLU) into larger kernels to improve memory access and SIMD utilization.
- Convert 1×1 convolutions into matrix multiplication operations to enhance memory and compute efficiency.
- Apply memory layout transformations including tiling, alignment, and padding to improve data locality on CPU and GPU.
- Implement redundant memory load elimination via compiler-level code transformation based on repeated filter access patterns.
- Use a knowledge-guided, compiler-based tuning strategy to select optimal optimization parameters (e.g., tile sizes, unrolling factors) for different DNNs and hardware.
Experimental results
Research questions
- RQ1Can advanced model compression via ADMM achieve high pruning rates with near-zero accuracy degradation on mobile DNNs?
- RQ2How can architecture-aware optimizations mitigate performance degradation caused by irregular memory access in pruned DNNs?
- RQ3To what extent can computation fusion and memory layout transformation improve inference latency on mobile CPUs and GPUs?
- RQ4What is the performance gain of CADNN over state-of-the-art dense DNN frameworks like TensorFlow Lite and TVM when executing compressed models?
- RQ5Can a unified optimization framework effectively handle diverse DNNs and mobile hardware platforms with minimal manual tuning?
Key findings
- CADNN achieves 348×, 36×, and 8× weight pruning rates with near-zero accuracy loss for LeNet-5, AlexNet, and ResNet-18, respectively.
- On a Xiaomi 6 smartphone, CADNN achieves 21ms inference time for ResNet-50, meeting real-time requirements (<30ms).
- CADNN outperforms TensorFlow Lite and TVM by up to 8.8× on CPU and 6.4× on GPU across four benchmark DNNs including Inception-V3 and MobileNet.
- The framework reduces memory access irregularity through layer fusion and redundant load elimination, significantly improving data locality.
- Memory layout transformations (tiling, alignment, padding) and optimized parameter selection lead to measurable performance gains on both CPU and GPU.
- CADNN demonstrates that combining advanced model compression with architecture-aware compilation yields superior performance compared to dense DNN execution frameworks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.