AttentionRC: A Novel Approach to Improve Locality Sensitive Hashing Attention on Dual-Addressing Memory
Attention is a crucial component of the Transformer architecture and a key factor in its success. However, it suffers from quadratic growth in time and space complexity as input sequence length increases. One popular approach to address this issue is the Reformer model, which uses locality-sensitive hashing (LSH) attention to reduce computational complexity. LSH attention hashes similar tokens in the input sequence to the same bucket and attends tokens only within the same bucket. Meanwhile, a new emerging nonvolatile memory (NVM) architecture, row column NVM (RC-NVM), has been proposed to support row- and column-oriented addressing (i.e., dual addressing). In this work, we present AttentionRC, which takes advantage of RC-NVM to further improve the efficiency of LSH attention. We first propose an LSH-friendly data mapping strategy that improves memory write and read cycles by 60.9% and 4.9%, respectively. Then, we propose a sort-free RC-aware bucket access and a swap strategy that utilizes dual-addressing to reduce 38% of the data access cycles in attention. Finally, by taking advantage of dual-addressing, we propose transpose-free attention to eliminate the transpose operations that were previously required by the attention, resulting in a 51% reduction in the matrix multiplication time.
Authors
- Cheng Wei (ORCID: https://orcid.org/0000-0003-1281-9243)
- Yuan-Hao Chang (ORCID: https://orcid.org/0000-0002-1282-2111)
- Yun-Chih Chen (ORCID: https://orcid.org/0000-0002-2665-9490)
- Ing-Chao Lin (ORCID: https://orcid.org/0000-0003-1994-7512)
- Chun-Lin Chu
Institutions
- Duke University (US)
- TU Dortmund University (DE)
- Institute of Information Science, Academia Sinica (TW)
- National Cheng Kung University (TW)
Publication Details
- Journal
- IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems
- Published
- 2024-11-01
- DOI
- https://doi.org/10.1109/tcad.2024.3447217
- Citations
- 1
- Primary Topic
- Advanced Image and Video Retrieval Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.25
Funders
- National Science and Technology Council