TileMap: Mapping Multi-Head Attention on Spatial Accelerators with Tile-based Analysis

Multi-head attention demonstrates enormous potential but incurs high costs (e.g., memory access) when deploying transformer models on spatial accelerators. Operator fusion is prevalent in conventional deep learning mappers to reduce off-chip memory access. However, designing operator-fusion mapping for multi-head attention is challenging. There exist strict data dependency between operators and hardware resource constraints of accelerators. In this paper, we propose TileMap, an operator-fusion mapping framework for multi-head attention on spatial accelerators. Central to this framework is tile-based analysis that can automatically satisfy both data dependency and resource constraints. Based on this analysis, we construct a mapping design space, which significantly prunes invalid candidates. We then propose an RL-based searching algorithm to explore the mapping space. The RL agent regards the mapping space as action space and further optimizes it to preserve all constraints. Experiments show TileMap achieves <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$1.8\times$</tex> to <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$3.1\times$</tex> speedup on different spatial accelerators, relative to state-of-the-art mapping approaches.

Authors

Institutions

Publication Details

Published
2024-11-18
DOI
https://doi.org/10.1109/iccd63220.2024.00104
Primary Topic
Advanced Image and Video Retrieval Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

TileMap: Mapping Multi-Head Attention on Spatial Accelerators with Tile-based Analysis

Fuyu Wang, Shen Ming-hua
Advanced Image and Video Retrieval Techniques
article

TileMap: Mapping Multi-Head Attention on Spatial Accelerators with Tile-based Analysis

Fuyu Wang, Shen Ming-hua
article en

Abstract

Multi-head attention demonstrates enormous potential but incurs high costs (e.g., memory access) when deploying transformer models on spatial accelerators. Operator fusion is prevalent in conventional deep learning mappers to reduce off-chip memory access. However, designing operator-fusion mapping for multi-head attention is challenging. There exist strict data dependency between operators and hardware resource constraints of accelerators. In this paper, we propose TileMap, an operator-fusion mapping framework for multi-head attention on spatial accelerators. Central to this framework is tile-based analysis that can automatically satisfy both data dependency and resource constraints. Based on this analysis, we construct a mapping design space, which significantly prunes invalid candidates. We then propose an RL-based searching algorithm to explore the mapping space. The RL agent regards the mapping space as action space and further optimizes it to preserve all constraints. Experiments show TileMap achieves <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$1.8\times$</tex> to <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$3.1\times$</tex> speedup on different spatial accelerators, relative to state-of-the-art mapping approaches.

Sun Yat-sen University (CN)
National Natural Science Foundation of China, Natural Science Foundation of Guangdong Province
Climate action
Openalex Percentile: Top 75%
Advanced Image and Video Retrieval Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.