mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-20 12:43:55 +00:00
fix tensor data update for gemini loss caluculation (#5442)
This commit is contained in:
parent
8020f42630
commit
da885ed540
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user