Skip to content

Commit

Permalink
Only disallow DeepSpeed
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerzr committed Jul 1, 2024
1 parent e655029 commit 4a81c8c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4643,10 +4643,9 @@ def create_accelerator_and_postprocess(self):
wrapper = "DeepSpeed" if self.is_deepspeed_enabled else "FSDP"
raise ValueError(f"{wrapper} can't be used with `save_only_model` along with `load_best_model_at_end`.")

# `auto_find_batch_size` isn't yet supported with DeepSpeed/FSDP
if (self.is_deepspeed_enabled or self.is_fsdp_enabled) and self.args.auto_find_batch_size:
wrapper = "DeepSpeed" if self.is_deepspeed_enabled else "FSDP"
raise NotImplementedError(f"`{wrapper}` doesn't support `auto_find_batch_size`.")
# `auto_find_batch_size` isn't yet supported with DeepSpeed
if self.is_deepspeed_enabled and self.args.auto_find_batch_size:
raise NotImplementedError(f"`DeepSpeed` doesn't support `auto_find_batch_size`.")

def propagate_args_to_deepspeed(self, auto_find_batch_size=False):
"""
Expand Down

0 comments on commit 4a81c8c

Please sign in to comment.