set_mesh¶
- paddle.distributed. set_mesh ( mesh: paddle.distributed.auto_parallel.process_mesh.ProcessMesh ) None [source]
-
Set the global mesh.
- Parameters
-
mesh (paddle.distributed.ProcessMesh) – global mesh to be set.
- Returns
-
None
Examples
>>> 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