ProcessMesh

class paddle.distributed. ProcessMesh ( mesh=None, dim_names=None, shape=None, process_ids=None ) [source]

The ProcessMesh object describes the Cartesian topology of the used processes.

Parameters
  • mesh (list|numpy.array) – an n-dimensional array describes the topology of the processes.

  • dim_names (list, optional) – the i-th element of this list gives the name of the i-th dimension of the mesh.

Examples

>>> import paddle
>>> import paddle.distributed as dist

>>> mesh = dist.ProcessMesh([[2, 4, 5], [0, 1, 3]], dim_names=["x", "y"])
>>> assert mesh.shape == [2, 3]
>>> assert mesh.process_ids == [2, 4, 5, 0, 1, 3]
property mesh

Get the underlying mesh of ProcessMesh.

property dim_names

Get the underlying dimension names of ProcessMesh.

property unique_id

Get the unique id of ProcessMesh. NOTE Unique id only take process_ids and shape into account. Different ProcessMesh with same process_ids and shape have same unique id.

contains ( self: paddle.base.libpaddle.ProcessMesh, arg0: int ) bool

contains

dim_size ( *args, **kwargs )

dim_size

Overloaded function.

  1. dim_size(self: paddle.base.libpaddle.ProcessMesh, arg0: int) -> int

  2. dim_size(self: paddle.base.libpaddle.ProcessMesh, arg0: str) -> int

empty ( self: paddle.base.libpaddle.ProcessMesh ) bool

empty