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

E-Sparse:通过基于熵的N:M稀疏性提升大语言模型推理

E-Sparse: Boosting the Large Language Model Inference through Entropy-based N:M Sparsity

MLPD, Tencent(腾讯MLPD部门)

Yun Li, Lin Niu, Xipeng Zhang, Kai Liu, Jianchen Zhu, Zhanhui Kang

AI总结:

提出E-Sparse剪枝方法,首次将信息熵引入N:M稀疏度量设计,通过全局和局部洗牌优化信息分布,在LLM推理中实现最高1.53倍加速和43.52%内存节省。

摘要:

传统剪枝方法因难以承受的训练过程和巨大的计算需求,在生成式AI的大语言模型(LLM)中应用困难。我们首次将隐藏状态特征的信息熵引入剪枝度量设计,即E-Sparse,以提高LLM上N:M稀疏性的准确率。E-Sparse利用信息丰富度来衡量通道重要性,并进一步采用多项新技术:(1)引入信息熵增强参数权重和输入特征范数的重要性作为新剪枝度量,在不修改剩余权重的情况下执行N:M稀疏;(2)设计全局朴素洗牌和局部块洗牌快速优化信息分布,充分应对N:M稀疏对LLM准确率的影响。E-Sparse在FasterTransformer上实现为Sparse-GEMM,运行于NVIDIA Ampere GPU。在LLaMA系列和OPT模型上的大量实验表明,E-Sparse能显著加速模型推理(最高1.53倍)并节省内存(最高43.52%),且准确率损失可接受。

英文摘要:

Traditional pruning methods are known to be challenging to work in Large Language Models (LLMs) for Generative AI because of their unaffordable training process and large computational demands. For the first time, we introduce the information entropy of hidden state features into a pruning metric design, namely E-Sparse, to improve the accuracy of N:M sparsity on LLM. E-Sparse employs the information richness to leverage the channel importance, and further incorporates several novel techniques to put it into effect: (1) it introduces information entropy to enhance the significance of parameter weights and input feature norms as a novel pruning metric, and performs N:M sparsity without modifying the remaining weights. (2) it designs global naive shuffle and local block shuffle to quickly optimize the information distribution and adequately cope with the impact of N:M sparsity on LLMs' accuracy. E-Sparse is implemented as a Sparse-GEMM on FasterTransformer and runs on NVIDIA Ampere GPUs. Extensive experiments on the LLaMA family and OPT models show that E-Sparse can significantly speed up the model inference over the dense model (up to 1.53X) and obtain significant memory saving (up to 43.52%), with acceptable accuracy loss.

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

↑