对比FP8与BF16训练大模型的效率与稳定性,发现前者更快但更难稳定。
Balancing Speed and Stability: The Trade-offs of FP8 vs. BF16 Training in LLMs
- 用FP8替代BF16降低精度以提升训练速度
- FP8训练速度比BF16快30%以上,但易出现损失爆炸
- 适合追求训练效率且能调参的工程团队使用
大规模语言模型(LLMs)因其类人语言理解与生成能力备受关注,其模型规模与训练数据量持续增长。例如Llama 3系列旗舰模型拥有4050亿参数,基于15.6万亿个标记进行训练。训练此类模型带来的巨大计算需求推动了对训练效率的优化研究,尤其是采用低精度格式。NVIDIA H100 GPU引入了FP8支持,相比传统的FP16和BF16,初步研究表明FP8可在不牺牲性能的前提下显著缩短训练时间。然而,FP8在训练稳定性与下游任务表现方面的整体影响尚未明确。本研究深入探讨了在训练LLM时采用FP8而非BF16所面临的实际权衡。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have attracted significant attention due to their human-like language understanding and generation capabilities, as well as their applicability across various domains. These models, characterized by their massive scale and extensive training data, continue to push the boundaries of what is possible in natural language processing. The Llama 3 series, for instance, exemplifies this trend with its flagship model boasting 405 billion parameters trained on 15.6 trillion tokens. The immense computational demands associated with training such models have spurred ongoing research into optimizing the efficiency of the training process, particularly through the use of lower-precision formats. NVIDIA's H100 GPU, which introduces support for FP8 in addition to the more conventional FP16 and BF16 formats, has emerged as a focal point in this optimization effort. Preliminary studies suggest that FP8 could offer substantial reductions in training time without sacrificing model performance when compared to BF16, making it a promising candidate for large-scale model training. However, the broader implications of adopting FP8, particularly in terms of training stability and downstream task performance, have yet to be fully understood. In this study, we delve into the practical trade-offs involved in adopting FP8 over BF16 for training LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。