Distributed learning is commonly used for training deep learning models, especially large models. In distributed learning, manual parallelism (MP) methods demand considerable human effort and have limited flexibility. Hence, automatic parallelism (AP) methods have recently been proposed for automating the parallel strategy optimization process. Existing AP methods suffer from sub-optimal solutions because they do not jointly optimize the two categories of parallel strategies (i.e., inter-layer parallelism and intra-layer parallelism). In this paper, we propose a novel AP method called UniAP, which unifies inter- and intra-layer automatic parallelism by mixed integer quadratic programming. To the best of our knowledge, UniAP is the first parallel method that can jointly optimize the two categories of parallel strategies to find an optimal solution. Experimental results show that UniAP outperforms state-of-the-art methods by up to 3.80$\times$ in throughput and reduces strategy optimization time by up to 107$\times$ across five Transformer-based models.
翻译:分布式学习常用于训练深度学习模型,尤其是大规模模型。在分布式学习中,手动并行方法需要大量人力且灵活性有限。因此,近期提出了自动并行方法以自动化并行策略优化过程。现有自动并行方法因未能联合优化两类并行策略(即层间并行与层内并行)而导致次优解。本文提出一种称为UniAP的新型自动并行方法,其通过混合整数二次规划统一了层间与层内的自动并行。据我们所知,UniAP是首个能联合优化两类并行策略以寻求最优解的并行方法。实验结果表明,在五个基于Transformer的模型上,UniAP的吞吐量最高超越现有最优方法3.80倍,并将策略优化时间最高降低107倍。