arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.03594cs.CLcs.AI
收藏

通过高效预训练与部署实现高稀疏度基础 Llama 模型

Enabling High-Sparsity Foundational Llama Models with Efficient Pretraining and Deployment

Neural Magic;Cerebras Systems;IST Austria(奥地利科学技术研究所)

Abhinav Agarwalla, Abhay Gupta, Alexandre Marques, Shubhra Pandit, Michael Goin, Eldar Kurtic, Kevin Leong, Tuan Nguyen, Mahmoud Salem, Dan Alistarh, Sean Lie, Mark Kurtz

AI总结:

本文提出结合 SparseGPT 剪枝与稀疏预训练,在 LLaMA-2 7B 上实现高达 70% 稀疏度且微调精度完全恢复,并在 CPU 和 GPU 上分别获得最高 8.6 倍和 1.7 倍推理加速。

摘要:

大型语言模型(LLMs)已经彻底改变了自然语言处理(NLP),但其规模带来了计算瓶颈。我们提出了一种新方法,用于创建高性能 LLM 的准确稀疏基础版本,这些版本在微调任务中可在高达 70% 稀疏度下实现完全精度恢复。我们通过结合 SparseGPT 一次性剪枝方法,并在 SlimPajama 数据集的子集与 The Stack 数据集的 Python 子集混合数据上对这些模型进行稀疏预训练,在 LLaMA-2 7B 模型上实现了这一目标。我们展示了在 Cerebras CS-3 芯片上由于稀疏性带来的训练加速,该加速与理论扩展规律高度吻合。此外,我们利用 Neural Magic 的 DeepSparse 引擎在 CPU 上实现了高达 3 倍的推理加速,并通过 Neural Magic 的 nm-vllm 引擎在 GPU 上实现了 1.7 倍的推理加速。上述收益仅通过稀疏性实现,因此可以通过进一步使用量化获得额外收益。具体而言,我们展示了稀疏量化 LLaMA 模型在 CPU 上的总加速高达 8.6 倍。我们在多样且具有挑战性的任务上证明了这些结果,包括对话、指令遵循、代码生成、算术推理和摘要生成,以证明其通用性。这项工作为快速创建更小、更快的 LLM 而不牺牲精度铺平了道路。

英文摘要:

Large language models (LLMs) have revolutionized Natural Language Processing (NLP), but their size creates computational bottlenecks. We introduce a novel approach to create accurate, sparse foundational versions of performant LLMs that achieve full accuracy recovery for fine-tuning tasks at up to 70% sparsity. We achieve this for the LLaMA-2 7B model by combining the SparseGPT one-shot pruning method and sparse pretraining of those models on a subset of the SlimPajama dataset mixed with a Python subset of The Stack dataset. We exhibit training acceleration due to sparsity on Cerebras CS-3 chips that closely matches theoretical scaling. In addition, we establish inference acceleration of up to 3x on CPUs by utilizing Neural Magic's DeepSparse engine and 1.7x on GPUs through Neural Magic's nm-vllm engine. The above gains are realized via sparsity alone, thus enabling further gains through additional use of quantization. Specifically, we show a total speedup on CPUs for sparse-quantized LLaMA models of up to 8.6x. We demonstrate these results across diverse, challenging tasks, including chat, instruction following, code generation, arithmetic reasoning, and summarization to prove their generality. This work paves the way for rapidly creating smaller and faster LLMs without sacrificing accuracy.

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

↑