arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.14352cs.LGcs.AIcs.CL
收藏

EdgeMoE:在移动设备上赋能稀疏大型语言模型

EdgeMoE: Empowering Sparse Large Language Models on Mobile Devices

Beijing University of Posts and Telecommunications(北京邮电大学);University of Electronic Science and Technology of China(电子科技大学);Zhongguangcun Laboratory(中关村实验室)

Rongjie Yi, Liwei Guo, Shiyun Wei, Ao Zhou, Shangguang Wang, Mengwei Xu

AI总结:

提出EdgeMoE,一种面向移动设备的MoE LLM推理引擎,通过存储层级划分、专家级位宽自适应和专家预加载技术,实现内存与计算的高效利用,显著加速推理并节省内存。

摘要:

GPTs和Mixtral-8x7B等大型语言模型(LLMs)因其在通用机器学习任务中的卓越能力而彻底改变了机器智能。将LLMs从数据中心迁移到边缘设备带来了更好的隐私和可用性等好处,但其庞大的参数规模和由此产生的难以承受的运行时成本构成了挑战。为此,我们提出了EdgeMoE,这是一个用于混合专家(MoE)LLMs的设备端推理引擎——MoE是一种流行的稀疏LLM形式,它以几乎恒定的计算复杂度扩展参数规模。EdgeMoE通过将模型划分到存储层级中来实现内存和计算的高效性:非专家权重保存在设备内存中;而专家权重保存在外部存储中,仅在激活时才被获取到内存。这一设计的动机是基于一个关键观察:由于稀疏激活,专家权重虽然庞大但很少被使用。为了进一步减少专家I/O交换开销,EdgeMoE结合了两种新技术:(1)专家级位宽自适应,在可容忍的精度损失下减小专家大小;(2)专家预加载,提前预测被激活的专家并通过计算-I/O流水线进行预加载。在流行的MoE LLMs和边缘设备上,EdgeMoE展示了显著的内存节省和相对于有竞争力的基线的加速。代码可在https://github.com/UbiquitousLearning/mllm获取。

英文摘要:

Large language models (LLMs) such as GPTs and Mixtral-8x7B have revolutionized machine intelligence due to their exceptional abilities in generic ML tasks. Transiting LLMs from datacenters to edge devices brings benefits like better privacy and availability, but is challenged by their massive parameter size and thus unbearable runtime costs. To this end, we present EdgeMoE, an on-device inference engine for mixture-of-expert (MoE) LLMs -- a popular form of sparse LLM that scales its parameter size with almost constant computing complexity. EdgeMoE achieves both memory- and compute-efficiency by partitioning the model into the storage hierarchy: non-expert weights are held in device memory; while expert weights are held on external storage and fetched to memory only when activated. This design is motivated by a key observation that expert weights are bulky but infrequently used due to sparse activation. To further reduce the expert I/O swapping overhead, EdgeMoE incorporates two novel techniques: (1) expert-wise bitwidth adaptation that reduces the expert sizes with tolerable accuracy loss; (2) expert preloading that predicts the activated experts ahead of time and preloads it with the compute-I/O pipeline. On popular MoE LLMs and edge devices, EdgeMoE showcase significant memory savings and speedup over competitive baselines. The code is available at https://github.com/UbiquitousLearning/mllm.

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

↑