arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.03687cs.PFcs.CLcs.LG
收藏

剖析大型语言模型训练、微调与推理的运行时性能

Dissecting the Runtime Performance of the Training, Fine-tuning, and Inference of Large Language Models

The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Beijing Damo Technology Co. Ltd.(北京达摩科技有限公司);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));The Hong Kong University of Science and Technology(香港科技大学)

Longteng Zhang, Xiang Liu, Zeyu Li, Xinglin Pan, Peijie Dong, Ruibo Fan, Rui Guo, Xin Wang, Qiong Luo, Shaohuai Shi, Xiaowen Chu

AI总结:

本文从端到端和模块级两个层面基准测试了7B至70B大语言模型在三种8-GPU平台上的训练、微调与推理性能,系统评估了ZeRO、量化、重计算和FlashAttention等优化技术的影响,为用户选型和后续优化提供依据。

摘要:

大型语言模型(LLMs)在学术界和工业界均取得了巨大进展,其流行催生了大量用于加速LLM预训练、微调和推理的开源框架与技术。训练和部署LLMs成本高昂,因为它需要可观的计算资源和内存,因此人们开发了许多高效方法来改进系统流水线以及算子。然而,运行时性能在不同硬件和软件栈之间可能存在显著差异,这使得选择最佳配置变得困难。在本工作中,我们旨在从宏观和微观两个视角对性能进行基准测试。首先,我们在三个8-GPU平台上,对三种不同规模(即70亿、130亿和700亿参数,分别记为7B、13B和70B)的LLM的预训练、微调和服务的端到端性能进行了基准测试,并分别测试了采用和不采用个别优化技术(包括ZeRO、量化、重计算、FlashAttention)的情况。然后,我们进一步深入,提供了对子模块的详细运行时分析,包括LLM中的计算和通信算子。对于最终用户而言,我们的基准测试和发现有助于在部署LLM时更好地理解不同的优化技术、训练和推理框架以及硬件平台,从而选择配置。对于研究人员而言,我们深入的模块级分析揭示了未来进一步优化LLM运行时性能的潜在机会。

英文摘要:

Large Language Models (LLMs) have seen great advance in both academia and industry, and their popularity results in numerous open-source frameworks and techniques in accelerating LLM pre-training, fine-tuning, and inference. Training and deploying LLMs are expensive as it requires considerable computing resources and memory, hence many efficient approaches have been developed for improving system pipelines as well as operators. However, the runtime performance can vary significantly across hardware and software stacks, which makes it difficult to choose the best configuration. In this work, we aim to benchmark the performance from both macro and micro perspectives. First, we benchmark the end-to-end performance of pre-training, fine-tuning, and serving LLMs in different sizes , i.e., 7, 13, and 70 billion parameters (7B, 13B, and 70B) on three 8-GPU platforms with and without individual optimization techniques, including ZeRO, quantization, recomputation, FlashAttention. Then, we dive deeper to provide a detailed runtime analysis of the sub-modules, including computing and communication operators in LLMs. For end users, our benchmark and findings help better understand different optimization techniques, training and inference frameworks, together with hardware platforms in choosing configurations for deploying LLMs. For researchers, our in-depth module-wise analyses discover potential opportunities for future work to further optimize the runtime performance of LLMs.

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

↑