Skip to content

Commit

Permalink
[BugFix] Fix fsdp option on shard_grad_op. (huggingface#19131)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHUI authored Sep 21, 2022
1 parent 9e95706 commit da6a1b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ def __post_init__(self):
"`--fsdp offload` can't work on its own. It needs to be added to `--fsdp full_shard` or "
'`--fsdp shard_grad_op`. For example, `--fsdp "full_shard offload"`.'
)
elif FSDPOption.FULL_SHARD in self.fsdp and FSDPOption.SHARD_GRAD_OP in self.sharded_ddp:
elif FSDPOption.FULL_SHARD in self.fsdp and FSDPOption.SHARD_GRAD_OP in self.fsdp:
raise ValueError("`--fsdp full_shard` is not compatible with `--fsdp shard_grad_op`.")

if len(self.fsdp) == 0 and self.fsdp_min_num_params > 0:
Expand Down

0 comments on commit da6a1b6

Please sign in to comment.