通过 DRAM 与 Flash 之间的主动权重交换扩展端侧大语言模型
Scaling Up On-Device LLMs via Active-Weight Swapping Between DRAM and Flash
AI总结:
本文提出 ActiveFlow 框架,通过主动权重 DRAM-Flash 交换、跨层预加载和稀疏感知自蒸馏,实现现代 LLM 在移动设备上的自适应内存使用与模型规模扩展,达到性能-成本帕累托最优。
摘要:
大语言模型(LLMs)正越来越多地部署在移动设备上,但有限的 DRAM 容量限制了可部署模型的规模。本文提出 ActiveFlow,这是首个能够为现代 LLM(非基于 ReLU)实现自适应 DRAM 使用的 LLM 推理框架,从而支持扩大可部署模型的规模。该框架基于主动权重 DRAM-Flash 交换这一新概念,并包含三项新技术:(1)跨层主动权重预加载。它利用当前层的激活值来预测后续若干层的主动权重,使计算与数据加载能够重叠,同时便于进行大容量 I/O 传输。(2)稀疏感知自蒸馏。它调整主动权重以对齐稠密模型的输出分布,补偿由上下文稀疏性引入的近似误差。(3)主动权重 DRAM-Flash 交换流水线。它根据可用内存在热权重缓存、预加载的主动权重和参与计算的权重之间协调 DRAM 空间分配。结果表明,与现有效率优化方法相比,ActiveFlow 达到了性能-成本的帕累托前沿。
英文摘要:
Large language models (LLMs) are increasingly being deployed on mobile devices, but the limited DRAM capacity constrains the deployable model size. This paper introduces ActiveFlow, the first LLM inference framework that can achieve adaptive DRAM usage for modern LLMs (not ReLU-based), enabling the scaling up of deployable model sizes. The framework is based on the novel concept of active weight DRAM-flash swapping and incorporates three novel techniques: (1) Cross-layer active weights preloading. It uses the activations from the current layer to predict the active weights of several subsequent layers, enabling computation and data loading to overlap, as well as facilitating large I/O transfers. (2) Sparsity-aware self-distillation. It adjusts the active weights to align with the dense-model output distribution, compensating for approximations introduced by contextual sparsity. (3) Active weight DRAM-flash swapping pipeline. It orchestrates the DRAM space allocation among the hot weight cache, preloaded active weights, and computation-involved weights based on available memory. Results show ActiveFlow achieves the performance-cost Pareto frontier compared to existing efficiency optimization methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。