From a3db0feca43320b3dbff2e644368bbbc6722e5b9 Mon Sep 17 00:00:00 2001 From: Howard Huang Date: Wed, 9 Jul 2025 08:26:05 -0700 Subject: [PATCH] Update ddp_minGPT to remove FSDP1 references --- intermediate_source/ddp_series_minGPT.rst | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/intermediate_source/ddp_series_minGPT.rst b/intermediate_source/ddp_series_minGPT.rst index 743568ae18b..27e63996f75 100644 --- a/intermediate_source/ddp_series_minGPT.rst +++ b/intermediate_source/ddp_series_minGPT.rst @@ -26,10 +26,11 @@ Authors: `Suraj Subramanian `__ .. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites :class-card: card-prerequisites - - Familiarity with `multi-GPU training <../beginner/ddp_series_multigpu.html>`__ and `torchrun <../beginner/ddp_series_fault_tolerance.html>`__ - - [Optional] Familiarity with `multinode training `__ - - 2 or more TCP-reachable GPU machines (this tutorial uses AWS p3.2xlarge instances) - PyTorch `installed `__ with CUDA on all machines + - Familiarity with `multi-GPU training <../beginner/ddp_series_multigpu.html>`__ and `torchrun <../beginner/ddp_series_fault_tolerance.html>`__ + - [Optional] Familiarity with `multinode training `__ + - 2 or more TCP-reachable GPU machines for multi-node training (this tutorial uses AWS p3.2xlarge instances) + Follow along with the video below or on `youtube `__. @@ -63,25 +64,23 @@ from any node that has access to the cloud bucket. Using Mixed Precision ~~~~~~~~~~~~~~~~~~~~~~~~ -To speed things up, you might be able to use `Mixed Precision `__ to train your models. -In Mixed Precision, some parts of the training process are carried out in reduced precision, while other steps -that are more sensitive to precision drops are maintained in FP32 precision. +To speed things up, you might be able to use `Mixed Precision `__ to train your models. +In Mixed Precision, some parts of the training process are carried out in reduced precision, while other steps +that are more sensitive to precision drops are maintained in FP32 precision. When is DDP not enough? ~~~~~~~~~~~~~~~~~~~~~~~~ A typical training run's memory footprint consists of model weights, activations, gradients, the input batch, and the optimizer state. -Since DDP replicates the model on each GPU, it only works when GPUs have sufficient capacity to accomodate the full footprint. +Since DDP replicates the model on each GPU, it only works when GPUs have sufficient capacity to accomodate the full footprint. When models grow larger, more aggressive techniques might be useful: -- `activation checkpointing `__: Instead of saving intermediate activations during the forward pass, the activations are recomputed during the backward pass. In this approach, we run more compute but save on memory footprint. -- `Fully-Sharded Data Parallel `__: Here the model is not replicated but "sharded" across all the GPUs, and computation is overlapped with communication in the forward and backward passes. Read our `blog `__ to learn how we trained a 1 Trillion parameter model with FSDP. - +- `Activation checkpointing `__: Instead of saving intermediate activations during the forward pass, the activations are recomputed during the backward pass. In this approach, we run more compute but save on memory footprint. +- `Fully-Sharded Data Parallel `__: Here the model is not replicated but "sharded" across all the GPUs, and computation is overlapped with communication in the forward and backward passes. Read our `blog `__ to learn how we trained a 1 Trillion parameter model with FSDP. Further Reading --------------- - `Multi-Node training with DDP `__ (previous tutorial in this series) - `Mixed Precision training `__ -- `Fully-Sharded Data Parallel `__ +- `Fully-Sharded Data Parallel tutorial `__ - `Training a 1T parameter model with FSDP `__ -- `FSDP Video Tutorial Series `__