针对手机端大模型推理,设计了软硬协同的低功耗加速芯片架构。
TriGen: NPU Architecture for End-to-End Acceleration of Large Language Models based on SW-HW Co-Design
- 通过微尺度量化实现低精度计算,兼顾速度与精度。
- 用查表法替代专用硬件,提升非线性运算效率并节省资源。
- 在内存受限下优化调度,实现2.73倍加速和52%内存减少。
近期研究聚焦于在资源受限设备上加速AI推理的NPU架构。然而,基于Transformer的大语言模型(LLMs)规模持续扩大,参数复用率远低于传统CNN,导致在设备端实现端到端推理极具挑战。为此,本文提出TriGen,一种基于软硬件协同设计的新型NPU架构,专为资源受限环境优化。首先,采用微尺度量化(MX)进行低精度计算,在保持精度的同时拓展优化空间,并解决由此带来的问题。其次,为同步优化非线性和线性运算,采用快速准确的查找表(LUT)替代专用硬件处理关键非线性操作,显著提升性能并降低硬件开销。最后,结合实际硬件约束,引入调度技术以最大化计算利用率,即使在有限片上内存条件下亦能高效运行。我们在多种LLM上评估TriGen,结果表明其相较基线NPU设计平均提速2.73倍,内存传输减少52%,且精度损失可忽略。
原文摘要 · Abstract (English)
Recent studies have extensively explored NPU architectures for accelerating AI inference in on-device environments, which are inherently resource-constrained. Meanwhile, transformer-based large language models (LLMs) have become dominant, with rapidly increasing model sizes but low degree of parameter reuse compared to conventional CNNs, making end-to-end execution on resource-limited devices extremely challenging. To address these challenges, we propose TriGen, a novel NPU architecture tailored for resource-constrained environments through software-hardware co-design. Firstly, TriGen adopts low-precision computation using microscaling (MX) to enable additional optimization opportunities while preserving accuracy, and resolves the issues that arise by employing such precision. Secondly, to jointly optimize both nonlinear and linear operations, TriGen eliminates the need for specialized hardware for essential nonlinear operations by using fast and accurate LUT, thereby maximizing performance gains and reducing hardware-cost in on-device environments, and finally, by taking practical hardware constraints into account, further employs scheduling techniques to maximize computational utilization even under limited on-chip memory capacity. We evaluate the performance of TriGen on various LLMs and show that TriGen achieves an average 2.73x performance speedup and 52% less memory transfer over the baseline NPU design with negligible accuracy loss.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。