tt-metal: [Bug Report] ttnn.max wrong results
Describe the bug ttnn.max returns unexpected results
To Reproduce
with ttnn.manage_device(device_id=0) as device:
x = -torch.ones((1, 2, 3, 4), dtype=torch.float32)
x_tt = ttnn.from_torch(x, dtype=ttnn.bfloat16, layout=ttnn.TILE_LAYOUT, device=device)
y_tt = ttnn.max(x_tt, dim=-1)
print(ttnn.to_torch(x_tt))
print(ttnn.to_torch(y_tt))
Output:
TorchTensor([[[[-1., -1., -1., -1.],
[-1., -1., -1., -1.],
[-1., -1., -1., -1.]],
[[-1., -1., -1., -1.],
[-1., -1., -1., -1.],
[-1., -1., -1., -1.]]]], dtype=torch.bfloat16)
TorchTensor([[[[0.],
[0.],
[0.]],
[[0.],
[0.],
[0.]]]], dtype=torch.bfloat16)
Expected behavior Resulting value should be -1.
Please complete the following environment information:
- OS: Ubuntu 20.04
- Version of software: a7d9204fc9cdf579e0a512e3c26fb291b398c75b
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (21 by maintainers)
Commits related to this issue
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: update tests after remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: update tests after remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: adjust shapes to be tile sized for max unit test — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: update tests after remove the reduce with padding operations — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: adjust shapes to be tile sized for max unit test — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim fixes to reduce (#16163) ### Ticket Link to Github Issue https://github.com/tenstorrent/tt-metal/issues/12662 https://github.com/tenstorrent/tt-metal/issues/14898 https://gith... — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add keepdim and max fixes to reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: pad generic reduce op input — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: only pad tiled inputs for reduce — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
- #12662: add pool op entry point for sum — committed to tenstorrent/tt-metal by bbradelTT 2 years ago
I changed the shape to (1, 2, 32, 32) and it looks like -1 values are returned. Next steps: I will need to look at how the padding is set up.
No it doesn’t! We haven’t observed ndpcc so far