Fast Inference of Mixture-of-Experts Language Models with Offloading

2023年12月28日
随着大型语言模型(LLM)的广泛采用,许多深度学习从业者正在寻找更高效运行这些模型的策略。其中一种策略是使用稀疏混合专家(MoE) - 一种模型架构,其中仅对于任何给定的输入,模型层的一小部分是活动的。这种属性使得基于MoE的语言模型比其密集的对应物更快地生成标记,但由于具有多个专家,它也增加了模型大小。不幸的是,这使得最先进的MoE语言模型难以在没有高端GPU的情况下运行。在这项工作中,我们研究了在具有有限加速器内存的消费者硬件上运行大型MoE语言模型的问题。我们建立在参数卸载算法的基础上,并提出了一种新的策略,通过利用MoE LLM的固有属性加速卸载。使用这种策略,我们可以在桌面硬件和免费的Google Colab实例上以混合量化的方式运行Mixtral-8x7B。
With the widespread adoption of Large Language Models (LLMs), many deep learning practitioners are looking for strategies of running these models more efficiently. One such strategy is to use sparse Mixture-of-Experts (MoE) - a type of model architectures where only a fraction of model layers are active for any given input. This property allows MoE-based language models to generate tokens faster than their dense counterparts, but it also increases model size due to having multiple experts. Unfortunately, this makes state-of-the-art MoE language models difficult to run without high-end GPUs. In this work, we study the problem of running large MoE language models on consumer hardware with limited accelerator memory. We build upon parameter offloading algorithms and propose a novel strategy that accelerates offloading by taking advantage of innate properties of MoE LLMs. Using this strategy, we build can run Mixtral-8x7B with mixed quantization on desktop hardware and free-tier Google Colab instances.
许愿