arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2405.20935cs.LGcs.AI
收藏

稀疏性与量化之间的有效相互作用:从理论到实践

Effective Interplay between Sparsity and Quantization: From Theory to Practice

EPFL(洛桑联邦理工学院);MangoBoost Inc.(MangoBoost公司);Google(谷歌公司);Korea University(高丽大学);DeepMind(深度思维公司)

Simla Burcu Harma, Ayan Chakraborty, Elizaveta Kostenok, Danila Mishin, Dongho Ha, Babak Falsafi, Martin Jaggi, Ming Liu, Yunho Oh, Suvinay Subramanian, Amir Yazdanbakhsh

AI总结:

本文首次从数学上证明稀疏性与量化非正交,通过多模型实验揭示应用顺序对误差的影响,为资源受限平台上的模型压缩提供最佳实践。

摘要:

深度神经网络(DNN)规模日益增大,需要有效的模型压缩来减少其计算和内存占用。稀疏性和量化是两种突出的压缩方法,已被证明能在保持模型准确率的同时显著降低DNN的计算和内存占用。然而,这两种方法结合使用时如何相互作用仍是开发者的一个关键问题,因为许多人默认它们是正交的,即结合使用不会引入超出各自独立使用时产生的额外误差。本文首次提供了数学证明,表明稀疏性与量化是非正交的。我们通过涵盖一系列大型语言模型的实验验证了这些结果,包括OPT和LLaMA模型家族(参数规模从125M到8B),以及ViT和ResNet等视觉模型。我们表明,应用这些方法的顺序很重要,因为先应用量化再应用稀疏性可能会破坏张量元素的相对重要性,从而可能无意中移除张量中的重要元素。更重要的是,我们证明即使按正确顺序应用,稀疏性和量化产生的复合误差也可能显著损害准确率。我们的发现延伸到在资源受限的计算平台上高效部署大型模型以降低服务成本,为应用这些压缩方法以在不损害准确率的前提下最大化硬件资源效率提供了最佳实践的见解。

英文摘要:

The increasing size of deep neural networks (DNNs) necessitates effective model compression to reduce their computational and memory footprints. Sparsity and quantization are two prominent compression methods that have been shown to reduce DNNs' computational and memory footprints significantly while preserving model accuracy. However, how these two methods interact when combined together remains a key question for developers, as many tacitly assume that they are orthogonal, meaning that their combined use does not introduce additional errors beyond those introduced by each method independently. In this paper, we provide the first mathematical proof that sparsity and quantization are non-orthogonal. We corroborate these results with experiments spanning a range of large language models, including the OPT and LLaMA model families (with 125M to 8B parameters), and vision models like ViT and ResNet. We show that the order in which we apply these methods matters because applying quantization before sparsity may disrupt the relative importance of tensor elements, which may inadvertently remove significant elements from a tensor. More importantly, we show that even if applied in the correct order, the compounded errors from sparsity and quantization can significantly harm accuracy. Our findings extend to the efficient deployment of large models in resource-constrained compute platforms to reduce serving cost, offering insights into best practices for applying these compression methods to maximize hardware resource efficiency without compromising accuracy.

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

↑