arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.10418cs.DCcs.LG
收藏

DynaPipe:通过动态流水线优化多任务训练

DynaPipe: Optimizing Multi-task Training through Dynamic Pipelines

The University of Hong Kong(香港大学);Amazon Web Services(亚马逊网络服务);Boson AI(博森人工智能)

Chenyu Jiang, Zhen Jia, Shuai Zheng, Yida Wang, Chuan Wu

AI总结:

DynaPipe提出动态微批处理和动态流水线调度,解决多任务训练中序列长度差异导致的低效问题,在FLANv2上实现最高4.39倍(T5)和3.25倍(GPT)的训练吞吐量提升。

摘要:

多任务模型训练已被用于使单个深度神经网络模型(通常是大语言模型)能够处理多个任务(例如,问答和文本摘要)。由于不同任务的上下文多样,多任务训练通常接收长度差异很大的输入序列。通常采用填充(到相同序列长度)或打包(将短样本打包成相同长度的长序列)来准备用于模型训练的输入样本,但这在空间或计算上并不高效。本文提出了一种动态微批处理方法,以解决序列长度变化问题并实现高效的多任务模型训练。我们提倡对大型模型进行流水线并行训练,使用可变长度的微批次,每个微批次可能包含不同数量的样本。我们使用基于动态规划的方法优化微批次的构建,并通过动态流水线和通信调度来处理微批次执行时间的变化,从而实现高效的流水线训练。在FLANv2数据集上的广泛评估表明,与基于打包的基线相比,训练T5时训练吞吐量最高提升4.39倍,训练GPT时提升3.25倍。DynaPipe的源代码可在https://github.com/awslabs/optimizing-multitask-training-through-dynamic-pipelines公开获取。

英文摘要:

Multi-task model training has been adopted to enable a single deep neural network model (often a large language model) to handle multiple tasks (e.g., question answering and text summarization). Multi-task training commonly receives input sequences of highly different lengths due to the diverse contexts of different tasks. Padding (to the same sequence length) or packing (short examples into long sequences of the same length) is usually adopted to prepare input samples for model training, which is nonetheless not space or computation efficient. This paper proposes a dynamic micro-batching approach to tackle sequence length variation and enable efficient multi-task model training. We advocate pipeline-parallel training of the large model with variable-length micro-batches, each of which potentially comprises a different number of samples. We optimize micro-batch construction using a dynamic programming-based approach, and handle micro-batch execution time variation through dynamic pipeline and communication scheduling, enabling highly efficient pipeline training. Extensive evaluation on the FLANv2 dataset demonstrates up to 4.39x higher training throughput when training T5, and 3.25x when training GPT, as compared with packing-based baselines. DynaPipe's source code is publicly available at https://github.com/awslabs/optimizing-multitask-training-through-dynamic-pipelines.

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

↑