set_mesh

paddle.distributed. set_mesh ( mesh ) [源代码]

配置全局 mesh。

参数

  • mesh (paddle.distributed.ProcessMesh) - 设定的全局 mesh。

返回

None

代码示例

>>> import paddle
>>> import paddle.distributed as dist
>>> mesh = dist.ProcessMesh([[[0, 1], [2, 3]], [[4, 5], [6, 7]]], dim_names=["dp", "mp", "pp"])
>>> dist.auto_parallel.set_mesh(mesh)
>>> # This case need to be executed in multi-card environment
>>> # python -m paddle.distributed.launch --gpus=0,1,2,3,4,5,6,7 {test_case}.py