arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.12152cs.AReess.SP
收藏

一种基于数字SRAM的计算在内存宏用于变换器注意力得分计算中的静态动态矩阵乘法

A Digital SRAM-Based Compute-In-Memory Macro for Weight-Stationary Dynamic Matrix Multiplication in Transformer Attention Score Computation

Chongqing University(重庆大学);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);Southwest University(西南大学);Institute of Semiconductors, Chinese Academy of Sciences(中国科学院半导体研究所)

Jianyi Yu, Tengxiao Wang, Yuxuan Wang, Xiang Fu, Fei Qiao, Ying Wang, Rui Yuan, Liyuan Liu, Cong Shi

AI总结:

本文提出一种基于数字SRAM的计算在内存宏,用于变换器注意力得分计算,通过重构动态矩阵乘法为静态矩阵乘法,实现高效能的边缘智能计算。

摘要:

计算在内存(CIM)技术广泛应用于节能的人工智能(AI)处理器中。它们缓解了计算单元与存储单元之间大量数据传输导致的功耗和延迟瓶颈。为了将这些好处扩展到变换器,本文提出了一种数字CIM宏来计算注意力得分。为了消除动态矩阵乘法(MM),我们通过结合QK权重矩阵将计算重构为静态MM,使得输入可以直接馈送到单个CIM宏以获得得分结果。然而,这引入了新的挑战,即2输入静态MM。计算进一步分解为四个组的位串逻辑和加法操作。这使得2输入可以直接通过与门激活字线,从而实现2输入静态MM,且具有最小的开销。引入了一种分层零值位跳过机制,以优先跳过2输入情况中的零值位。该机制有效利用了2输入的数据稀疏性,显著减少了冗余操作。在65nm工艺中实现的0.35mm²宏在1.24mW下达到42.27GOPS,产生34.1TOPS/W的能效和120.77GOPS/mm²的面积效率。与CPU和GPU相比,其效率分别提高了约25倍和13倍。与其他变换器-CIM相比,其在能效和面积效率方面分别实现了至少7倍和2倍的提升,凸显了其在边缘智能中的强大潜力。

英文摘要:

Compute-in-memory (CIM) techniques are widely employed in energy-efficient artificial intelligent (AI) processors. They alleviate power and latency bottlenecks caused by extensive data movements between compute and storage units. To extend these benefits to Transformer, this brief proposes a digital CIM macro to compute attention score. To eliminate dynamic matrix multiplication (MM), we reconstruct the computation as static MM using a combined QK-weight matrix, so that inputs can be directly fed to a single CIM macro to obtain the score results. However, this introduces a new challenge of 2-input static MM. The computation is further decomposed into four groups of bit-serial logical and addition operations. This allows 2-input to directly activate the word line via AND gate, thus realizing 2-input static MM with minimal overhead. A hierarchical zero-value bit skipping mechanism is introduced to prioritize skipping zero-value bits in the 2-input case. This mechanism effectively utilizes data sparsity of 2-input, significantly reducing redundant operations. Implemented in a 65-nm process, the 0.35 mm2 macro delivers 42.27 GOPS at 1.24 mW, yielding 34.1 TOPS/W energy and 120.77 GOPS/mm2 area efficiency. Compared to CPUs and GPUs, it achieves ~25x and ~13x higher efficiency, respectively. Against other Transformer-CIMs, it demonstrates at least 7x energy and 2x area efficiency gains, highlighting its strong potential for edge intelligence.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