Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion python/paddle/distributed/auto_parallel/parallelizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,13 @@ def parallelize(
# instantiate communication by process_mapping.
all_process_groups = get_all_process_groups()
for process_group in all_process_groups:
if len(_g_process_group_map) > 0:
tmp = paddle.to_tensor([1], dtype="int32")
paddle.distributed.all_reduce(tmp, sync_op=True, group=_g_process_group_map[0])
paddle.device.cuda.synchronize()

if rank not in process_group.ranks:
continue
continue
process_group.instantiate()

# Copy distributed info to the default context
Expand Down
8 changes: 7 additions & 1 deletion python/paddle/distributed/auto_parallel/process_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ def instantiate(self):
)
paddle.distributed.all_reduce(tmp, sync_op=True, group=self)
paddle.distributed.wait(tmp, group=self)

# TODO(shenliang03) AlltoAll create communicator
alltoall_tmp = paddle.empty(shape=[self.nranks, self.nranks], dtype="int32")
out = paddle._legacy_C_ops.alltoall(alltoall_tmp,
'use_calc_stream', True,
'ring_id', ring_id)
paddle.device.cuda.synchronize()
paddle.enable_static()

self._is_instantiate = True

def is_member(self):
Expand Down