Efficient Multitask Learning on Resource-Constrained Systems

Yubo Luo, Le Zhang, Zhenyu Wang, Shahriar NirjonarXiv 2023

Abstract

We present Antler, which exploits the affinity between all pairs of tasks in a multitask inference system to construct a compact graph representation of the task set and finds an optimal order of execution of the tasks such that the end-to-end time and energy cost of inference is reduced while the accuracy remains similar to the state-of-the-art. The design of Antler is based on two observations: first, tasks running on the same platform shows affinity, which is leveraged to find a compact graph representation of the tasks that helps avoid unnecessary computations of overlapping subtasks in the task set; and second, tasks that run on the same system may have dependencies, which is leveraged to find an optimal ordering of the tasks that helps avoid unnecessary computations of the dependent tasks or the remaining portion of a task. We implement two systems: a 16-bit TI MSP430FR5994-based custom-designed ultra-low-power system, and a 32-bit ARM Cortex M4/M7-based off-the-shelf STM32H747 board. We conduct both dataset-driven experiments as well as real-world deployments with these systems. We observe that Antler's execution time and energy consumption are the lowest compared to all baseline systems and by leveraging the similarity of tasks and by reusing the intermediate results from previous task, Antler reduces the inference time by 2.3X -- 4.6X and saves 56% -- 78% energy, when compared to the state-of-the-art.

Introduction

Modern IoT devices, such as smartwatches and voice assistants, are increasingly required to execute multiple deep neural networks (DNNs) concurrently. For instance, an audio-based device might simultaneously perform wake-word recognition, speaker identification, and emotion detection. However, these devices are severely resource-constrained, characterized by limited CPU speeds, small RAM capacities, and significant energy overheads associated with data transfers from flash storage.

Existing optimization strategies often focus on model compression or fine-grained weight sharing. However, these approaches frequently overlook two critical opportunities: high-level task affinity and execution dependencies. Redundant computations occur when tasks share latent subtasks (e.g., noise compensation), and inefficiencies arise when systems ignore conditional logic or fail to optimize execution sequences.

The Antler System

Antler addresses these challenges through a multi-stage optimization pipeline designed to minimize redundant computation and data movement by exploiting the inherent relationships between tasks.

Task Graph Generation and Affinity

Instead of treating models as independent pipelines, Antler groups tasks into a unified "task graph." This process relies on measuring Task Affinity, which profiles the similarity of data representations at various layers across different networks. By identifying these overlaps, Antler can merge common subtasks into a single shared path, reducing the total computational load. A "Variety Score" is employed to navigate the trade-off between graph compactness (energy efficiency) and representation diversity (accuracy).

Optimal Execution Ordering

The problem of determining the most efficient sequence for task execution is mathematically complex, reducible to the Traveling Salesman Problem (TSP) and thus NP-Complete. Antler formulates this as an Integer Linear Programming (ILP) problem aimed at minimizing "switching costs"—the time and energy required to load new weights from flash to RAM. By treating task transitions as paths on a weighted graph, the system maximizes the reuse of neural network blocks already present in memory.

The Antler pipeline: (a) Input preprocessing, (b) Task Graph Generation through affinity merging, and (c) Optimal Task Execution Order modeling.

Handling Dependencies

Antler explicitly incorporates inter-task dependencies, including:

  • Precedence Constraints: Ensuring Task A completes before Task B begins.
  • Conditional Constraints: Executing Task B only if Task A’s output satisfies specific probabilistic thresholds (e.g., only running face recognition if a person is detected).

Experimental Evaluation

The system was evaluated on two hardware platforms: a custom 16-bit TI MSP430 (ultra-low power) and a 32-bit ARM Cortex-M7. Testing spanned nine datasets across image (e.g., CIFAR-10, GTSRB), audio (e.g., Google Speech Commands), and IMU modalities, alongside real-world deployments for audio and image tasks.

Key Results

  • Efficiency and Energy: Antler achieved a 2.3x to 4.6x reduction in inference time and saved 56% to 78% in energy consumption compared to state-of-the-art baselines like YONO and NWV. These gains are primarily attributed to the reduction in redundant math and minimized flash-to-RAM data transfers.
  • Accuracy: The system maintained high fidelity, with accuracy typically within ±3% of standalone models, and as close as ±1% in real-world scenarios.
  • Memory Footprint: By exploiting task overlaps, Antler significantly reduced memory usage (e.g., from 1328 KB to 587 KB in specific tests) compared to vanilla sequential execution.

Conclusion and Future Work

Antler demonstrates that exploiting task affinity and optimizing execution order can yield massive efficiency gains for embedded multitask learning. Future research will explore supporting heterogeneous architectures (e.g., combining CNNs and Transformers) and developing dynamic execution strategies that adapt to real-time environmental conditions or battery levels.

Summary updated

BibTeX
@misc{luo2023efficient,
  author = {Yubo Luo and Le Zhang and Zhenyu Wang and Shahriar Nirjon},
  title = {{Efficient Multitask Learning on Resource-Constrained Systems}},
  year = {2023},
  eprint = {2302.13155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.13155},
}
Figure