XEngine:异构环境下神经网络的最优张量再物质化
XEngine: Optimal Tensor Rematerialization for Neural Networks in Heterogeneous Environments
摘要:
内存效率对于在资源受限的设备上训练深度学习网络至关重要。在反向传播过程中,前向张量用于计算梯度。尽管可以选择将这些依赖关系保留在内存中,直到它们在反向传播中被重用,但一些前向张量可以被丢弃,并在以后从保存的张量(所谓的检查点)中重新计算。这特别允许资源受限的异构环境利用所有可用的计算设备。不幸的是,这些检查点的定义是一个重要的问题,并对程序员提出了挑战-不正确或过度的重新计算会抵消检查点的好处。在本文中,我们提出了XEngine,一种通过确定检查点和重新计算张量来将网络运营商调度到低内存环境中的异构设备的方法。我们的方法选择合适的资源,每个时间步和运营商,并优化神经网络考虑到每个设备的内存限制的端到端的时间。为此,我们制定了一个混合整数二次规划(MIQP),以调度异构系统上的深度学习网络的运营商。我们比较了我们的MIQP求解器XEngine与Checkmate,这是一种混合整数线性规划(MILP)方法,可以在单个设备上解决重新计算问题。我们的求解器找到的解决方案比最快的Checkmate调度快22.5%,其中网络仅在单个设备上计算。我们还发现有效的时间表网络利用中央处理器和图形处理器,如果内存限制不允许调度专门的图形处理器。
英文摘要:
Memory efficiency is crucial in training deep learning networks on resource-restricted devices. During backpropagation, forward tensors are used to calculate gradients. Despite the option of keeping those dependencies in memory until they are reused in backpropagation, some forward tensors can be discarded and recomputed later from saved tensors, so-called checkpoints. This allows, in particular, for resource-constrained heterogeneous environments to make use of all available compute devices. Unfortunately, the definition of these checkpoints is a non-trivial problem and poses a challenge to the programmer - improper or excessive recomputations negate the benefit of checkpointing. In this article, we present XEngine, an approach that schedules network operators to heterogeneous devices in low memory environments by determining checkpoints and recomputations of tensors. Our approach selects suitable resources per timestep and operator and optimizes the end-to-end time for neural networks taking the memory limitation of each device into account. For this, we formulate a mixed-integer quadratic program (MIQP) to schedule operators of deep learning networks on heterogeneous systems. We compare our MIQP solver XEngine against Checkmate, a mixed-integer linear programming (MILP) approach that solves recomputation on a single device. Our solver finds solutions that are up to 22.5 % faster than the fastest Checkmate schedule in which the network is computed exclusively on a single device. We also find valid schedules for networks making use of both central processing units and graphics processing units if memory limitations do not allow scheduling exclusively to the graphics processing unit.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。