tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
Apache License 2.0
329 stars 32 forks source link

ttnn.eq incorrect output for uint16 tensors #8551

Open sraizada-tt opened 2 months ago

sraizada-tt commented 2 months ago

ttnn.eq considers 1==0 True for uint16 tensors; unit test:

import ttnn 
from ttnn import ReplicateTensorToMesh, ConcatMeshToTensor
import torch 
def test_matmul(device_mesh):
    mask = ttnn.from_torch(
            torch.zeros(1, 1, 32, 32),
            dtype=ttnn.uint16,
            layout=ttnn.TILE_LAYOUT,
            device=device_mesh,
            mesh_mapper=ReplicateTensorToMesh(device_mesh),
        )
    output = ttnn.from_torch(
            torch.ones(1, 1, 32, 32),
            dtype=ttnn.uint16,
            layout=ttnn.TILE_LAYOUT,
            device=device_mesh,
            mesh_mapper=ReplicateTensorToMesh(device_mesh),
        )
    output_reduced = ttnn.eq(output, mask) 

    assert torch.all(ttnn.to_torch(output_reduced, mesh_composer=ConcatMeshToTensor(device_mesh, dim=0))==0 ).item()
arakhmati commented 2 months ago

Re-assigning this issue to @umadevimcw

ruthreshx commented 2 months ago

Hi @sraizada-tt , Could you please add the instructions in ticket to recreate the failure in VM ? Thanks in advance!

sraizada-tt commented 2 months ago

lowering priority because we have a workaround

KalaivaniMCW commented 10 hours ago

will be revisited after TTNN migration