Fast and Fusiest: An Optimal Fusion-Aware Mapper for Accelerator Modeling and Evaluation
Tanner Andrulis, Michael Gilbert, Vivienne Sze, Joel S. Emer
TL;DR
The paper tackles the problem of optimally mapping fused tensor-algebra workloads onto accelerators, where fusion reduces off-chip accesses but expands the search space exponentially with the number of Einsums. It introduces the Fast and Fusiest Mapper (FFM), which builds full fused mappings one Einsum at a time by pruning suboptimal partial mappings using compatibility and reservation criteria, guaranteeing optimality. Key innovations include a pmapping taxonomy (objective, compatibility, reservation), grouping for efficient skipping of incompatible joins, and reservation-based pruning that preserves optimality while scaling near-linearly with Einsums; empirically, FFM achieves over 1000× speedups over prior baselines and substantially improves Transformer-related mappings. The approach enables rapid, accurate accelerator modeling and evaluation, with practical impact for designing and evaluating fused-tensor accelerators in real workloads like GPT-3-scale transformers.
Abstract
The latency and energy of tensor algebra accelerators depend on how data movement and operations are scheduled (i.e., mapped) onto accelerators, so determining the potential of an accelerator architecture requires both a performance model and a mapper to search for the optimal mapping. A key optimization that the mapper must explore is fusion, meaning holding data on-chip between computation steps, which has been shown to reduce energy and latency by reducing DRAM accesses. However, prior mappers cannot find optimal mappings with fusion (i.e., fused mappings) in a feasible runtime because the number of fused mappings to search increases exponentially with the number of workload computation steps. In this paper, we introduce the Fast and Fusiest Mapper (FFM), the first mapper to quickly find optimal mappings in a comprehensive fused mapspace for tensor algebra workloads. FFM shrinks the search space by pruning subsets of mappings (i.e., partial mappings) that are shown to never be a part of optimal mappings, quickly eliminating all suboptimal mappings with those partial mappings as subsets. Then FFM joins partial mappings to construct optimal fused mappings. We evaluate FFM and show that, although the mapspace size grows exponentially with the number of computation steps, FFM's runtime scales approximately linearly. FFM is orders of magnitude faster ($>1000\times$) than prior state-of-the-art approaches at finding optimal mappings for Transformers.
