ttnn.point_to_point

ttnn.point_to_point() ttnn.Tensor

Point-to-point send and receive operation. Send a tensor from one device to another.

Args:

input_tensor (ttnn.Tensor): the input tensor. sender_coord (ttnn.MeshCoordinate): Coordinate of device containing input_tensor (shard). receiver_coord (ttnn.MeshCoordinate): Coordinate of device receiving input_tensor (shard).

Keyword Args:

topology (ttnn.Topology): Fabric topology. output_tensor (ttnn.Tensor,optional): Optional output tensor. intermediate_tensor (ttnn.Tensor,optional): Optional intermediate tensor.

Returns:

ttnn.Tensor – the output tensor, with transferred shard on receiving device.

Example:

>>> input_tensor_torch = torch.zeros((2,1,1,16), dtype=dtype)
>>> input_tensor_torch[0, :, :, :] = data # arbitary data in one shard
>>> input_tensor = ttnn.from_torch(
>>>     input_tensor_torch, device=mesh_device, mesh_mapper=ttnn.ShardTensorToMesh(mesh_device, dim=0)
>>> )
>>> sender_coord, receiver_coord = ttnn.MeshCoordinate((0,0)), ttnn.MeshCoordinate((0,1))
>>> sent_tensor = ttnn.point_to_point(
        input_tensor,
        sender_coord,
        receiver_coord,
        topology=ttnn.Topology.Linear)