arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2203.00448cs.LGcs.PF
收藏

深度神经网络的内存规划

Memory Planning for Deep Neural Networks

The University of Chicago(芝加哥大学)

Maksim Levental

摘要:

我们在大规模系统的背景下研究DNN在推理过程中的内存分配模式。我们观察到,这样的内存分配模式,在多线程的上下文中,受到高延迟,由于\texttt{mutex}争用系统内存分配器。由于这种\texttt{mutex}争用而引起的延迟在面向用户的服务中产生不期望的瓶颈。因此,我们提出了一个“记忆”为基础的技术,\texttt{MemoMalloc},优化整体延迟,只有适度增加峰值内存使用。具体来说,我们的技术包括一个运行时组件,它捕获所有的分配,并唯一地将它们与他们的高层次的源操作,和一个静态分析组件,它构建了一个有效的分配“计划”。我们在PyTorch深度学习框架中实现了\texttt{MemoMalloc},并在各种DNN架构上评估了内存消耗和执行性能。我们发现,\texttt{MemoMalloc}优于最先进的通用内存分配器,相对于DNN推理延迟,高达40%。

英文摘要:

We study memory allocation patterns in DNNs during inference, in the context of large-scale systems. We observe that such memory allocation patterns, in the context of multi-threading, are subject to high latencies, due to \texttt{mutex} contention in the system memory allocator. Latencies incurred due to such \texttt{mutex} contention produce undesirable bottlenecks in user-facing services. Thus, we propose a "memorization" based technique, \texttt{MemoMalloc}, for optimizing overall latency, with only moderate increases in peak memory usage. Specifically, our technique consists of a runtime component, which captures all allocations and uniquely associates them with their high-level source operation, and a static analysis component, which constructs an efficient allocation "plan". We present an implementation of \texttt{MemoMalloc} in the PyTorch deep learning framework and evaluate memory consumption and execution performance on a wide range of DNN architectures. We find that \texttt{MemoMalloc} outperforms state-of-the-art general purpose memory allocators, with respect to DNN inference latency, by as much as 40\%.

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

↑