Skip to main content
QUICK REVIEW

[论文解读] Mixture of Experts with Mixture of Precisions for Tuning Quality of Service

HamidReza Imani, Abdolah Amirany|arXiv (Cornell University)|Jul 19, 2024
Engineering Technology and Methodologies被引用 4
一句话总结

本文提出了一种用于混合专家(Mixture-of-Experts, MoE)模型的自适应推理框架,通过在CPU和GPU上动态混合使用16位与4位量化,实现吞吐量与模型质量的动态调优。通过仅对专家层进行部分量化,该方法在A100 GPU上实现了高达13.00 tokens/秒的吞吐量,且在最大量化条件下,WikiText2上的困惑度仅增加2.62–2.80,从而在资源受限的动态环境中实现了细粒度的性能权衡。

ABSTRACT

The increasing demand for deploying large Mixture-of-Experts (MoE) models in resource-constrained environments necessitates efficient approaches to address their high memory and computational requirements challenges. Moreover, given that tasks come in different user-defined constraints and the available resources change over time in multi-tenant environments, it is necessary to design an approach which provides a flexible configuration space. This paper presents an adaptive serving approach for the efficient deployment of MoE models, capitalizing on partial quantization of the experts. By dynamically determining the number of quantized experts and their distribution across CPU and GPU, our approach explores the Pareto frontier and offers a fine-grained range of configurations for tuning throughput and model quality. Our evaluation on an NVIDIA A100 GPU using a Mixtral 8x7B MoE model for three language modelling benchmarks demonstrates that the throughput of token generation can be adjusted from 0.63 to 13.00 token per second. This enhancement comes with a marginal perplexity increase of 3.81 to 4.00, 13.59 to 14.17, and 7.24 to 7.40 for WikiText2, PTB, and C4 datasets respectively under maximum quantization. These results highlight the practical applicability of our approach in dynamic and accuracy-sensitive applications where both memory usage and output quality are important.

研究动机与目标

  • 解决在资源受限、多租户环境中部署大型MoE模型时面临的高内存与计算开销问题。
  • 在用户资源约束和可用GPU内存波动的情况下,实现模型吞吐量与输出质量的动态配置。
  • 通过仅选择性地量化专家层,减少CPU与GPU之间的数据移动瓶颈。
  • 提供细粒度且灵活的配置空间,支持运行时根据系统状态变化进行自适应调整。

提出的方法

  • 该方法采用部分量化策略,仅将专家前馈层量化为4位或16位精度,而非专家层则保持16位精度。
  • 根据可用内存和性能目标,动态确定4位专家的数量及其在CPU与GPU之间的分布。
  • 采用混合执行模型,尽可能将专家加载到GPU,必要时则卸载至CPU,以最小化数据移动。
  • 通过探索配置的Pareto前沿,优化吞吐量与困惑度,平衡内存占用、计算开销与模型质量。
  • 系统利用PyTorch的张量操作,支持混合精度推理,且运行时开销极低。
  • 在推理时动态调整模型服务策略,支持运行时重新配置而无需重新训练。

实验结果

研究问题

  • RQ1在资源可用性与用户约束波动的动态单GPU环境中,如何高效地服务MoE模型?
  • RQ2部分专家量化(4位与16位)对模型困惑度与推理吞吐量有何影响?
  • RQ3混合精度、混合位置(CPU/GPU)的专家部署策略能否实现模型质量与吞吐量之间的细粒度权衡?
  • RQ4量化专家的配置空间如何影响MoE推理的内存占用与性能表现?

主要发现

  • 在NVIDIA A100 GPU上,不同内存约束条件下,令牌生成的吞吐量范围为0.63至13.00 tokens/秒。
  • 在最大量化条件下,困惑度仅略有增加:WikiText2上从2.62增至2.80,PTB上从6.48增至7.24,C4上从3.24增至3.53。
  • 模型大小从全16位时的94.21 GB降低至完全4位量化专家时的23.55 GB,WikiText2上的困惑度仅增加2.62。
  • 自适应方法在将模型大小减少75%(从94.21 GB降至23.55 GB)的同时,所有基准测试的困惑度增加均低于10%。
  • 当可用GPU内存与量化专家数量同时增加时,吞吐量呈现双曲增长,表明有效缓解了内存瓶颈。
  • 与同质量化基线相比,该方法在模型大小、吞吐量与输出质量之间提供了更优的权衡。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。