Abstract
Deep learning inference on mobile and edge devices faces significant challenges due to hardware heterogeneity, dynamic environmental conditions, and the increasing prevalence of multi-DNN workloads. Traditional "one-size-fits-all" optimization strategies often fail to maintain Service-Level Objectives (SLOs) when resource availability shifts. This paper presents CARIn (Constraint-Aware and Responsive Inference), a framework that utilizes a novel multi-objective optimization solver, RASS, to generate a diverse menu of execution plans offline. At runtime, a lightweight manager monitors device state and performs near-instantaneous configuration swaps to adapt to constraints like thermal throttling or memory pressure. Experimental results demonstrate that CARIn achieves up to 10.69× better performance balance compared to state-of-the-art methods while maintaining zero-latency switching overhead.
Introduction
The deployment of Deep Neural Networks (DNNs) on mobile devices is a complex multi-dimensional optimization problem. Developers must balance high accuracy against strict constraints on latency, battery consumption, and memory footprint. This task is further complicated by three primary factors:
- Device Heterogeneity: Hardware capabilities vary wildly across the mobile ecosystem, meaning a configuration optimized for a flagship device may be unusable on a mid-tier model.
- Dynamic Environments: Real-world conditions, such as thermal throttling due to ambient temperature or background process activity, can drastically alter available compute resources.
- Multi-DNN Workloads: Modern applications frequently execute multiple models concurrently (e.g., simultaneous face detection and audio processing), leading to resource contention that static optimization cannot resolve.
Existing solutions typically provide a single static execution plan. When environmental conditions change, these plans often fail to meet application SLOs. CARIn addresses this by shifting from static optimization to a responsive, multi-plan approach.
The CARIn Framework
CARIn operates through a decoupled architecture consisting of an offline optimization phase and an online adaptation phase.
Offline Optimization
The core of the offline component is the Runtime-Aware Sorting and Search (RASS) solver. RASS treats deployment as a Multi-Objective Optimization (MOO) task, evaluating a wide design space of model architectures and hardware configurations (e.g., CPU thread counts, GPU precision). Unlike traditional solvers that seek a single global optimum, RASS uses a weighted Mahalanobis distance to identify a set of Pareto-optimal designs. This "menu" of configurations is specifically curated to cover various "what-if" scenarios, such as sudden drops in available RAM or GPU unavailability.
Online Adaptation
At runtime, the Runtime Manager (RM) continuously monitors the device's health and resource availability. When a bottleneck—such as thermal throttling—is detected, the RM does not attempt to re-solve the complex optimization problem. Instead, it performs a lookup and instantly swaps the current execution plan for a pre-calculated alternative from the RASS-generated menu. This approach avoids the 12-34ms latency typically associated with on-the-fly optimization, ensuring seamless application performance.
Evaluation and Key Results
The researchers evaluated CARIn across four diverse real-world use cases, including ImageNet-1k classification, BERT-based text classification, multi-modal scene recognition, and multi-attribute facial analysis.
Key findings include:
- Superior Optimality: CARIn achieved average performance gains of 1.19× to 1.57× over traditional single-architecture baselines.
- State-of-the-Art Comparison: Compared to OODIn, a leading prior framework, CARIn demonstrated a 10.69× improvement in balancing multiple objectives.
- Multi-DNN Efficiency: In scenarios with concurrent models, CARIn provided up to a 4.06× gain over hardware-unaware designs.
- Zero-Latency Switching: The pre-calculated nature of the plans allows for near-instantaneous adaptation, critical for real-time applications.
Conclusion and Future Work
CARIn represents a significant step toward robust mobile AI by anticipating runtime failures during the design phase. However, the current implementation relies on exhaustive profiling of models on target devices, which presents a scalability challenge. Future research will focus on integrating performance predictors to estimate hardware behavior without manual profiling and extending the framework to support the unique resource demands of Generative AI and Large Language Models (LLMs) on the edge.
Summary updated