qhliu26/Dive-into-Big-Model-Training

πŸ“‘ Dive into Big Model Training

116

10 commits

updated Dec 1, 2022

See the code

README

Dive into Big Model Training

πŸ“° Report Link [here]

πŸ“« Contact me qhliu26@gmail.com

Abstract: The increasing scale of model size and continuous improvement of performance herald the arrival of the Big Model era. In this report, we explore what and how the big model training works by diving into training objectives and training methodologies. Specifically,training objectives describe how to leverage web-scale data to develop extremely capable and incredibly large models based on self-supervised learning, and training methodologies which are based on distributed training describe how to make big model training a reality. We summarize the existing training methodologies into three main categories: training parallelism, memory-saving technologies, and model sparsity design. Training parallelism can be categorized into data, pipeline, and tensor parallelism according to the dimension of parallelism that takes place. Memory-saving technologies are orthogonal and complementary to training parallelism. And model sparsity design further scales up the model size with a constant computational cost.

Report Thumbnail

Useful Repositories

BM Background

YearTitleIntro
2017Deep Learning Scaling is Predictable, Empiricallyempirical characterization of generalization error and model size growth as training sets grow
2020Scaling Laws for Neural Language ModelsPerformance depends strongly on scale, weakly on model shape
2021On the Opportunities and Risks of Foundation ModelsA foundation model is any model that is trained on broad data at scale and can be adapted to a wide range of downstream tasks
2022The 2022 AI IndexLanguage models are more capable than ever, but also more biased

Glance at Big Model

YearNameParamFrom
2018GPT110MOpenAI
2018BERT349MGoogle
2019GPT-21.5BOpenAI
2019Megatron-LM8.3BNvidia
2020Turing-NLG17BMicrosoft
2020GPT-3175BOpenAI
2021Switch Transformer1.6TGoogle
2021BaGuaLu174TBAAI
2022PaLM540BGoogle

Training Parallelism

Data Parallelism

Tensor Parallelism

Pipeline Parallelism

Mixture-of-Expert

YearTitleIntro
2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layerensembling implemented with a gating mechanism connecting multiple experts
2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingreplaces transformer FFN with MoE layer
2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsityscales the model size up to trillions of parameters
2021Go Wider Instead of DeeperWideNet uses individual LN to transform semantic representations
2022Mixture-of-Experts with Expert Choice Routinglet experts select the top-k tokens

Memory Saving Design

Activation Checkpointing

YearTitleIntro
2016Training Deep Nets with Sublinear Memory Costtrade computation for memory and train a n layer network with $O(\sqrt{n})$ memory cost
2019Checkmate: Breaking the Memory Wall with Optimal Tensor Rematerializationformalize the problem of training time and memory requirements trading-off as the tensor rematerialization optimization problem

ZeRO

YearTitleIntro
2019ZeRO: Memory Optimizations Toward Training Trillion Parameter ModelsZero Redundancy Optimizer
2021ZeRO-Offload: Democratizing Billion-Scale Model Trainingoffloading data and compute to CPU
2021ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learningheterogeneous system technology leverages GPU, CPU, and NVMe memory to allow for unprecedented model scale
2022PatrickStar: Parallel Training of Pre-Trained Models Via Chunk-Based Dynamic Memory Managementheterogeneous system technology leverages GPU, CPU memory in a more efficient way

Mix Precision Training

YearTitleIntro
2017Mixed Precision TrainingSpeed up training and save memory
2017Flexpoint: An Adaptive Numerical Format for Efficient Training of Deep Neural Networksa replacement of 32-bit floating point format training and inference to support modern deep network topologies without modifications
2018Highly Scalable Deep Learning Training System with Mixed-Precision: Training ImageNet in Four Minutestraining AlexNet with 95 epochs within 4 minutes
2020Ultra-low precision 4-bit training of deep neural networksscale the precision of training systems to 4-bits
deep-learning
machine-learning
optimizer
parallelism
system

Contributors

qhliu26

8 commits

fangjiarui

1 commits

zh-zheng

1 commits

