arXiv:2510.21048cs.PFcs.DC2025-10被引 2

用CPU分析精准预估训练时显存,避免崩溃又省资源

xMem: A CPU-Based Approach for Accurate Estimation of GPU Memory in Deep Learning Training Workloads

  • 纯CPU动态分析,不占显存也不改代码
  • 误差比现有方法低91%,失败率降75%
  • 适合集群调度、显存紧张场景使用

GPU资源紧缺迫使共享集群中需更精细的深度学习作业调度策略。准确预估任务所需显存是实现高级调度与显存共享的基础,可避免显存溢出(OOM)和资源浪费。然而,现有方法存在局限:依赖静态分析或历史数据的机器学习方法难以捕捉运行时动态;直接分析显卡会消耗稀缺资源,部分技术还需侵入式代码修改。核心挑战在于无需占用显卡资源且无需代码改动的前提下,精确估算动态内存需求,包括内存分配器细节。为此,我们提出xMem,一种基于纯CPU动态分析的框架,可事前准确估计峰值显存需求。我们在25种不同模型(含卷积神经网络和Transformer架构)的工作负载上对xMem进行了全面评估,涵盖5209次运行,结合方差分析与蒙特卡洛测试结果表明:相比现有最佳方案,xMem将中位相对误差降低91%,在安全OOM阈值下估计失败概率显著下降75%,意味着估算值可直接使用而不会引发OOM。最终,该改进使显存节约潜力较现有方案提升368%。

原文摘要 · Abstract (English)

The global scarcity of GPUs necessitates more sophisticated strategies for Deep Learning jobs in shared cluster environments. Accurate estimation of how much GPU memory a job will require is fundamental to enabling advanced scheduling and GPU sharing, which helps prevent out-of-memory (OOM) errors and resource underutilization. However, existing estimation methods have limitations. Approaches relying on static analysis or historical data with machine learning often fail to accurately capture runtime dynamics. Furthermore, direct GPU analysis consumes scarce resources, and some techniques require intrusive code modifications. Thus, the key challenge lies in precisely estimating dynamic memory requirements, including memory allocator nuances, without consuming GPU resources and non-intrusive code changes. To address this challenge, we propose xMem, a novel framework that leverages CPU-only dynamic analysis to accurately estimate peak GPU memory requirements a priori. We conducted a thorough evaluation of xMem against state-of-the-art solutions using workloads from 25 different models, including architectures like Convolutional Neural Networks and Transformers. The analysis of 5209 runs, which includes ANOVA and Monte Carlo results, highlights xMem's benefits: it decreases the median relative error by 91% and significantly reduces the probability of estimation failure as safe OOM thresholds by 75%, meaning that the estimated value can often be used directly without causing OOM. Ultimately, these improvements lead to a 368% increase in memory conservation potential over current solutions.

显存估计CPU分析深度学习调度OOM预防

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。