Union: A Unified HW-SW Co-Design Ecosystem in MLIR for Evaluating Tensor Operations on Spatial Accelerators

Geonhwa Jeong, Gokcen Kestor, Prasanth Chatarasi, Angshuman Parashar, Po-An Tsai, Sivasankaran Rajamanickam, Roberto Gioiosa, Tushar Krishna

Introduction

The rapid evolution of artificial intelligence and high-performance computing (HPC) has spurred the development of specialized spatial accelerators. These chips, featuring hundreds or thousands of simple Processing Elements (PEs), are designed to handle the massive data parallelism inherent in tensor operations. However, the hardware-software co-design process remains highly fragmented. Currently, evaluating a new machine learning algorithm on a specific accelerator often requires manual translation into proprietary formats, and tools for mapping strategies—how data moves through hardware—are frequently incompatible with different performance simulators (cost models).

In the paper "Union: A Unified HW-SW Co-Design Ecosystem in MLIR," researchers from Georgia Tech, PNNL, NVIDIA, IBM, and Sandia National Laboratories present a framework to bridge these gaps. Union provides a "lingua franca" for evaluating tensor operations, decoupling algorithms, mapping strategies, and hardware cost models to enable seamless component mix-and-matching.

The Challenge of Fragmentation

Spatial accelerators are the backbone of modern AI, yet their evaluation is hindered by "tightly coupled" tools. For instance, a mapper designed for the Timeloop cost model cannot easily interface with the MAESTRO cost model. Furthermore, workloads from different domains, such as ML and Quantum Chemistry, utilize distinct languages and abstractions. This fragmentation makes it difficult for architects to determine if a hardware modification will yield performance gains across a diverse set of real-world workloads, such as ResNet-50 or complex Tensor Contractions (TC).

The Union Framework

The core of Union is built upon the Multi-Level Intermediate Representation (MLIR) compiler infrastructure. It introduces three unified abstractions that allow for a modular "plug-and-play" approach to hardware-software evaluation:

  1. Unified Workload Abstraction: Union ingests high-level code from various frontends (e.g., TensorFlow, PyTorch, or the COMET DSL for HPC) and lowers it into a standardized "problem instance." This instance describes the tensor operation's shape and data dependencies in a format independent of the source language.
Loop nests for CONV2D and TC operations illustrating the unified workload abstraction.
  1. Unified Architecture Abstraction: Rather than using rigid hardware descriptions, Union employs a "logical cluster-target" approach. Hardware is viewed as a hierarchy of clusters (e.g., a group of PEs sharing a local buffer). This model supports "virtual" clusters to describe complex data movements even in the absence of physical memory at a specific level.
A typical spatial accelerator architecture represented in Union's hierarchical model.
  1. Unified Mapping Abstraction: Union provides a formal method to describe how loops are distributed across physical space (spatial mapping) and time (temporal scheduling), eliminating the ambiguity found in previous modeling tools.

Experimental Evaluation

The authors evaluated Union using a broad spectrum of industry-standard workloads:

  • ML Workloads: Layers from ResNet50 (Computer Vision), DLRM (Recommendation systems), and BERT (Natural Language Processing) from the MLPerf benchmark.
  • HPC Workloads: Tensor Contraction (TC) kernels from the TCCG benchmark, critical for molecular dynamics and quantum chemistry.
  • Hardware Configurations: Simulations were conducted for "Edge" (256 PEs) and "Cloud" (2048 PEs) accelerator classes.

Key Insights and Results

Union’s modularity enabled several critical insights into hardware-software efficiency:

  • Algorithm Efficiency: The researchers demonstrated that running complex tensor operations "natively" is not always optimal. By exploring the Transpose-GEMM-Transpose (TTGT) algorithm, they found that transforming operations into standard Matrix Multiplications (GEMM) could yield a lower Energy-Delay-Product (EDP) by utilizing PEs more effectively.
  • Aspect Ratio Optimization: While balanced PE arrays (e.g., 16x16) are versatile, specific unbalanced workloads like DLRM benefit significantly from logical hardware reconfiguration to different aspect ratios (e.g., 1x256).
  • Bandwidth Saturation: In chiplet-based designs, the study found that EDP improves rapidly with increased fill bandwidth but reaches diminishing returns around 6-12 GB/s for most models, helping architects avoid over-engineering interconnects.

Conclusion and Future Work

Union represents a significant step toward a unified ecosystem for spatial accelerator research. By providing a modular framework, it allows researchers to explore a vast design space that was previously inaccessible due to tool fragmentation. Future work aims to expand the framework's scope to include fused operations (e.g., convolution with activation), sparsity-aware cost models, and backends for generating physical hardware bitstreams.

Summary updated

BibTeX
@inproceedings{jeong2021union,
  author = {Geonhwa Jeong and Gokcen Kestor and Prasanth Chatarasi and Angshuman Parashar and Po-An Tsai and Sivasankaran Rajamanickam and Roberto Gioiosa and Tushar Krishna},
  title = {{Union: A Unified HW-SW Co-Design Ecosystem in MLIR for Evaluating Tensor Operations on Spatial Accelerators}},
  booktitle = {PACT},
  year = {2021},
  url = {https://openreview.net/forum?id=4q0ypG9oQbh},
}
Figure