Open hschoi4448 opened 6 months ago
Hi @tt-aho , @jliangTT , @eyonland , @hschoi4448
Isclose
is dependent on isnan
operation, but due to hardware restrictions, we are facing issue related to nan : Discussion.
Kindly share your inputs / thoughts on how we could proceed further .
Describe the bug A clear and concise description of what the bug is.
The
isclose
function returns an invalid value.To Reproduce Steps to reproduce the behavior:
SPDX-License-Identifier: Apache-2.0
import torch import pytest import tt_lib from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import data_gen_pt_tt, compare_results
import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops
def data_gen_pt_tt(input_shapes, device, required_grad=False, val=1): pt_tensor = (torch.ones(input_shapes, requires_grad=required_grad) * val).bfloat16() tt_tensor = ( tt_lib.tensor.Tensor(pt_tensor, tt_lib.tensor.DataType.BFLOAT16).to(tt_lib.tensor.Layout.TILE).to(device) ) return pt_tensor, tt_tensor
@pytest.mark.parametrize( "input_shapes", ( (torch.Size([1, 1, 32, 32])), ), ) @pytest.mark.parametrize( "params", ( [ (float('nan'), float('nan'), False), (float('nan'), float('nan'), True), ] ), ) def test_bw(input_shapes, params, device): val1, val2, equal_nan = params in_data, input_tensor = data_gen_pt_tt(input_shapes, device, True, val=val1) other_data, other_tensor = data_gen_pt_tt(input_shapes, device, True, val=val2)
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Please complete the following environment information:
Additional context Add any other context about the problem here.