Cocco: Hardware-Mapping Co-Exploration towards Memory Capacity-Communication Optimization

Zhanhong Tan, Zijian Zhu, Kaisheng Ma

Abstract

Cocco is a hardware-mapping co-exploration framework designed to optimize the trade-off between on-chip memory capacity and external communication in Deep Neural Network (DNN) accelerators. By combining a novel "consumption-centric" subgraph execution scheme with a genetic algorithm (GA), Cocco simultaneously determines the ideal SRAM size and the optimal partitioning of complex neural network graphs. This joint optimization addresses the limitations of traditional decoupled methods, which often fail to find global optima for modern, irregular network architectures. Evaluation across a wide range of models shows that Cocco can reduce total system costs by up to 50% and external memory access by up to 74.7%.

Introduction: The Memory Capacity-Communication Trade-off

In the design of Deep Neural Network (DNN) accelerators, memory is the ultimate bottleneck. Designers face a "Goldilocks" problem: if the on-chip memory (SRAM) is too small, the system wastes energy and bandwidth constantly reloading data from external DRAM. Conversely, if the SRAM is too large, silicon area and manufacturing costs skyrocket.

While many compilers optimize "intra-layer" data reuse (tiling a single convolution), they often miss out on "inter-layer" reuse—keeping intermediate data on-chip between successive layers. Existing "layer fusion" techniques are usually handcrafted for simple, linear networks. However, modern networks are increasingly complex, featuring irregular connections and branches generated via Neural Architecture Search (NAS). Standard greedy or dynamic programming algorithms struggle to find optimal partitions for these complex graphs, especially when trying to decide the hardware configuration simultaneously.

The Cocco Framework

Cocco introduces a co-exploration approach that tackles these challenges through two main innovations: a consumption-centric execution model and a hardware-aware genetic algorithm.

Consumption-Centric Subgraph Execution

Traditional execution is typically "production-centric," where a layer produces as much data as possible, often filling buffers with data that downstream consumers are not yet ready for. Cocco flips this paradigm using a "pull-based" flow. In this model, the output node dictates exactly how much data it needs, and these requirements are propagated backward through the graph. This approach minimizes the memory footprint for arbitrary subgraphs and avoids the "extra data" overhead common in branched networks, where one branch might produce data faster than another can consume it.

Co-Exploration via Genetic Algorithm

The search space for simultaneous layer fusion and SRAM sizing is massive. Cocco utilizes a Genetic Algorithm (GA) to evolve "genomes" that represent both a hardware configuration and a graph partition scheme. Unlike "two-step" methods that pick a memory size and then optimize the software, Cocco evolves them together, allowing the mapping to adapt to hardware constraints and vice versa. Custom mutation and crossover operations, such as split-subgraph and merge-subgraph, ensure that the resulting partitions are always valid and computationally efficient.

Experimental Results and Insights

The framework was evaluated using a diverse set of architectures, including linear models (VGG16), multi-branch networks (ResNet, GoogleNet), attention-based models (Transformer, GPT), and irregular NAS-generated graphs (NasNet, RandWire).

  • Cost and Efficiency: Cocco achieved 1.89% to 50.33% lower total costs (a weighted metric of area and energy) compared to fixed-hardware baselines. Subgraph fusion reduced external memory access (EMA) by 42.3% to 74.7% compared to layer-wise execution.
  • Search Performance: The GA-based approach showed higher stability and faster convergence than Simulated Annealing (SA). It proved particularly effective for irregular graphs like NasNet, where greedy algorithms typically get trapped in local optima.
  • Hardware Insights: The study found that shared buffers for weights and activations generally outperform separate buffers, as they allow the system to dynamically shift resources based on whether a specific subgraph is weight-heavy or activation-heavy. Additionally, Cocco identifies the "saturated capacity" point, helping designers avoid over-provisioning SRAM beyond the point of diminishing returns for communication reduction.

Conclusion and Future Work

Cocco demonstrates that hardware-software co-optimization is essential for maximizing the efficiency of modern DNN accelerators. By aligning memory hierarchy design with sophisticated graph partitioning, the framework achieves significant gains in both energy efficiency and silicon area utilization. Future research directions include extending this framework to multi-core systems with complex Interconnects (NoC) and exploring dynamic partitioning for real-time resource contention in multi-tenant environments.

Summary updated

BibTeX
@inproceedings{tan2024cocco,
  author = {Zhanhong Tan and Zijian Zhu and Kaisheng Ma},
  title = {{Cocco: Hardware-Mapping Co-Exploration towards Memory Capacity-Communication Optimization}},
  booktitle = {ASPLOS},
  year = {2024},
  url = {https://openreview.net/forum?id=4k2JLSxCBZ},
}
Figure