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

QuantMoE-Bench:混合专家模型的后训练量化研究

QuantMoE-Bench: Examining Post-Training Quantization for Mixture-of-Experts

UNC-Chapel Hill(北卡罗来纳大学教堂山分校);Purdue University(普渡大学);Arizona State University(亚利桑那州立大学);The Chinese University of Hong Kong(香港中文大学)

Pingzhi Li, Xiaolong Jin, Zhen Tan, Yu Cheng, Tianlong Chen

AI总结:

本文研究混合专家模型的后训练量化,提出结构感知的细粒度混合精度方法,通过数据驱动技术优化比特分配,在基准测试中平均性能达65.35%,优于基线GPTQ的64.30%。

摘要:

混合专家模型(Mixture-of-Experts, MoE)是扩展大型语言模型学习能力的一种有前景的方法。它通过稀疏激活在推理过程中增加参数数量的同时几乎保持FLOPs不变。然而,由于参数规模庞大,它仍然面临显著的内存开销,因此需要模型压缩技术。后训练量化为模型压缩提供了一种强大的方法。现有方法对整个MoE模型采用固定的量化精度。这种刚性设置可能导致次优性能,因为它没有考虑固有的稀疏结构。例如,MoE的稀疏路由机制导致不同的激活模式,其中共享专家被所有令牌访问,而令牌条件专家被选择性激活。这种激活差异表明不同的量化需求,持续激活的共享专家可能需要更高的精度以维持模型质量。在本文中,我们研究了MoE量化的细粒度精度设置。我们探索了MoE结构感知的量化启发式方法,范围从粗粒度(例如,MoE层)到细粒度(例如,线性层)。我们的研究揭示了关键原则,即不同的MoE结构需要不同数量的比特才能进行有效量化。这些结论得到了对两个代表性MoE模型和六项任务(包括常识推理和自然语言理解)的广泛基准测试的支持。我们进一步表明,以细粒度混合精度量化的MoE在平均性能上达到了最先进的65.35%,而基线(即GPTQ)为64.30%。此外,基于这些发现,我们引入了新颖的数据驱动技术来优化MoE量化中的比特分配,包括异常感知线性层评分器和MoE块重要性预测器。

英文摘要:

Mixture-of-Experts (MoE) is a promising way to scale up the learning capacity of large language models. It increases the number of parameters while keeping FLOPs nearly constant during inference through sparse activation. Yet, it still suffers from significant memory overheads due to the vast parameter size, necessitating model compression techniques. Post-training quantization offers a powerful approach for model compression. Existing methods adopt a fixed quantization precision for the entire MoE model. This rigid setup can lead to suboptimal performance, without considering the inherent sparse structure. For example, MoE's sparse routing mechanism leads to different activation patterns, where shared experts are accessed by all tokens while token-conditioned experts are selectively activated. This activation disparity suggests different quantization requirements, with consistently activated shared experts potentially needing higher precision to maintain model quality. In this paper, we study a fine-grained precision setup for MoE quantization. We explore MoE structure-aware quantization heuristics, ranging from coarse (e.g., MoE layers) to fine granularity (e.g., linear layers). Our investigations reveal critical principles, where different MoE structures require varying numbers of bits for effective quantization. Conclusions are supported by extensive benchmarking across two representative MoE models and six tasks including commonsense reasoning and natural language understanding. We further show that an MoE quantized in a fined-grained mixed precision achieved state-of-the-art 65.35% performance on average compared to the baseline 64.30% (i.e., GPTQ). Moreover, based on the findings, we introduce novel data-driven techniques for optimizing bit allocation in MoE quantization, including the outlier-aware linear layer scorer and MoE block importance predictor.

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

↑