Towards Understanding Bugs in Distributed Training and Inference Frameworks for Large Language Models

Xiao Yu, Haoxuan Chen, Feifei Niu, Xing Hu, Jacky Wai Keung, Xin XiaarXiv 2025 · DOI

Abstract

Training and deploying Large Language Models (LLMs) requires sophisticated distributed frameworks to manage massive computational loads. This study presents the first large-scale empirical analysis of 308 bugs within three prominent frameworks: DeepSpeed, Megatron-LM, and Colossal-AI. By categorizing symptoms, root causes, and fixing strategies, the authors uncover a "distributed tax"—unique bug categories specific to multi-node environments. The results highlight a significant gap between bug symptoms and their underlying causes, as well as the high resource costs associated with reproduction. Despite these complexities, nearly half of the identified bugs require minimal code changes to fix, suggesting a high potential for automated repair solutions.

Introduction

The engineering behind LLMs involves more than just algorithmic design; it requires robust infrastructure to handle billions of parameters across distributed systems. Frameworks like DeepSpeed and Colossal-AI implement complex 3D parallelism and memory optimizations to make this possible. However, the complexity of these systems introduces significant risks, ranging from "zombie processes" and silent accuracy degradation to massive wastes of GPU resources. This paper provides a systematic study of the bugs that plague these critical systems.

Methodology

The researchers employed a multi-stage empirical approach to analyze the bug landscape of LLM frameworks.

Overview of the research methodology, from data collection to analysis of research questions.
  1. Framework Selection: Three major repositories were selected: DeepSpeed (Microsoft), Megatron-LM (NVIDIA), and Colossal-AI (HPC-AI Tech).
  2. Data Collection: A dataset of 308 resolved bugs was curated by mining GitHub issues linked to merged Pull Requests (PRs).
  3. Manual Labeling: Researchers used an "open-coding" approach to label symptoms, root causes, and fixing strategies, ensuring high reliability through Cohen’s Kappa.
  4. Analysis: The study categorized bugs into taxonomies to identify correlations between observed symptoms and actual root causes.

Key Insights: The "Distributed Tax" and Resource Barriers

The study identifies several challenges unique to distributed LLM environments:

  • Distributed-Specific Root Causes: Four categories were found to be unique to these systems: Allocation Strategy Errors (e.g., creating tensors on the CPU by mistake), Distributed Communication Errors, Distributed Tensor Errors (memory layout mismatches), and Concurrency Errors.
  • The Resource Wall: Reproducing bugs often requires high-end hardware (e.g., 8+ A100 GPUs). This creates a barrier for developers with limited resources, often leaving "hangs" or complex synchronization issues unresolved.
  • Symptom-Cause Disconnect: Observable symptoms are frequently misleading. A log warning about a loss scaler might stem from a deep-seated data type mismatch during cross-node communication rather than an issue with the warning module itself.

Analysis of Symptoms and Root Causes

The distribution of bugs varies significantly between the training and inference phases.

Comparison of bug symptoms and root causes across training and inference phases.

Bugs are more prevalent during the training phase due to the added complexity of gradient synchronization and optimizer state management. The most common symptoms include training crashes and incorrect functionality. Dominant root causes across the dataset include API misuse (17%), incorrect implementation (15%), and configuration errors (13%).

Fixing Strategies and Automation Potential

An encouraging finding is that 48% of bug fixes involved 10 lines of code or fewer. These "small fixes" often follow predictable patterns, such as adding version checks or simple conditional guards. This suggests that LLM-based automated repair tools could be highly effective in maintaining these frameworks. However, 20% of patches required more than 50 lines of code, indicating that a significant portion of bugs still requires deep architectural understanding.

Conclusion and Future Directions

While this study provides a comprehensive look at open-source LLM frameworks, it is limited by its focus on public repositories, potentially excluding proprietary patterns used by organizations like OpenAI.

Future research should explore:

  • LLM-based Debugging: Utilizing Retrieval-Augmented Generation (RAG) and advanced reasoning models to help developers navigate cross-component interactions.
  • Automated Testing: Creating "mock modes" to simulate multi-node environments on single machines, lowering the reproduction barrier.
  • Evolutionary Analysis: Monitoring how bug patterns shift as frameworks and LLM architectures continue to mature.

Summary updated

BibTeX
@misc{yu2025towards,
  author = {Xiao Yu and Haoxuan Chen and Feifei Niu and Xing Hu and Jacky Wai Keung and Xin Xia},
  title = {{Towards Understanding Bugs in Distributed Training and Inference Frameworks for Large Language Models}},
  year = {2025},
  eprint = {2506.10426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.10426},
}
Figure