tenstorrent / tt-metal

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

[Bug Report] ttnn.upsample op - Data and shape Mismatch #14938

Open kamalrajkannan78 opened 3 days ago

kamalrajkannan78 commented 3 days ago

Describe the bug The ttnn.upsample throws assertion error because of data mismatch between PyTorch and TTNN output when both height and width of input tensor are odd or when scalar factor = 4 or 8 . Shape mismatch between pytorch result of interpolation and TTNN output observed when scalar factor = 4 and atleast one of height and width are even. Also ttnn.upsample throws assertion error because of data mismatch between PyTorch and TTNN output when mode = Bilinear

To Reproduce Steps to reproduce the behavior:

git checkout kkannan/upsample_issues
git submodule update --recursive

# test case 2 - both width and height is odd & scale factor = 2
pytest tests/ttnn/unit_tests/operations/test_upsample.py -k "odd" -svv

# test case 3 - scale factor = 4
pytest tests/ttnn/unit_tests/operations/test_upsample.py -k "sf4" -svv

# test case 4 - scale factor = 8
pytest tests/ttnn/unit_tests/operations/test_upsample.py -k "sf8" -svv

# test case 5 - mode =  bilinear & atleast one of the width / height is even & scale factor = 2
pytest tests/ttnn/unit_tests/operations/test_upsample.py -k "single_core_bilinear" -svv

Expected behavior The data mismatch between PyTorch and TTNN output & shape mismatch between pytorch result of interpolation and TTNN output should be resolved.

Logs

nvukobratTT commented 3 days ago

Note: This is model-related, but not part of key models (not P0) at the moment.