From 267dab9e632a5c0951b2c3a492d2d90cab6e69a6 Mon Sep 17 00:00:00 2001 From: Paul Angerer Date: Mon, 15 Jul 2024 14:36:04 +0200 Subject: [PATCH 1/2] Fix reference to DCP --- recipes_source/distributed_checkpoint_recipe.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes_source/distributed_checkpoint_recipe.rst b/recipes_source/distributed_checkpoint_recipe.rst index 6a70bb02b0b..6acfea72216 100644 --- a/recipes_source/distributed_checkpoint_recipe.rst +++ b/recipes_source/distributed_checkpoint_recipe.rst @@ -263,7 +263,7 @@ the intent is to save or load in "non-distributed" style, meaning entirely in th } # since no progress group is initialized, DCP will disable any collectives. - dcp.load( + DCP.load( state_dict=state_dict, checkpoint_id=CHECKPOINT_DIR, ) From ab10ae5170a8f44af604c8af396ad9c5ce0e91e4 Mon Sep 17 00:00:00 2001 From: Paul Angerer Date: Tue, 16 Jul 2024 11:09:23 +0200 Subject: [PATCH 2/2] Keep import style as saving --- recipes_source/distributed_checkpoint_recipe.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes_source/distributed_checkpoint_recipe.rst b/recipes_source/distributed_checkpoint_recipe.rst index 6acfea72216..bd916136d7a 100644 --- a/recipes_source/distributed_checkpoint_recipe.rst +++ b/recipes_source/distributed_checkpoint_recipe.rst @@ -237,7 +237,7 @@ the intent is to save or load in "non-distributed" style, meaning entirely in th import os import torch - import torch.distributed.checkpoint as DCP + import torch.distributed.checkpoint as dcp import torch.nn as nn @@ -263,7 +263,7 @@ the intent is to save or load in "non-distributed" style, meaning entirely in th } # since no progress group is initialized, DCP will disable any collectives. - DCP.load( + dcp.load( state_dict=state_dict, checkpoint_id=CHECKPOINT_DIR, )