arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.09280cs.DCcs.LGcs.NAmath.NA
收藏

TTrace: 轻量级的分布式训练错误检查与诊断

TTrace: Lightweight Error Checking and Diagnosis for Distributed Training

New York University(纽约大学);Amazon Web Services(亚马逊网络服务)

Haitian Jiang, Shaowei Zhu, Zhen Zhang, Zhenyu Song, Xinwei Fu, Zhen Jia, Yida Wang, Jinyang Li

AI总结:

TTrace通过系统性的差分测试方法,有效检测和定位分布式训练中的无声bug,提升调试效率。

摘要:

分布式训练对于训练大型神经网络模型,如大语言模型(LLMs)至关重要,这些模型需要在数千块GPU上进行训练。然而,分布式训练程序的复杂性使其特别容易出现无声bug,这些bug不会产生明显的错误信号,但会导致训练结果不正确。有效检测和定位分布式训练中的此类无声bug具有挑战性。基于监控训练损失或梯度范数曲线的传统调试方法是间接的、低效的,并且无法定位bug。为了解决这些挑战,我们设计并实现了TTrace,这是首个系统性的差分测试系统,用于检测和定位分布式训练中的无声bug。TTrace将分布式训练中的中间张量与受信任的参考实现中的张量对齐。为了正确比较相应张量中的浮点值,我们提出了一种新的数学分析,提供了设置容差的指南,使TTrace能够区分bug引起的错误与数值误差。实验结果表明,TTrace能够有效检测Megatron-LM框架中已知的11个bug和3个新的bug,同时仅需要少于10行代码更改。TTrace在各种训练配方中均有效,包括涉及BF16和FP8的低精度配方。值得注意的是,一个流行的开源训练框架已经在其开发流程中采用了TTrace提出的方法。

英文摘要:

Distributed training is essential for scaling the training of large neural network models, such as large language models (LLMs), across thousands of GPUs. However, the complexity of distributed training programs makes them particularly prone to silent bugs, which do not produce explicit error signals but lead to incorrect training outcomes. Effectively detecting and localizing such silent bugs in distributed training is challenging. Common debugging practices based on monitoring training loss or gradient norm curves are indirect, inefficient, and provide no way to localize bugs. To address those challenges, we design and implement TTrace, the first systematic differential testing system for detecting and localizing silent bugs in distributed training. TTrace aligns intermediate tensors from distributed training with those from a trusted reference implementation. To properly compare the floating-point values in the corresponding tensors, we propose a novel mathematical analysis that provides a guideline for setting tolerances, enabling TTrace to distinguish bug-induced errors from numerical errors. Experimental results demonstrate that TTrace effectively detects 11 existing bugs and 3 new bugs in the widely used Megatron-LM framework, while requiring fewer than 10 lines of code changes. TTrace is effective in various training recipes, including low-precision recipes involving BF16 and FP8. Notably, a popular open-source training framework has already adopted the method proposed by TTrace in its development workflow.

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

↑