Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward strict loading option from lightning module to deepspeed #152

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed fabric imports for HPU strategies ([#126](https://github.com/Lightning-AI/lightning-Habana/pull/126))
- Enabling tests and examples of fabric with HPU ([#139](https://github.com/Lightning-AI/lightning-Habana/pull/139))
- Fixes an API break due to non-strict loading in Trainer ([#150](https://github.com/Lightning-AI/lightning-Habana/pull/150))
- Forward strict loading option from lightning module to deepspeed ([#152](https://github.com/Lightning-AI/lightning-Habana/pull/152))

### Removed

Expand Down
5 changes: 4 additions & 1 deletion src/lightning_habana/pytorch/strategies/deepspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,10 @@ def load_checkpoint(self, checkpoint_path: _PATH) -> Dict[str, Any]:

is_fitting = self.lightning_module.trainer.state.fn == TrainerFn.FITTING
_, client_state = self.deepspeed_engine.load_checkpoint(
checkpoint_path, load_optimizer_states=is_fitting, load_lr_scheduler_states=False
checkpoint_path,
load_optimizer_states=is_fitting,
load_lr_scheduler_states=False,
load_module_strict=self.lightning_module.strict_loading,
)
if client_state is None:
raise MisconfigurationException(
Expand Down
Loading