new_group

paddle.distributed. new_group ( ranks=None, backend=None ) [source]

Creates a new distributed communication group.

Parameters
  • ranks (list) – The global ranks of group members.

  • backend (str) – The backend used to create group, only nccl is supported now.

Returns

The group instance.

Return type

Group

Examples

import paddle

paddle.distributed.init_parallel_env()
tindata = paddle.randn(shape=[2, 3])
gp = paddle.distributed.new_group([2,4,6])
paddle.distributed.all_reduce(tindata, group=gp, use_calc_stream=False)