From 041e23d08bd451de6b36ff1db79a2729238992b8 Mon Sep 17 00:00:00 2001 From: Bharane Bhaskar <138196316+bharane-ab@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:09:56 +0530 Subject: [PATCH] #11649: update tt_lib with ttnn support for non working folder (#11654) --- .../grayskull/test_backward_sqrt.py | 4 ++-- .../grayskull/test_bfloat8_eltwise_logaddexp.py | 2 +- .../grayskull/test_clamp_max_bw.py | 3 +-- .../grayskull/test_clamp_min_bw.py | 2 +- .../grayskull/test_complex_polar.py | 2 +- .../grayskull/test_eltwise_addcdiv_stuck_1.py | 2 +- .../grayskull/test_eltwise_addcdiv_stuck_2.py | 2 +- .../grayskull/test_eltwise_log_sigmoid.py | 2 +- .../grayskull/test_eltwise_logical_and_.py | 1 - .../non_working_unit_tests/grayskull/test_eltwise_ne.py | 2 +- .../grayskull/test_eltwise_recip.py | 2 +- .../grayskull/test_eltwise_rpow.py | 2 +- .../grayskull/test_eltwise_rsqrt_in_depth.py | 2 +- .../test_eltwise_scale_mask_softmax_in_place.py | 2 +- .../grayskull/test_eltwise_softmax_in_place.py | 1 - .../non_working_unit_tests/grayskull/test_permute.py | 2 +- .../non_working_unit_tests/grayskull/test_pow.py | 2 +- .../grayskull/test_reduce_max_h.py | 2 +- .../grayskull/test_reduce_sum_h.py | 2 +- .../non_working_unit_tests/grayskull/test_reshape.py | 2 +- .../grayskull/test_stats_mean_hw.py | 2 +- .../grayskull/test_stats_std_hw.py | 2 +- .../grayskull/test_stats_var_hw.py | 2 +- .../non_working_unit_tests/grayskull/test_sum_2.py | 2 +- .../non_working_unit_tests/wormhole/test_and.py | 1 - .../wormhole/test_backward_embedding.py | 4 ++-- .../wormhole/test_backward_fill.py | 3 +-- .../non_working_unit_tests/wormhole/test_clamp_max_bw.py | 2 +- .../non_working_unit_tests/wormhole/test_clamp_min_bw.py | 2 +- .../wormhole/test_dispatch_mode_transpose_nh.py | 1 - .../wormhole/test_eltwise_isfinite.py | 2 +- .../wormhole/test_eltwise_relu_min.py | 2 +- .../non_working_unit_tests/wormhole/test_eltwise_rpow.py | 9 ++++----- .../wormhole/test_eltwise_threshold.py | 2 +- .../non_working_unit_tests/wormhole/test_embeddings.py | 2 +- .../non_working_unit_tests/wormhole/test_isinf.py | 2 +- .../non_working_unit_tests/wormhole/test_isnan.py | 2 +- .../non_working_unit_tests/wormhole/test_isneginf.py | 2 +- .../non_working_unit_tests/wormhole/test_isposinf.py | 2 +- .../wormhole/test_normalize_global.py | 1 - .../non_working_unit_tests/wormhole/test_or.py | 2 +- .../non_working_unit_tests/wormhole/test_segfault.py | 2 +- .../non_working_unit_tests/wormhole/test_transpose_nh.py | 2 +- .../wormhole/test_untilize_with_unpadding.py | 2 +- 44 files changed, 44 insertions(+), 52 deletions(-) diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_backward_sqrt.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_backward_sqrt.py index 4134123bb3e..73523b5da08 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_backward_sqrt.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_backward_sqrt.py @@ -4,12 +4,12 @@ import torch import pytest -import tt_lib from tests.tt_eager.python_api_testing.unit_testing.backward_ops.utility_funcs import ( data_gen_with_range, compare_pcc, data_gen_with_val, ) +import ttnn @pytest.mark.parametrize( @@ -26,7 +26,7 @@ def test_bw_sqrt(input_shapes, device): pyt_y = torch.sqrt(in_data) - tt_output_tensor_on_device = tt_lib.tensor.sqrt_bw(grad_tensor, input_tensor) + tt_output_tensor_on_device = ttnn.sqrt_bw(grad_tensor, input_tensor) in_data.retain_grad() diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_bfloat8_eltwise_logaddexp.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_bfloat8_eltwise_logaddexp.py index 69b0d618f48..6f924aa6e49 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_bfloat8_eltwise_logaddexp.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_bfloat8_eltwise_logaddexp.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_max_bw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_max_bw.py index f2a49700013..b2dc81368db 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_max_bw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_max_bw.py @@ -6,8 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl - +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc from tests.tt_eager.python_api_testing.sweep_tests import tt_lib_ops, pytorch_ops diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_min_bw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_min_bw.py index 15948553aff..77dae6e8faa 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_min_bw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_clamp_min_bw.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_complex_polar.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_complex_polar.py index 88d14973295..e4ba1f61081 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_complex_polar.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_complex_polar.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_1.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_1.py index 16e62de0200..956f80f8659 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_1.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_1.py @@ -49,7 +49,7 @@ def run_addcdiv(input_shape, dtype, dlayout, buffer_type, output_mem_config, dat ttnn.MemoryConfig(ttnn.TensorMemoryLayout.INTERLEAVED, buffer_type[2]), dtype[2], ) - t3 = ttnn.addcdiv(t0, t1, t2, scalar, output_mem_config) + t3 = ttnn.addcdiv(t0, t1, t2, value=scalar, memory_config=output_mem_config) y = tt2torch_tensor(t3) diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_2.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_2.py index 9d1ae7cf743..5a1cd3adb43 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_2.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_addcdiv_stuck_2.py @@ -47,7 +47,7 @@ def run_addcdiv(input_shape, dtype, dlayout, buffer_type, output_mem_config, dat ttnn.MemoryConfig(ttnn.TensorMemoryLayout.INTERLEAVED, buffer_type[2]), dtype[2], ) - t3 = ttnn.addcdiv(t0, t1, t2, scalar, output_mem_config) + t3 = ttnn.addcdiv(t0, t1, t2, value=scalar, memory_config=output_mem_config) y = tt2torch_tensor(t3) except Exception as exc: diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_log_sigmoid.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_log_sigmoid.py index aa713dd1b40..c48b3f3e908 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_log_sigmoid.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_log_sigmoid.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_logical_and_.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_logical_and_.py index 6fdb4d712e4..aa4c0bc8ae0 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_logical_and_.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_logical_and_.py @@ -6,7 +6,6 @@ import random import pytest import torch -import tt_lib as ttl import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_ne.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_ne.py index a9c28a50887..fecddece5f3 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_ne.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_ne.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc from tests.tt_eager.python_api_testing.sweep_tests.pytorch_ops import ne as pt_ne diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_recip.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_recip.py index 95f074c9468..d5e7b3d79ce 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_recip.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_recip.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rpow.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rpow.py index b188bc27a01..7d93c275cdf 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rpow.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rpow.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rsqrt_in_depth.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rsqrt_in_depth.py index 826d483e301..84c433aab68 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rsqrt_in_depth.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_rsqrt_in_depth.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc from tests.tt_eager.python_api_testing.sweep_tests.tt_lib_ops import eltwise_rsqrt as tt_eltwise_rsqrt diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_scale_mask_softmax_in_place.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_scale_mask_softmax_in_place.py index 36e00c83fbc..471cbf2baf8 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_scale_mask_softmax_in_place.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_scale_mask_softmax_in_place.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_softmax_in_place.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_softmax_in_place.py index 8f8e19e69ec..07b387b0662 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_softmax_in_place.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_softmax_in_place.py @@ -5,7 +5,6 @@ from loguru import logger import pytest import torch -import tt_lib as ttl from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_permute.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_permute.py index dd3d2212dc2..d5d5a6d18ec 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_permute.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_permute.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_pow.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_pow.py index dc98b31bbe1..4f9e9e1bdb4 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_pow.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_pow.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_max_h.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_max_h.py index 7c28a1737d0..2600b0c2e0d 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_max_h.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_max_h.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc, comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_sum_h.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_sum_h.py index e574f94affc..73504296073 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_sum_h.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reduce_sum_h.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc, comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reshape.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reshape.py index 0cbe4e6f038..a2288facfc8 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reshape.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_reshape.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops, tt_lib_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_mean_hw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_mean_hw.py index 2375e66eb4f..670d7fd0b04 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_mean_hw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_mean_hw.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_std_hw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_std_hw.py index aa67fb1b2fb..36b657aa23a 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_std_hw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_std_hw.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc, comp_allclose diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_var_hw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_var_hw.py index 87a33ca1061..b1b2fd88864 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_var_hw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_stats_var_hw.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc, comp_allclose diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_sum_2.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_sum_2.py index 680795bd17a..204f2fdec01 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_sum_2.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_sum_2.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_and.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_and.py index a21bb431436..07f6732c31a 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_and.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_and.py @@ -8,7 +8,6 @@ import random import pytest import torch -import tt_lib as ttl from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_embedding.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_embedding.py index cd50d6a22fc..4bf781fe545 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_embedding.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_embedding.py @@ -4,11 +4,11 @@ import torch import pytest -import tt_lib from tests.tt_eager.python_api_testing.sweep_tests import ( comparison_funcs, ) from loguru import logger +import ttnn @pytest.mark.parametrize( @@ -40,7 +40,7 @@ def test_embedding_bw(input_shapes, device): weights_tensor = ttnn.Tensor(weights, ttnn.bfloat16).to(ttnn.ROW_MAJOR_LAYOUT).to(device) - tt_output_tensor_on_device = tt_lib.tensor.embedding_bw(grad_tensor, input_tensor, weights_tensor) + tt_output_tensor_on_device = ttnn.embedding_bw(grad_tensor, input_tensor, weights_tensor) tt_output_tensor_a = tt_output_tensor_on_device[0].cpu().to(ttnn.ROW_MAJOR_LAYOUT).to_torch() weights.retain_grad() diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_fill.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_fill.py index c94d4152696..76788ff980f 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_fill.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_backward_fill.py @@ -4,7 +4,6 @@ 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 @@ -29,7 +28,7 @@ def test_bw_fill(input_shapes, device): grad_sum = grad_data.sum() pyt_y.fill_(grad_sum) - tt_output_tensor_on_device = tt_lib.tensor.fill_bw(grad_tensor) + tt_output_tensor_on_device = ttnn.fill_bw(grad_tensor) golden_tensor = [pyt_y] comp_pass = compare_results(tt_output_tensor_on_device, golden_tensor) diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_max_bw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_max_bw.py index f3b5520d289..61d9f2d9a53 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_max_bw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_max_bw.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_min_bw.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_min_bw.py index da80fcf7491..9034d3aa988 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_min_bw.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_clamp_min_bw.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_dispatch_mode_transpose_nh.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_dispatch_mode_transpose_nh.py index fa2e3ce39a0..245320c1a80 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_dispatch_mode_transpose_nh.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_dispatch_mode_transpose_nh.py @@ -9,7 +9,6 @@ import random import pytest import torch -import tt_lib as ttl import random import ttnn diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_isfinite.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_isfinite.py index f449c1ce264..2f4f4186741 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_isfinite.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_isfinite.py @@ -6,7 +6,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops, tt_lib_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_relu_min.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_relu_min.py index f35f7a78d6b..34c1a317d12 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_relu_min.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_relu_min.py @@ -5,7 +5,7 @@ from loguru import logger import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc from tests.tt_eager.python_api_testing.sweep_tests.pytorch_ops import relu_min as pt_relu_min diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_rpow.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_rpow.py index 71d0e1e5bbc..ae1adafa431 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_rpow.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_rpow.py @@ -13,7 +13,7 @@ import pytest import torch -import tt_lib as ttl +import ttnn from tt_lib.utils import ( pad_weight, @@ -32,7 +32,6 @@ def run_rpow_tests(input_shape, dtype, dlayout, in_mem_config, out_mem_config, d torch.manual_seed(data_seed) # Initialize the device - tensor = ttl.tensor dev = device test_dims = (input_shape,) @@ -48,7 +47,7 @@ def run_rpow_tests(input_shape, dtype, dlayout, in_mem_config, out_mem_config, d x = x.reshape(-1).tolist() if in_mem_config == "SYSTEM_MEMORY": - ttx = tensor.Tensor( + ttx = ttnn.Tensor( x, [N, C, H, W], dtype, @@ -56,7 +55,7 @@ def run_rpow_tests(input_shape, dtype, dlayout, in_mem_config, out_mem_config, d dev, ).cpu() else: - ttx = tensor.Tensor( + ttx = ttnn.Tensor( x, [N, C, H, W], dtype, @@ -66,7 +65,7 @@ def run_rpow_tests(input_shape, dtype, dlayout, in_mem_config, out_mem_config, d ) logger.info("Running rpow test") - ttz = tensor.rpow(ttx, factor, output_mem_config=out_mem_config) + ttz = ttnn.rpow(ttx, factor, memory_config=out_mem_config) logger.info("Done") diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_threshold.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_threshold.py index 51d2ddca593..151dc353949 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_threshold.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_eltwise_threshold.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_embeddings.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_embeddings.py index a477813aca5..fce96a417df 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_embeddings.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_embeddings.py @@ -6,7 +6,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isinf.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isinf.py index 359b6c41a91..032a50812f0 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isinf.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isinf.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isnan.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isnan.py index 4b9d7bc90c2..2b20ac02a9a 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isnan.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isnan.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isneginf.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isneginf.py index 27011ac07a1..9bee9c86ddc 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isneginf.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isneginf.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isposinf.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isposinf.py index c48974d5e7f..8981797f9f1 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isposinf.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_isposinf.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_normalize_global.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_normalize_global.py index 05f34ef7a80..c0e778a7f17 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_normalize_global.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_normalize_global.py @@ -8,7 +8,6 @@ import random import pytest import torch -import tt_lib as ttl import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_or.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_or.py index 74535840a98..080fadc61b9 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_or.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_or.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_segfault.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_segfault.py index e4c1117a0c3..b916b7f215b 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_segfault.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_segfault.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_pcc diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_transpose_nh.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_transpose_nh.py index f8ad8d72967..2586cb6cc46 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_transpose_nh.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_transpose_nh.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal diff --git a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_untilize_with_unpadding.py b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_untilize_with_unpadding.py index 5aa7249602c..d25e89f8170 100644 --- a/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_untilize_with_unpadding.py +++ b/tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_untilize_with_unpadding.py @@ -8,7 +8,7 @@ import random import pytest import torch -import tt_lib as ttl +import ttnn from tests.tt_eager.python_api_testing.sweep_tests import pytorch_ops from tests.tt_eager.python_api_testing.sweep_tests.comparison_funcs import comp_equal