Multi-Agent Reinforcement Learning for Sample-Efficient Deep Neural Network Mapping

Srivatsan Krishnan, Jason Jabbour, Dan Zhang, Natasha Jaques, Aleksandra Faust, Shayegan Omidshafiei, Vijay Janapa ReddiarXiv 2025 · DOI

Abstract

Mapping Deep Neural Networks (DNNs) onto hardware accelerators involves navigating a massive combinatorial search space of tiling, loop ordering, and parallelization strategies. Traditional single-agent Reinforcement Learning (RL) approaches often suffer from poor sample efficiency, making them impractical for rapid hardware design cycles. This paper proposes a decentralized Multi-Agent Reinforcement Learning (MARL) framework that factorizes the search space using a correlation-based clustering algorithm. By grouping interdependent parameters and assigning them to parallel agents, the proposed method achieves 30–300× faster convergence and significantly improves hardware performance metrics such as latency and energy efficiency compared to state-of-the-art baselines.

Introduction: The Mapping Challenge

To run a modern AI model efficiently, it must be mapped to the underlying hardware. This process involves deciding how to "tile" data into memory hierarchies, determining the execution order of loops, and parallelizing work across thousands of processing elements (PEs).

Mapping components: (a) Tiling, (b) Loop order, and (c) Loop parallelization.

The challenge lies in the astronomical search space; for a single CNN layer, the number of possible configurations can exceed $10^{39}$. While Reinforcement Learning (RL) is effective at navigating complex spaces, standard "single-agent" RL is notoriously sample-inefficient. In hardware design, where each sample requires a slow simulation, this inefficiency makes single-agent RL too expensive for practical use.

Methods: Decentralized MARL and Clustering

The authors propose a "divide and conquer" strategy using Decentralized MARL. Instead of a single agent managing every mapping parameter, the workload is distributed across multiple agents.

The core innovation is Algorithm 1: Agglomerative Clustering for Agent Assignment. The process follows these steps:

  1. Data Collection: A small number of initial trials are conducted to observe how mapping parameters (e.g., tile size vs. loop order) affect the final reward, such as latency.
  2. Correlation Analysis: A correlation matrix is calculated to identify parameters that "move together."
  3. Clustering: Highly correlated parameters are grouped and assigned to a single agent, while independent parameters are given to separate agents.
  4. Parallel Learning: Agents learn in parallel, communicating indirectly through a shared global reward.
Example of mapping parameters across L2 and L1 buffer hierarchies.

By factorizing the search space, the framework transforms one massive problem into several manageable tasks that can be explored simultaneously.

Evaluation and Key Results

The researchers evaluated their framework using layers from prominent CNN architectures: MobileNet-v2, ResNet18, VGG16, and AlexNet. They used Maestro, an open-source hardware cost model, to simulate latency, energy, and area utilization.

The MARL approach consistently outperformed baselines:

  • Convergence Speed: It reached optimal solutions 30–300× faster than standard single-agent RL. For a ResNet18 layer, it converged 120× faster.
  • Hardware Performance: Under the same sample budget, MARL achieved up to 32.61× lower latency and 16.45× better Energy-Delay Product (EDP) than single-agent RL.
  • Versatility: It surpassed other optimization techniques, including Genetic Algorithms (GA) and Bayesian Optimization (BO), across various hardware objectives.

Insights and Future Work

The "aha moment" of this research is the realization that the design space has a spatial structure that can be exploited through factorization. Clustering based on correlation finds a "Goldilocks zone" between chaotic full decentralization and slow centralization.

While the clustering algorithm requires an initial "seed" dataset of about 20,000 samples, this is a one-time cost that is significantly smaller than the total cost of single-agent RL. A promising future direction is Transfer Learning—reusing agent assignments learned on one model to jumpstart the mapping process for new architectures, further reducing overhead.

Summary updated

BibTeX
@misc{krishnan2025multi,
  author = {Srivatsan Krishnan and Jason Jabbour and Dan Zhang and Natasha Jaques and Aleksandra Faust and Shayegan Omidshafiei and Vijay Janapa Reddi},
  title = {{Multi-Agent Reinforcement Learning for Sample-Efficient Deep Neural Network Mapping}},
  year = {2025},
  eprint = {2507.16249},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.16249},
}
Figure