xnn.common.distributed.average_gradients#
- xnn.common.distributed.average_gradients(params)[source]#
Average the gradients of parameters outside a
DistributedDataParallelmodule over the ranks.In place, in the same order on every rank; a missing gradient counts as zero. Nothing happens outside a distributed run.
- Parameters:
params (list of Tensor) – The parameters, identical on every rank.
- Return type:
None