InMemQK: A Product Quantization Based MatMul Module for Compute-in-Memory Attention Macro
Large Language Models (LLMs), based on transformer architecture, have demonstrated remarkable capabilities in natural language processing tasks, enabling machines to generate human-like text and engage in meaningful dialogues. However, the exponential increase in model parameters has led to limitations in inference speed and energy efficiency. Compute-in-memory (CIM) technology offers a promising solution to accelerate AI inference by performing analog computations directly within memory, potentially reducing latency and power consumption. At the same time, CIM has been successfully applied to accelerate Convolutional Neural Networks (CNNs); however, the matrix–matrix multiplication (MatMul) operations inherent in the scaled dot-product attention of the transformer present unique challenges for direct CIM implementation. In this work, we propose InMemQK, a compute-in-memory-based attention accelerator that focuses on optimizing MatMul operations through software and hardware co-design. At the software level, InMemQK employs product quantization (PQ) to eliminate data dependencies. At the hardware level, InMemQK integrates energy-efficient time-domain MAC macros for ADC-free computations. Experimental results show InMemQK achieves 13.2×–13.9× lower power consumption than existing CIM-based accelerators.
Authors
- Gang Chen (ORCID: https://orcid.org/0000-0002-6690-4024)
- Yihao Chen (ORCID: https://orcid.org/0000-0002-4400-1983)
- Huaxiang Lu (ORCID: https://orcid.org/0000-0002-5928-9705)
- Yue Hao (ORCID: https://orcid.org/0000-0002-4725-6084)
- Wan’ang Xiao (ORCID: https://orcid.org/0000-0001-7990-9855)
- Zhelong Jiang (ORCID: https://orcid.org/0000-0003-0013-0860)
- Jie Yu (ORCID: https://orcid.org/0000-0003-0077-9301)
- Yi Xiao
- Pengcheng Feng
Institutions
- Chinese Academy of Sciences (CN)
- Institute of Semiconductors (CN)
- University of Chinese Academy of Sciences (CN)
Publication Details
- Journal
- Applied Sciences
- Published
- 2024-12-01
- DOI
- https://doi.org/10.3390/app142311198
- Primary Topic
- Advanced Memory and Neural Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China