We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 071a161 commit 4a2e33bCopy full SHA for 4a2e33b
src/transformers/trainer.py
@@ -5175,6 +5175,12 @@ def create_accelerator_and_postprocess(self):
5175
raise ValueError(
5176
"`auto_find_batch_size` isn't supported yet with DeepSpeed Zero-3. Please consider using Zero-2, Zero-1, or FSDP"
5177
)
5178
+ if (
5179
+ self.args.save_only_model
5180
+ and self.is_fsdp_enabled
5181
+ and "SHARDED_STATE_DICT" in str(self.accelerator.state.fsdp_plugin.state_dict_type)
5182
+ ):
5183
+ raise ValueError("save_only_model option is not compatible with FSDP state dict type 'SHARDED_STATE_DICT'")
5184
5185
def propagate_args_to_deepspeed(self, auto_find_batch_size=False):
5186
"""
0 commit comments