Skip to content

Commit ac5f417

Browse files
committed
sft with multigpu
1 parent d63a826 commit ac5f417

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
@@ -743,7 +743,7 @@ def load_model_hook(models, input_dir):
743743
last_lr = lr_scheduler.get_last_lr()[0] if lr_scheduler is not None else args.learning_rate
744744
logs = {"loss": loss.detach().item(), "lr": last_lr}
745745
# gradnorm + deepspeed: https://github.com/microsoft/DeepSpeed/issues/4555
746-
if accelerator.distributed_type != DistributedType.DEEPSPEED:
746+
if accelerator.sync_gradients and accelerator.distributed_type != DistributedType.DEEPSPEED:
747747
logs.update(
748748
{
749749
"gradient_norm_before_clip": gradient_norm_before_clip,

0 commit comments

Comments
 (0)