小模型预训练在真实硬件上表现如何?实测给出高效部署方案。
Performance of Small Language Model Pretraining on FABRIC: An Empirical Study
- 测试多种并行策略在不同硬件配置下的预训练效果
- 跨地域分布式训练中,网络延迟10毫秒时性能下降显著
- 提出可选方案:根据硬件和网络条件选最优并行方式
大语言模型预训练需大量算力。当数据集受限时,小尺寸模型更适合在用户指定数据上预训练,遵循大模型缩放定律。利用预训练模型可生成向量嵌入并存入向量数据库,支持现代AI应用与语义搜索。本研究在面向学术用户的免费实验平台(使用消费级GPU)上,考察小规模语言模型的预训练性能。考虑数据并行、算子内并行及算子间/流水线并行及其组合,构建同质与异构GPU集群。重点分析网络延迟对预训练的影响,尤其在地理分布场景下。使用GPT-2 medium和large模型,基于Alpa与Ray开源框架进行训练。结果表明,在地理分布环境下,同时优化算子内与算子间/流水线并行的Alpa执行计划表现最佳,尤其当网络延迟为十几毫秒时。基于实验洞察,提出一套系统性方法,以实现更高训练效率、更短执行时间,并减少所需GPU数量。
原文摘要 · Abstract (English)
Large language models (LLMs) require enormous computing power to pretrain on massive datasets. When limited datasets are available, smaller-sized LLMs are better choice to pretrain (on user-specified datasets) by following the scaling laws of LLMs. Using pretrained models, vector embeddings can be generated for raw data and stored using vector databases to support modern AI applications and semantic search. In this work, we investigate the performance of pretraining techniques for smaller-sized LLMs on an experimental testbed (with commodity GPUs) available to academic users at no charge. We consider data parallelism, intra-operator parallelism, and inter-operator/pipeline parallelism, and their combinations for pretraining. We set up different GPU clusters with homogeneous and heterogeneous GPU hardware. Furthermore, we investigate the impact of network latency on pretraining performance especially when GPUs are geographically distributed. We used GPT-2 medium and large models and pretrained them using open-source packages, namely, Alpa and Ray. We observed that Alpa's execution plans that collectively optimized intra-operator and inter-operator/pipeline parallelism consistently performed the best when GPUs were geographically distributed. This was especially true when the network latencies were in 10's of milliseconds. Based on the insights gained from the experiments, we propose a systematic approach for selecting the appropriate pretraining technique to achieve high training performance/lower execution time as well as to reduce the number of GPUs used.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。