334 Star 1.5K Fork 863

MindSpore / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get_rank.md 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
luojianing 提交于 2023-07-21 15:16 . replace target=blank

Function Differences with torch.distributed.get_rank

View Source On Gitee

torch.distributed.get_rank

torch.distributed.get_rank(group=None)

For more information, see torch.distributed.get_rank.

mindspore.communication.get_rank

mindspore.communication.get_rank(group=GlobalComm.WORLD_COMM_GROUP)

For more information, see mindspore.communication.get_rank.

Differences

PyTorch: The input of this interface is the communication group group. The output is the rank of the process that calls this interface, and returns -1 if the process is not in group.

MindSpore: The input of this interface is the communication group group. The output is the rank of the process that calls this interface. Since get_rank should be called after init, the process that calls this interface should be in group. If get_rank is called before init, it will raise error.

Class Sub-class PyTorch MindSpore Difference
Parameter Parameter 1 group group No difference
1
https://gitee.com/mindspore/docs.git
git@gitee.com:mindspore/docs.git
mindspore
docs
docs
r2.0

搜索帮助