LEGO: Spatial Accelerator Generation and Optimization for Tensor Applications

Yujun Lin, Zhekai Zhang, Song Han
9/15/2025
cs.ARcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Modern tensor applications, especially foundation models and generative AI applications require multiple input modalities (both vision and language), which increases the demand for flexible accelerator architecture. Existing frameworks suffer from the trade-off between design flexibility and productivity of RTL generation: either limited to very few hand-written templates or cannot automatically generate the RTL. To address this challenge, we propose the LEGO framework, which targets tensor applications and automatically generates spatial architecture design and outputs synthesizable RTL code without handwritten RTL design templates. Leveraging the affine-transformation-based architecture representation, LEGO front end finds interconnections between function units, synthesizes the memory system, and fuses different spatial dataflow designs based on data reuse analysis. LEGO back end then translates the hardware in a primitive-level graph to perform lower-level optimizations, and applies a set of linear-programming algorithms to optimally insert pipeline registers and reduce the overhead of unused logic when switching spatial dataflows. Our evaluation demonstrates that LEGO can achieve 3.2x speedup and 2.4x energy efficiency compared to previous work Gemmini, and can generate one architecture for diverse modern foundation models in generative AI applications.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lin2025lego,
  title  = {LEGO: Spatial Accelerator Generation and Optimization for Tensor Applications},
  author = {Yujun Lin and Zhekai Zhang and Song Han},
  year   = {2025},
  eprint = {2509.12053},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.12053v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.12053.svg)](https://codeofpaper.com/paper/2509.12053)

Discussion