[XPU] Implement out-of-place all-reduce functionality (#41808)
Signed-off-by: Chaojun,Zhang <chaojun.zhang@intel.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
805e9f7b77
commit
2a84da3b17
@@ -42,7 +42,7 @@ class XpuCommunicator(DeviceCommunicatorBase):
|
|||||||
logger.info("Using AgRs manager on XPU device.")
|
logger.info("Using AgRs manager on XPU device.")
|
||||||
|
|
||||||
def all_reduce(self, input_: torch.Tensor) -> torch.Tensor:
|
def all_reduce(self, input_: torch.Tensor) -> torch.Tensor:
|
||||||
output = input_.clone() if torch.compiler.is_compiling() else input_
|
output = input_.clone()
|
||||||
dist.all_reduce(output, group=self.device_group)
|
dist.all_reduce(output, group=self.device_group)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user