NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Flexagon: A Multi-Dataflow Sparse-Sparse Matrix Multiplication Accelerator for Efficient DNN Processing

Francisco Muñoz-Martínez, Raveesh Garg, José L. Abellán, Michael Pellauer, Manuel E. Acacio, Tushar Krishna · DOI

Introduction

In the landscape of modern Deep Learning, "sparsity"—the prevalence of zero-valued elements within matrices—has become a primary target for optimization. Techniques such as pruning and ReLU activations create sparse tensors that, if processed efficiently, can significantly reduce energy consumption and execution time. Sparse-Sparse Matrix Multiplication (SpMSpM) is the fundamental operation used to skip these redundant zero-value computations.

However, SpMSpM hardware faces a "no free lunch" dilemma: the efficiency of a specific dataflow (the strategy for traversing and combining matrix elements) is highly dependent on the specific sparsity patterns and dimensions of the data. While existing accelerators are typically hard-wired for a single dataflow, Flexagon introduces a reconfigurable architecture capable of dynamically switching between Inner Product, Outer Product, and Gustavson’s algorithms to match the unique requirements of every DNN layer.

The Challenge: The Moving Target of Optimal Dataflow

Different dataflows offer distinct advantages. For example, an Inner Product dataflow might excel at certain matrix dimensions, while Gustavson’s (row-wise) algorithm is superior for others. The authors observe that the "best" dataflow is not static; it fluctuates not only between different AI models but even between individual layers of a single model. In an analysis of 60 layers within a MobileBERT model, the optimal dataflow flipped between Inner Product and Gustavson’s multiple times. Static, fixed-dataflow chips are inherently suboptimal for such dynamic workloads, as they remain "wrong" for a significant portion of the execution.

The Flexagon Architecture

Flexagon addresses this suboptimality through a reconfigurable design that adapts its hardware on the fly. Its architecture is built upon three core innovations:

1. Merger-Reduction Network (MRN)

Traditionally, hardware for "reducing" (adding partial sums) and "merging" (combining sorted lists of coordinates) required separate, dedicated circuits. Flexagon utilizes a novel tree-based MRN where individual nodes can be configured as either accumulators or comparators. This unified substrate allows the chip to support all major SpMSpM dataflows without the area bloat typically associated with multi-mode hardware.

2. Specialized 3-Tier Memory Hierarchy

Sparse data access is notoriously irregular, making standard memory structures inefficient. Flexagon employs a specialized hierarchy to manage this complexity:

  • FIFOs: Used for stationary data.
  • Caches: A low-power solution for streaming data.
  • Partial Sum RAM (PSRAM): A custom buffer designed specifically to manage "work-in-progress" results, or partial sums, which are often the bottleneck in sparse computation.

3. Format-Agnostic Execution

One of the most expensive overheads in sparse computing is converting between compressed formats (e.g., CSR to CSC). Flexagon bypasses this by using its dataflow flexibility to treat a CSR-encoded matrix as a CSC-encoded one simply by altering the loop order, effectively providing "zero-cost" format conversion.

Experimental Evaluation

The researchers evaluated Flexagon using eight diverse DNN models from the MLPerf benchmark suite, covering Computer Vision (AlexNet, VGG-16, ResNet-50), Object Recognition (SSD-Resnets, SSD-Mobilenets), and Natural Language Processing (DistilBERT, MobileBERT). These models represent a wide spectrum of sparsity ratios, ranging from 0.04% to 90%.

Flexagon was compared against state-of-the-art fixed-dataflow accelerators, including SIGMA-like (Inner Product), Sparch-like (Outer Product), and GAMMA-like (Gustavson’s) designs.

Key Results

  • Performance: Flexagon achieved average speedups of 4.59× over SIGMA-like, 1.71× over Sparch-like, and 1.35× over GAMMA-like architectures.
  • Area Efficiency: When accounting for chip size, Flexagon improved performance-per-area efficiency by 265%, 67%, and 18% respectively compared to the baselines.
  • Versatility: While specialized accelerators may occasionally outperform Flexagon on a specific layer they were specifically designed for, Flexagon was the only architecture to consistently perform near the "theoretical best" across all evaluated models.

Limitations and Future Work

Flexibility comes with trade-offs. Flexagon’s MRN and specialized memory structures introduce a roughly 25% area overhead compared to the simplest fixed-dataflow designs. Additionally, the decision of which dataflow to use for a specific layer is currently handled "offline" by a compiler. Future research could focus on automating this tiling and dataflow selection process and further optimizing the power consumption of the flexible interconnects.

Conclusion

Flexagon demonstrates that a one-size-fits-all approach to sparse acceleration is no longer sufficient for the diverse requirements of modern DNNs. By unifying merging and reduction logic into a single reconfigurable network, Flexagon provides the versatility needed to maintain high efficiency across varying sparsity patterns, setting a new standard for SpMSpM hardware acceleration.

Summary updated

BibTeX
@inproceedings{munozmartinez2023flexagon,
  author = {Francisco Muñoz-Martínez and Raveesh Garg and José L. Abellán and Michael Pellauer and Manuel E. Acacio and Tushar Krishna},
  title = {{Flexagon: A Multi-Dataflow Sparse-Sparse Matrix Multiplication Accelerator for Efficient DNN Processing}},
  booktitle = {ASPLOS},
  year = {2023},
  url = {https://openreview.net/forum?id=SpwzDpt8Wy},
}
Figure