Mobiprox: Supporting Dynamic Approximate Computing on Mobiles

Matevz Fabjancic, Octavian Machidon, Hashim Sharif, Yifan Zhao, Sasa Misailovic, Veljko Pejovic

TL;DR

This paper introduces Mobiprox, a novel framework that enables dynamic, context-aware approximation of deep learning (DL) models on mobile devices. By intelligently adjusting computational approximations at runtime, Mobiprox significantly reduces energy consumption and improves inference speed with minimal impact on accuracy, making powerful DL applications more feasible on resource-constrained mobile platforms.

What Problem Does This Paper Address?

Mobile devices are increasingly running complex deep learning (DL) applications, from image recognition to voice assistants. However, these models are computationally intensive, draining batteries and leading to slow performance on limited mobile hardware. While existing DL compression techniques can reduce resource demands, they often permanently impair model accuracy. Furthermore, current methods for dynamic approximation (adjusting complexity on the fly) are either too slow, require extensive retraining, or lack mobile-ready implementations. This paper addresses the challenge of making DL on mobile devices truly adaptable to varying resource availability, user needs, and input complexity, without requiring specialized expertise from data scientists.

Methods

Mobiprox tackles this problem through a multi-pronged approach:

  • Compiler-Level Primitives: It implements low-level, software-based approximation techniques for core tensor operations (like convolution perforation and filter sampling) that can be executed on mobile CPUs and GPUs via OpenCL. This avoids the need for specialized hardware.
  • End-to-End Pipeline: Mobiprox provides a complete pipeline for searching, selecting, and compiling approximation configurations. This includes:
  • ApproxHPVM & ApproxTuner: Leveraging existing tools for heterogeneous compilation and approximation configuration search.
  • Mobile Profiler: A novel Android-based profiler that accurately measures the speedup and accuracy trade-offs of approximation configurations directly on the target mobile device, addressing discrepancies between server-based and mobile performance.
  • Dynamic Adaptation Strategies: Mobiprox implements two novel strategies for runtime adaptation:
  • State-driven: Adjusts approximation based on the stability of observed states (e.g., user activity).
  • Confidence-driven: Uses the classifier's softmax confidence as a proxy for accuracy to guide approximation levels.
  • JNI Interface: Allows mobile applications to dynamically control approximation levels at runtime.

Datasets

The paper evaluates Mobiprox on several standard datasets and real-world scenarios:

  • CIFAR-10: Used for evaluating image recognition architectures (AlexNet, VGG16, MobileNet).
  • UCI-HAR (Human Activity Recognition): Used for evaluating MobileNet and ResNet50 models trained on human activity data.
  • Real-world HAR Traces: Data collected from participants wearing sensors, simulating unscripted mobile usage.
  • Google Speech Commands (GSC) v0.01: Used for evaluating spoken keyword recognition.
  • Real-world SKR Trace: A trace of spoken utterances with varying noise levels, simulating realistic environmental conditions.

No new benchmarks were introduced, but the evaluation uses real-world traces to demonstrate practical applicability.

Key Insights and Ideas

  • Mobile Performance Discrepancy: Server-based profiling of approximation configurations can be misleading; actual mobile performance can be significantly lower due to platform-specific overheads and hardware characteristics. This highlights the critical need for on-device profiling.
  • Adaptation is Key for Mobile DL: Static compression is insufficient for mobile environments where context (battery, user activity, environment noise) constantly changes. Dynamic, context-aware adaptation is crucial for balancing performance and accuracy.
  • Energy Savings are Significant: Mobiprox can achieve substantial system-wide energy savings (up to 15%) with only a minor drop in accuracy (around 2%), making DL applications more sustainable on mobile devices.
  • Approximation Benefits Larger Models: Larger, more complex models (like VGG and AlexNet) are more amenable to approximation, potentially making previously prohibitive models viable for mobile deployment.
  • Adaptation Strategy Impact: While the adaptation strategy itself has minimal computational overhead, its choice significantly impacts the achieved energy savings and accuracy trade-offs.

Key Results

  • Energy Savings: Mobiprox achieved up to 15% system-wide energy savings in both Human Activity Recognition (HAR) and Spoken Keyword Recognition (SKR) domains, with only a 2% drop in average accuracy for HAR.
  • Speedup: While server-based tuning suggested speedups of over 2.5x for MobileNet, on-device speedups were more modest, around 50% lower than server-based estimates, underscoring the importance of on-device profiling.
  • Configuration Identification Time: The process of identifying Pareto-optimal approximation configurations was completed within 30 minutes for complex networks on a GPU cluster and within 58 minutes on a low-end mobile device for profiling.
  • Generalizability: Mobiprox demonstrated good generalizability across different NN architectures (MobileNet, AlexNet, VGG, ResNet) and mobile platforms (ASUS TinkerBoard S, various Android phones).

Limitations and Future Work

  • No Guarantees on QoS: Mobiprox cannot guarantee specific Quality of Service (QoS) loss levels or predict maximal expected QoS loss on unseen data.
  • Limited Approximation Types for Non-Convolutional Layers: For layers without convolutions, Mobiprox currently only supports half-precision quantization, offering limited approximation choices.
  • Adaptation Strategy Suitability: The current adaptation strategies are best suited for scenarios with slowly changing contexts (e.g., HAR, SKR) and may not be ideal for tasks with rapid, unpredictable changes like anomaly detection.
  • Future Work: The authors plan to:
  • Integrate with other mobile DL compiler stacks (TVM, PyTorch Mobile, TF Lite) for potentially better performance.
  • Investigate dynamic pruning for fully-connected layers to expand approximation options.
  • Adapt strategies for tasks like object tracking in live video.
  • Explore more sophisticated adaptation algorithms for rapidly changing environments.

Summary updated

BibTeX
@article{fabjancic2024mobiprox,
  author = {Matevz Fabjancic and Octavian Machidon and Hashim Sharif and Yifan Zhao and Sasa Misailovic and Veljko Pejovic},
  title = {{Mobiprox: Supporting Dynamic Approximate Computing on Mobiles}},
  journal = {IEEE Internet of Things Journal},
  year = {2024},
  doi = {10.1109/jiot.2024.3365957},
}
Figure