qhliu26/Dive-into-Big-Model-Training

πŸ“‘ Dive into Big Model Training

116

10 commits

updated Dec 1, 2022

See the code

README

Dive into Big Model Training

πŸ“° Report Link [here]

πŸ“« Contact me qhliu26@gmail.com

Abstract: The increasing scale of model size and continuous improvement of performance herald the arrival of the Big Model era. In this report, we explore what and how the big model training works by diving into training objectives and training methodologies. Specifically,training objectives describe how to leverage web-scale data to develop extremely capable and incredibly large models based on self-supervised learning, and training methodologies which are based on distributed training describe how to make big model training a reality. We summarize the existing training methodologies into three main categories: training parallelism, memory-saving technologies, and model sparsity design. Training parallelism can be categorized into data, pipeline, and tensor parallelism according to the dimension of parallelism that takes place. Memory-saving technologies are orthogonal and complementary to training parallelism. And model sparsity design further scales up the model size with a constant computational cost.

Report Thumbnail

Useful Repositories

BM Background

YearTitleIntro
2017Deep Learning Scaling is Predictable, Empiricallyempirical characterization of generalization error and model size growth as training sets grow
2020Scaling Laws for Neural Language ModelsPerformance depends strongly on scale, weakly on model shape
2021On the Opportunities and Risks of Foundation ModelsA foundation model is any model that is trained on broad data at scale and can be adapted to a wide range of downstream tasks
2022The 2022 AI IndexLanguage models are more capable than ever, but also more biased

Glance at Big Model

YearNameParamFrom
2018GPT110MOpenAI
2018BERT349MGoogle
2019GPT-21.5BOpenAI
2019Megatron-LM8.3BNvidia
2020Turing-NLG17BMicrosoft
2020GPT-3175BOpenAI
2021Switch Transformer1.6TGoogle
2021BaGuaLu174TBAAI
2022PaLM540BGoogle

Training Parallelism

Data Parallelism

Tensor Parallelism

Pipeline Parallelism

Mixture-of-Expert

YearTitleIntro
2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layerensembling implemented with a gating mechanism connecting multiple experts
2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingreplaces transformer FFN with MoE layer
2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsityscales the model size up to trillions of parameters
2021Go Wider Instead of DeeperWideNet uses individual LN to transform semantic representations
2022Mixture-of-Experts with Expert Choice Routinglet experts select the top-k tokens

Memory Saving Design

Activation Checkpointing

YearTitleIntro
2016Training Deep Nets with Sublinear Memory Costtrade computation for memory and train a n layer network with $O(\sqrt{n})$ memory cost
2019Checkmate: Breaking the Memory Wall with Optimal Tensor Rematerializationformalize the problem of training time and memory requirements trading-off as the tensor rematerialization optimization problem

ZeRO

YearTitleIntro
2019ZeRO: Memory Optimizations Toward Training Trillion Parameter ModelsZero Redundancy Optimizer
2021ZeRO-Offload: Democratizing Billion-Scale Model Trainingoffloading data and compute to CPU
2021ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learningheterogeneous system technology leverages GPU, CPU, and NVMe memory to allow for unprecedented model scale
2022PatrickStar: Parallel Training of Pre-Trained Models Via Chunk-Based Dynamic Memory Managementheterogeneous system technology leverages GPU, CPU memory in a more efficient way

Mix Precision Training

YearTitleIntro
2017Mixed Precision TrainingSpeed up training and save memory
2017Flexpoint: An Adaptive Numerical Format for Efficient Training of Deep Neural Networksa replacement of 32-bit floating point format training and inference to support modern deep network topologies without modifications
2018Highly Scalable Deep Learning Training System with Mixed-Precision: Training ImageNet in Four Minutestraining AlexNet with 95 epochs within 4 minutes
2020Ultra-low precision 4-bit training of deep neural networksscale the precision of training systems to 4-bits
deep-learning
machine-learning
optimizer
parallelism
system

Contributors

qhliu26

8 commits

fangjiarui

1 commits

zh-zheng

1 commits