From 6a486ec2090476311e8e3d55abfdc927cdb8cf95 Mon Sep 17 00:00:00 2001 From: lilong12 Date: Wed, 13 Apr 2022 10:09:05 +0800 Subject: [PATCH] update (#41636) --- python/paddle/distributed/collective.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/distributed/collective.py b/python/paddle/distributed/collective.py index fbad470cb3..d2bed171aa 100644 --- a/python/paddle/distributed/collective.py +++ b/python/paddle/distributed/collective.py @@ -849,7 +849,9 @@ def all_gather(tensor_list, tensor, group=None, use_calc_stream=True): if in_dygraph_mode(): group = _get_default_group() if group is None else group - out = paddle.concat(tensor_list) + tensor_shape = list(tensor.shape) + tensor_shape[0] *= group.nranks + out = paddle.empty(tensor_shape, tensor.dtype) task = group.process_group.all_gather(tensor, out) task.wait() tensor_list.clear() -- GitLab