Skip to content

Commit

Permalink
Disable diving loss by world size, better without
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed Sep 16, 2023
1 parent b449bf4 commit 85725fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/open_clip/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def forward(self, image_features, text_features, logit_scale, logit_bias, output
loss += neg_loss
text_features_to_right = text_features_from_left

loss /= self.world_size # not 100% clear if this should be here
# loss /= self.world_size # better without this

# approach #2
# loss = torch.distributed.nn.all_reduce(loss)
Expand Down

0 comments on commit 85725fc

Please sign in to comment.