Skip to content

Commit

Permalink
regression: deepspeed check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Oct 11, 2024
1 parent d785fb5 commit 66d288f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions helpers/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,11 @@ def init_unload_vae(self):

def init_validations(self):
if (
self.accelerator.state.deepspeed_plugin.deepspeed_config[
"zero_optimization"
].get("stage")
hasattr(self.accelerator, "state")
and hasattr(self.accelerator.state, "deepspeed_plugin")
and getattr(self.accelerator.state.deepspeed_plugin, "deepspeed_config", {})
.get("zero_optimization", {})
.get("stage")
== 3
):
logger.error("Cannot run validations with DeepSpeed ZeRO stage 3.")
Expand Down

0 comments on commit 66d288f

Please sign in to comment.