DESCNet: Developing Efficient Scratchpad Memories for Capsule Network Hardware

Alberto Marchisio, Vojtech Mrazek, Muhammad Abdullah Hanif, Muhammad Shafique · DOI

Abstract

Deep Neural Networks (DNNs) have been established as the state-of-the-art algorithm for advanced machine learning applications. Recently proposed by the Google Brain's team, the Capsule Networks (CapsNets) have improved the generalization ability, as compared to DNNs, due to their multi-dimensional capsules and preserving the spatial relationship between different objects. However, they pose significantly high computational and memory requirements, making their energy-efficient inference a challenging task. This paper provides, for the first time, an in-depth analysis to highlight the design and management related challenges for the (on-chip) memories deployed in hardware accelerators executing fast CapsNets inference. To enable an efficient design, we propose an application-specific memory hierarchy, which minimizes the off-chip memory accesses, while efficiently feeding the data to the hardware accelerator. We analyze the corresponding on-chip memory requirements and leverage it to propose a novel methodology to explore different scratchpad memory designs and their energy/area trade-offs. Afterwards, an application-specific power-gating technique is proposed to further reduce the energy consumption, depending upon the utilization across different operations of the CapsNets. Our results for a selected Pareto-optimal solution demonstrate no performance loss and an energy reduction of 79% for the complete accelerator, including computational units and memories, when compared to a state-of-the-art design executing Google's CapsNet model for the MNIST dataset.

Introduction

While traditional Deep Neural Networks (DNNs) have dominated machine learning, Capsule Networks (CapsNets) represent a significant advancement by better understanding spatial relationships between objects. Unlike standard neurons that output scalar values, capsules use multi-dimensional vectors to preserve hierarchical relationships. However, this increased representational power comes at a high cost: CapsNets require complex operations like dynamic routing and have massive memory footprints.

In existing CapsNet hardware, a staggering 96% of total energy is often consumed by memory (both on-chip and off-chip). Standard DNN accelerators are not optimized for the unique dataflow of CapsNets, leading to wasted area and significant leakage power in unused memory sectors. DESCNet addresses this by designing a memory hierarchy that specifically adapts to the processing patterns of CapsNets.

Methodology

The DESCNet framework employs a systematic approach to optimize the memory hierarchy for CapsNet inference. The methodology consists of three primary stages: application-driven analysis, architecture design, and automated design space exploration.

Overview of the DESCNet framework, illustrating the interaction between offline analysis, memory design space exploration, and the hardware accelerator.

The researchers meticulously mapped out the memory needs (reads, writes, and storage size) for every stage of CapsNet inference. They proposed a multi-banked Scratchpad Memory (SPM) partitioned into sectors. This partitioning enables fine-grained power-gating, where unused parts of the memory are deactivated to save leakage power. Three memory organization flavors were explored:

  • Shared Multi-Port (SMP): A unified pool for weights, data, and accumulators.
  • Separated Memory (SEP): Dedicated, independent memories for each data type.
  • Hybrid (HY): A combination of shared and separated pools to balance flexibility and efficiency.

An automated Design Space Exploration (DSE) tool was used to search through thousands of configurations to identify Pareto-optimal designs that balance area, energy, and performance. The architecture was evaluated using the MNIST dataset for the original Google CapsNet model and CIFAR10 for the more complex DeepCaps model.

Analysis and Results

A key insight from the analysis is that memory utilization varies wildly between layers. For instance, the PrimaryCaps layer requires significant memory, while the ClassCaps layer is less demanding.

On-chip memory usage analysis across different layers of a Capsule Network, comparing specialized accelerators like CapsAcc against general-purpose designs like the TPU.

The analysis revealed that "accumulators"—used for temporary sums during dynamic routing—are major memory consumers, often requiring more space and more frequent access than weights or input data. By keeping this data on-chip during routing iterations, DESCNet drastically reduces expensive off-chip DRAM accesses.

The DESCNet optimization yielded significant improvements over the state-of-the-art CapsAcc accelerator:

  • Energy Efficiency: Achieved a 79% reduction in total energy consumption.
  • Area Savings: Reduced the total hardware area by up to 47%.
  • Performance: These gains were achieved with zero performance loss in terms of throughput or accuracy.
  • Scalability: The architecture successfully enabled the execution of the complex DeepCaps model on hardware that previously lacked sufficient memory.

Conclusion

DESCNet demonstrates that application-specific memory management is crucial for the efficient deployment of next-generation neural networks like CapsNets. By leveraging fine-grained power-gating and optimized SPM architectures, the energy bottleneck of memory can be significantly mitigated. Future work will explore on-chip training challenges and the impact of more advanced semiconductor nodes (e.g., 7nm FinFET) on these leakage-saving techniques.

Summary updated

BibTeX
@article{marchisio2020descnet,
  author = {Alberto Marchisio and Vojtech Mrazek and Muhammad Abdullah Hanif and Muhammad Shafique},
  title = {{DESCNet: Developing Efficient Scratchpad Memories for Capsule Network Hardware}},
  journal = {IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.},
  year = {2020},
  doi = {10.1109/tcad.2020.3030610},
}
Figure