Search papers, labs, and topics across Lattice.
This paper introduces TRAPTI, a two-stage methodology combining cycle-level inference simulation and time-resolved memory occupancy analysis to optimize on-chip memory usage in embedded transformer inference. TRAPTI analyzes memory access statistics and occupancy traces to explore banked memory organizations and power-gating configurations. Applying TRAPTI to GPT-2 XL and DeepSeek-R1-Distill-Qwen-1.5B reveals that the latter exhibits a 2.72x reduction in peak on-chip memory utilization, enabling more aggressive power-gating.
GQA's theoretical memory footprint reduction translates to a 2.72x peak on-chip memory utilization decrease in practice, unlocking further power-gating opportunities for embedded transformer inference.
Transformer neural networks achieve state-of-the-art accuracy across language and vision tasks, but their deployment on embedded hardware is hindered by stringent area, latency, and energy constraints. During inference, performance and efficiency are increasingly dominated by the Key--Value (KV) cache, whose memory footprint grows with sequence length, straining on-chip memory utilization. Although existing mechanisms such as Grouped-Query Attention (GQA) reduce KV cache requirements compared to Multi-Head Attention (MHA), effectively exploiting this reduction requires understanding how on-chip memory demand evolves over time. This work presents TRAPTI, a two-stage methodology that combines cycle-level inference simulation with time-resolved analysis of on-chip memory occupancy to guide design decisions. In the first stage, the framework obtains memory occupancy traces and memory access statistics from simulation. In the second stage, the framework leverages the traces to explore banked memory organizations and power-gating configurations in an offline optimization flow. We apply this methodology to GPT-2 XL and DeepSeek-R1-Distill-Qwen-1.5B under the same accelerator configuration, enabling a direct comparison of MHA and GQA memory profiles. The analysis shows that DeepSeek-R1-Distill-Qwen-1.5B exhibits a 2.72x reduction in peak on-chip memory utilization in this setting compared to GPT-2 XL, unlocking further opportunities for power-gating optimization.