get_mesh¶
- paddle.distributed. get_mesh ( ) paddle.distributed.auto_parallel.process_mesh.ProcessMesh [source]
-
Get the global mesh set by set_mesh.
- Returns
-
the global mesh.
- Return type
-
mesh (paddle.distributed.ProcessMesh)
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) >>> mesh = dist.auto_parallel.get_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