Optimizing DNN Inference on Multi-Accelerator SoCs at Training-time

Matteo Risso, Alessio Burrello, Daniele Jahier PagliariarXiv 2024 · DOI

TL;DR

The authors present ODiMO (One-shot Differentiable Mapping Optimizer), a tool that optimizes the deployment of Deep Neural Networks (DNNs) onto heterogeneous multi-accelerator chips during the training phase. By splitting individual network layers at a fine grain to run concurrently across different computing units, ODiMO achieves up to an $8\times$ latency reduction and a $50.8\times$ energy efficiency improvement with negligible impact on accuracy.

What Problem Does This Paper Address?

Deploying deep learning models to edge devices (like smart sensors or wearables) requires balancing strict energy and latency constraints against model accuracy. To meet these demands, modern edge hardware increasingly relies on heterogeneous Systems-on-Chips (SoCs) that pack multiple specialized Computing Units (CUs)—such as digital processors, analog in-memory computing blocks, or specialized depthwise convolution engines.

However, utilizing these mixed hardware environments effectively is incredibly difficult. Different CUs use different data representations (e.g., 8-bit digital vs. ternary analog) or support only specific operations. Offloading a layer to a highly efficient but low-precision CU can severely degrade accuracy. Traditional mapping strategies either offload the entire network to a single CU or partition it coarsely on a layer-by-layer basis. As shown in Strategy B of the figure below, layer-wise partitioning leaves most of the chip idle at any given moment because standard DNNs execute sequentially.

Fig. 1. Different possible execution strategies of a DNN on a Heterogeneous SoC with shared memory. Strategy A offloads the DNN computation to a single CU. Strategy B uses a layer-wise scheme where each layer can be computed by one of the available CU. Strategy C is the intra-layer mapping scheme enabled by ODiMO, where the computation of each layer can be split among the different CUs.

Methods

ODiMO solves this by introducing intra-layer partitioning (Strategy C in Figure 1), which splits the computation of a single layer across multiple heterogeneous CUs simultaneously. It treats this fine-grained hardware mapping as a differentiable optimization problem solved during the network's training phase.

The framework operates in three distinct phases:

  1. Warmup: The network weights are trained normally to establish a baseline performance.
  2. Search: ODiMO introduces trainable mapping parameters ($\theta$) alongside standard network weights ($W$). It uses differentiable analytical cost models for latency and energy to optimize both task accuracy and hardware efficiency concurrently. To keep training fast, ODiMO exploits the linearity of convolutional layers to combine weights directly rather than running multiple separate convolutions.
  3. Final Training: The mapping parameters are frozen, and the weights are fine-tuned to recover any minor accuracy drops caused by the final hardware assignment.

Because a naive channel assignment would result in interleaved outputs in memory (causing massive data-marshaling overhead), ODiMO includes a post-optimization layer reorganization pass. This pass groups channels contiguously so they can be cleanly partitioned and executed in parallel.

Fig. 4. Final layer re-organization pass to support partitioning.

Datasets

The authors evaluated ODiMO on three standard computer vision benchmarks:

  • CIFAR-10
  • CIFAR-100
  • ImageNet-1k

These benchmarks were tested against two open-source heterogeneous hardware platforms: DIANA (combining an 8-bit digital CU and a ternary analog in-memory CU) and Darkside (combining a RISC-V processor cluster and a specialized Depthwise Convolution Engine).

Key Insights and Ideas

  • Hardware Allocation as "Soft Pruning": Instead of completely deleting less important channels to save energy (as in traditional structured pruning), ODiMO maps them to highly efficient, lower-precision CUs (like analog in-memory computing). This retains the channels' residual representational power and yields better accuracy-efficiency trade-offs than outright elimination.
  • Exploiting Parallelism in Sequential Networks: By partitioning a layer's output channels among multiple CUs, ODiMO forces parallel execution even within strictly sequential network architectures like MobileNetV1.
  • Training-Time Hardware Awareness: Incorporating hardware cost models directly into the loss function allows the gradient descent optimizer to automatically navigate complex hardware constraints that would be impossible to optimize manually.

Key Results

ODiMO consistently outperformed manual heuristic mappings and state-of-the-art optimization baselines across all tasks:

  • Darkside SoC (Latency & Energy): When optimizing for latency on CIFAR-10, ODiMO reduced execution cycles by up to $8\times$ at iso-accuracy compared to standard convolution baselines. When targeting energy, it produced mappings that were up to $50.8\times$ more efficient with an accuracy drop of less than 0.3%.
  • DIANA SoC vs. Pruning: On CIFAR-10, ODiMO found a mapping that was 21% faster and 0.54% more accurate than standard structured channel pruning.
  • Scalability: The framework successfully scaled to ImageNet-1k, demonstrating its viability for complex, real-world workloads.

Limitations and Future Work

A current limitation of ODiMO is its assumption that all CUs share a unified memory region for activations. While this holds true for the DIANA and Darkside SoCs, many edge platforms utilize private, distributed memories.

The authors note that future iterations of ODiMO will expand to accommodate these architectures by integrating data broadcasting and communication overheads directly into the differentiable cost models. They also plan to explore more diversified computing units and non-convolutional architectures like Vision Transformers (ViTs).

Summary updated

Abstract

The demand for executing Deep Neural Networks (DNNs) with low latency and minimal power consumption at the edge has led to the development of advanced heterogeneous Systems-on-Chips (SoCs) that incorporate multiple specialized computing units (CUs), such as accelerators. Offloading DNN computations to a specific CU from the available set often exposes accuracy vs efficiency trade-offs, due to differences in their supported operations (e.g., standard vs. depthwise convolution) or data representations (e.g., more/less aggressively quantized). A challenging yet unresolved issue is how to map a DNN onto these multi-CU systems to maximally exploit the parallelization possibilities while taking accuracy into account. To address this problem, we present ODiMO, a hardware-aware tool that efficiently explores fine-grain mapping of DNNs among various on-chip CUs, during the training phase. ODiMO strategically splits individual layers of the neural network and executes them in parallel on the multiple available CUs, aiming to balance the total inference energy consumption or latency with the resulting accuracy, impacted by the unique features of the different hardware units. We test our approach on CIFAR-10, CIFAR-100, and ImageNet, targeting two open-source heterogeneous SoCs, i.e., DIANA and Darkside. We obtain a rich collection of Pareto-optimal networks in the accuracy vs. energy or latency space. We show that ODiMO reduces the latency of a DNN executed on the Darkside SoC by up to 8x at iso-accuracy, compared to manual heuristic mappings. When targeting energy, on the same SoC, ODiMO produced up to 50.8x more efficient mappings, with minimal accuracy drop (< 0.3%).
BibTeX
@misc{risso2024optimizing,
  author = {Matteo Risso and Alessio Burrello and Daniele Jahier Pagliari},
  title = {{Optimizing DNN Inference on Multi-Accelerator SoCs at Training-time}},
  year = {2024},
  eprint = {2409.18566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.18566},
}

Loading related content...

Figure