Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen-sun committed Sep 4, 2024
1 parent 14c304e commit ffd4789
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions torchacc/dist/fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def optim_state_dict(
raise NotImplementedError(
"we only support 'FULL_SATE_DICT' StateDictType now")
if not self.model.flatten_parameters:
raise NotImplementedError("we only support flatten_parameters=True now")
raise NotImplementedError(
"we only support flatten_parameters=True now")

shard_meta_data = self.model.get_shard_metadata()
sharded_optim_state = optim.state_dict()['state']
Expand Down Expand Up @@ -342,7 +343,8 @@ def load_optim_state_dict(
raise NotImplementedError(
"we only support 'FULL_SATE_DICT' StateDictType now")
if not self.model.flatten_parameters:
raise NotImplementedError("we only support flatten_parameters=True now")
raise NotImplementedError(
"we only support flatten_parameters=True now")
shard_meta_data = self.model.get_shard_metadata()
unflat_optim_state = optim_state_dict
flat_optim_state: Dict[str, Any] = {'state': {}, 'param_groups': {}}
Expand Down

0 comments on commit ffd4789

Please sign in to comment.