Deploying large language models (LLMs) on edge devices enables personalized agents with strong privacy and low cost. However, with tens to hundreds of billions of parameters, single-batch autoregressive inference suffers from extremely low arithmetic intensity, creating severe weight-loading and bandwidth pressures on resource-constrained platforms. Recent in-flash computing (IFC) solutions alleviate this bottleneck by co-locating weight-related linear computations in the decode phase with flash, yet still rely on DRAM for the key-value (KV) cache. As context length grows, the KV cache can exceed model weights in size, imposing prohibitive DRAM cost and capacity requirements. Attempts to offload KV cache to flash suffer from severe performance penalties. We propose KVNAND, the first DRAM-free, IFC-based architecture that stores both model weights and KV cache entirely in compute-enabled 3D NAND flash. KVNAND addresses the fundamental performance challenges of flash under intensive KV cache access by leveraging IFC for all memory-bound operations to reduce data transfer overhead, introducing head-group parallelism to boost throughput, and employing page-level KV cache mapping to align token access patterns with flash organization. In addition, we propose a design space exploration framework that evaluates discrete and compact KVNAND variants to balance weight and KV placement, automatically identifying the optimal design trade-off. These techniques mitigate latency, energy, and reliability concerns, turning flash into a practical medium for long-context KV storage. Evaluations on MHA 7B and GQA 70B LLMs show that KVNAND achieves 1.98\(\times\)/1.94\(\times\)/2.05\(\times\) geomean speedup at 128/1K/10K-token contexts compared to DRAM-equipped IFC designs and addresses out-of-memory failures at 100K context length.


翻译:在边缘设备上部署大语言模型(LLM)能够实现具有强隐私性和低成本的个性化智能体。然而,对于参数量达数百亿至数千亿的模型,单批次自回归推理的算术强度极低,对资源受限平台造成了严重的权重加载与带宽压力。近期的闪存内计算(IFC)方案通过在解码阶段将权重相关的线性计算与闪存协同定位来缓解这一瓶颈,但仍需依赖动态随机存取存储器(DRAM)存储键值(KV)缓存。随着上下文长度增长,KV缓存的规模可能超过模型权重,导致DRAM的成本和容量需求急剧增加。将KV缓存卸载至闪存的尝试会带来严重的性能损失。本文提出KVNAND,首个完全基于闪存内计算的无DRAM架构,将模型权重与KV缓存全部存储于支持计算的3D NAND闪存中。KVNAND通过以下方式解决KV缓存密集访问下闪存的根本性能挑战:利用IFC执行所有内存受限操作以降低数据传输开销;引入头组并行机制提升吞吐量;采用页级KV缓存映射策略,使令牌访问模式与闪存组织结构对齐。此外,我们提出一种设计空间探索框架,评估离散与紧凑型KVNAND变体以权衡权重与KV数据的布局,自动识别最优设计折衷方案。这些技术有效缓解了延迟、能耗与可靠性问题,使闪存成为长上下文KV存储的实用介质。在MHA 7B和GQA 70B大语言模型上的评估表明,在128/1K/10K令牌上下文长度下,KVNAND相比配备DRAM的IFC设计分别实现1.98倍/1.94倍/2.05倍的几何平均加速比,并在100K上下文长度下解决了内存溢出故障。

0
下载
关闭预览

相关内容

【KDD2024】HiGPT:异构图语言模型
专知会员服务
19+阅读 · 2024年7月9日
【NeurIPS2019】图变换网络:Graph Transformer Network
LibRec 每周算法:LDA主题模型
LibRec智能推荐
29+阅读 · 2017年12月4日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员