335 Star 1.5K Fork 861

MindSpore / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
all_gather.md 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
TingWang 提交于 2023-09-18 10:08 . update link logo

比较与torch.distributed.all_gather的差异

查看源文件

torch.distributed.all_gather

torch.distributed.all_gather(
    tensor_list,
    tensor,
    group=None,
    async_op=False
)

更多内容详见torch.distributed.all_gather

mindspore.ops.AllGather

class mindspore.ops.AllGather(group=GlobalComm.WORLD_COMM_GROUP)(input_x)

更多内容详见mindspore.ops.AllGather

使用方式

PyTorch:该接口输入当前进程广播的tensor、通信域group及异步操作标志async_op,进行AllGather操作后输出tensor_list,类型为list[Tensor],长度为通信域中设备数量N。当async_op=True时,返回异步work句柄,否则返回为空。

MindSpore:该接口输入tensor input_x,输出tensor,第一维为通信域中设备数量N,其余维度与输入tensor一致,而不是像PyTorch对应接口输出list[Tensor]。当前该接口不支持async_op的配置。

分类 子类 PyTorch MindSpore 差异
参数 参数1 tensor_list - PyTorch:进行AllGather操作后的输出,MindSpore无此参数
参数2 tensor - PyTorch:当前进程广播的tensor,MindSpore无此参数
参数3 group group -
参数4 async_op - PyTorch:异步操作标志,MindSpore无此参数
输入 单输入 - input_x PyTorch:不适用,MindSpore:AllGather算子的输入Tensor
1
https://gitee.com/mindspore/docs.git
git@gitee.com:mindspore/docs.git
mindspore
docs
docs
master

搜索帮助