Skip to content

Commit 62a82a8

Browse files
authored
Merge pull request #84 from zhipuch/main
sft with multigpu gradient_norm_before_clip error update
2 parents 559ba47 + ac5f417 commit 62a82a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

training/cogvideox_text_to_video_sft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def load_model_hook(models, input_dir):
744744
last_lr = lr_scheduler.get_last_lr()[0] if lr_scheduler is not None else args.learning_rate
745745
logs = {"loss": loss.detach().item(), "lr": last_lr}
746746
# gradnorm + deepspeed: https://github.com/microsoft/DeepSpeed/issues/4555
747-
if accelerator.distributed_type != DistributedType.DEEPSPEED:
747+
if accelerator.sync_gradients and accelerator.distributed_type != DistributedType.DEEPSPEED:
748748
logs.update(
749749
{
750750
"gradient_norm_before_clip": gradient_norm_before_clip,

0 commit comments

Comments
 (0)