Skip to content

Commit

Permalink
fix tensor data update for gemini loss caluculation (hpcaitech#5442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Camille7777 authored and flybird11111 committed Mar 18, 2024
1 parent 9052280 commit cced72d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions applications/Colossal-LLaMA-2/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def format_numel_str(numel: int) -> str:

def all_reduce_mean(tensor: torch.Tensor) -> torch.Tensor:
dist.all_reduce(tensor=tensor, op=dist.ReduceOp.SUM)
tensor = tensor.data
tensor.div_(dist.get_world_size())
return tensor

Expand Down

0 comments on commit cced72d

Please sign in to comment.