DistAttr

class paddle.distributed. DistAttr ( mesh, sharding_specs ) [source]

DistAttr specifies how tensors are distributed or sliced on ProcessMesh.

Parameters
  • mesh (paddle.distributed.ProcessMesh) – The ProcessMesh object describes the Cartesian topology of the used processes.

  • sharding_specs (list[str|None]) – The specification describing how to shard the Tensor.

Examples

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

>>> mesh = dist.ProcessMesh([[2, 4, 5], [0, 1, 3]], dim_names=['x', 'y'])
>>> dist_attr = dist.DistAttr(mesh=mesh, sharding_specs=['x', 'y'])

>>> print(dist_attr)
property sharding_specs

Get sharding_specs of the dist_attr :returns: sharding_specs :rtype: list[str]

clear_annotated ( self: paddle.base.libpaddle.TensorDistAttr ) None

clear_annotated

is_annotated ( self: paddle.base.libpaddle.TensorDistAttr, arg0: str ) bool

is_annotated

mark_annotated ( self: paddle.base.libpaddle.TensorDistAttr, arg0: str ) None

mark_annotated

parse_from_string ( self: paddle.base.libpaddle.TensorDistAttr, arg0: str ) None

parse_from_string

reset ( self: paddle.base.libpaddle.TensorDistAttr ) None

reset

serialize_to_string ( self: paddle.base.libpaddle.TensorDistAttr ) bytes

serialize_to_string

verify ( self: paddle.base.libpaddle.TensorDistAttr, tensor: paddle.base.libpaddle.VarDesc = None ) bool

verify