DynaPipe: Optimizing Multi-task Training through Dynamic Pipelines

Chenyu Jiang, Zhen Jia, Shuai Zheng, Yida Wang, Chuan Wu
11/17/2023
cs.DCcs.LG

Official code: awslabs/optimizing-multitask-training-through-dynamic-pipelines (19 stars, Apache-2.0, last commit 2023-12-08). 1 more implementation below.

Abstract

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.

View on arXivView PDF

Code Implementations(2)

Apache-2.0

Official repository for the paper DynaPipe: Optimizing Multi-task Training through Dynamic Pipelines

192C++, ShellNov 8, 20232 years agoApache-2.0

Artifact for DynaPipe: Optimizing Multi-task Training through Dynamic Pipelines

33C, C++Aug 15, 20229 months agoNOASSERTION

Cite this paper

@article{jiang2023dynapipe,
  title  = {DynaPipe: Optimizing Multi-task Training through Dynamic Pipelines},
  author = {Chenyu Jiang and Zhen Jia and Shuai Zheng and Yida Wang and Chuan Wu},
  year   = {2023},
  eprint = {2311.10418},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.10418v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.10418.svg)](https://codeofpaper.com/paper/2311.10418)

Discussion