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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Yun, Niu, Lin, Zhang, Xipeng, Liu, Kai, Zhu, Jianchen, Kang, Zhanhui
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910378290577408
author Li, Yun
Niu, Lin
Zhang, Xipeng
Liu, Kai
Zhu, Jianchen
Kang, Zhanhui
author_facet Li, Yun
Niu, Lin
Zhang, Xipeng
Liu, Kai
Zhu, Jianchen
Kang, Zhanhui
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2310_15929
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle E-Sparse: Boosting the Large Language Model Inference through Entropy-based N:M Sparsity
Li, Yun
Niu, Lin
Zhang, Xipeng
Liu, Kai
Zhu, Jianchen
Kang, Zhanhui
Machine Learning
Artificial Intelligence
Computation and Language
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.
title E-Sparse: Boosting the Large Language Model Inference through Entropy-based N:M Sparsity
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2310.15929