Skip to content

Commit

Permalink
accelerate cpu offload (#3242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpatel2000 authored May 1, 2024
1 parent 5eddaf3 commit b2edfbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions composer/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ def get_model_state_dict(self) -> Dict[str, Any]:
submodules=None,
options=StateDictOptions(
full_state_dict=self.fsdp_state_dict_type == 'full',
cpu_offload=True,
cpu_offload=self.fsdp_enabled,
),
)
else:
Expand Down Expand Up @@ -930,7 +930,7 @@ def get_optim_state_dict(self) -> Dict[str, Any]:
submodules=None,
options=StateDictOptions(
full_state_dict=self.fsdp_state_dict_type == 'full',
cpu_offload=True,
cpu_offload=self.fsdp_enabled,
),
)
return {type(optimizer).__qualname__: optim_state_dict}
Expand Down Expand Up @@ -1242,7 +1242,7 @@ def load_model_state(
options=StateDictOptions(
full_state_dict=self.fsdp_state_dict_type == 'full',
strict=strict,
cpu_offload=True,
cpu_offload=self.fsdp_enabled,
),
)
else:
Expand Down Expand Up @@ -1335,7 +1335,7 @@ def load_optim_state(self, state_dict: Dict[str, Any], strict: bool = True):
options=StateDictOptions(
full_state_dict=self.fsdp_state_dict_type == 'full',
strict=strict,
cpu_offload=True,
cpu_offload=self.fsdp_enabled,
),
)
else:
Expand Down

0 comments on commit b2edfbe

Please sign in to comment.