From 2efd2eb4a8bb3310ba76765098b9d99abd2cca0e Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:20:26 +0800 Subject: [PATCH] Update distributed_checkpoint_recipe.rst --- recipes_source/distributed_checkpoint_recipe.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes_source/distributed_checkpoint_recipe.rst b/recipes_source/distributed_checkpoint_recipe.rst index 118dc7e7794..6a70bb02b0b 100644 --- a/recipes_source/distributed_checkpoint_recipe.rst +++ b/recipes_source/distributed_checkpoint_recipe.rst @@ -193,6 +193,7 @@ The reason that we need the ``state_dict`` prior to loading is: model = ToyModel().to(rank) model = FSDP(model) + optimizer = torch.optim.Adam(model.parameters(), lr=0.1) # generates the state dict we will load into model_state_dict, optimizer_state_dict = get_state_dict(model, optimizer) state_dict = {