From 9f987fc99f7d004ad756fd7c90edfe9a53492dcb Mon Sep 17 00:00:00 2001 From: Almeet Bhullar Date: Thu, 24 Oct 2024 03:09:21 +0000 Subject: [PATCH] #12349: Enabling pytests on BH that are now working --- .../sweep_tests/pytests/tt_dnn/test_div.py | 3 +-- .../sweep_tests/pytests/tt_dnn/test_div_unary.py | 3 +-- .../sweep_tests/pytests/tt_dnn/test_fmod.py | 3 +-- .../sweep_tests/pytests/tt_dnn/test_frac.py | 3 +-- .../misc/test_scaled_dot_product_attention_decode.py | 7 +++++++ .../python_api_testing/unit_testing/misc/test_sum.py | 1 - .../python_api_testing/unit_testing/misc/test_transpose.py | 4 ++++ .../python_api_testing/unit_testing/test_prod_nc.py | 1 - .../eltwise/binary/device/binary_composite_op.cpp | 2 +- .../operations/eltwise/unary/device/unary_composite_op.cpp | 2 +- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div.py b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div.py index 60acfe5f59b..0fc89897817 100644 --- a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div.py +++ b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div.py @@ -16,7 +16,7 @@ from tests.tt_eager.python_api_testing.sweep_tests.run_pytorch_ci_tests import ( run_single_pytorch_test, ) -from models.utility_functions import is_grayskull, skip_for_blackhole +from models.utility_functions import is_grayskull mem_configs = [ ttnn.MemoryConfig(ttnn.TensorMemoryLayout.INTERLEAVED, ttnn.BufferType.DRAM), @@ -24,7 +24,6 @@ ] -@skip_for_blackhole("Only supported for WH, see #12349") @pytest.mark.parametrize("accurate_mode", [False, True]) @pytest.mark.parametrize("round_mode", ["None", "trunc", "floor"]) @pytest.mark.parametrize( diff --git a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div_unary.py b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div_unary.py index 0a85d67f471..3d85a290137 100644 --- a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div_unary.py +++ b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_div_unary.py @@ -16,7 +16,7 @@ from tests.tt_eager.python_api_testing.sweep_tests.run_pytorch_ci_tests import ( run_single_pytorch_test, ) -from models.utility_functions import is_grayskull, skip_for_blackhole +from models.utility_functions import is_grayskull mem_configs = [ ttnn.MemoryConfig(ttnn.TensorMemoryLayout.INTERLEAVED, ttnn.BufferType.DRAM), @@ -24,7 +24,6 @@ ] -@skip_for_blackhole("Only supported on WH, see #12349") @pytest.mark.parametrize("accurate_mode", [True]) @pytest.mark.parametrize("round_mode", ["None", "trunc", "floor"]) @pytest.mark.parametrize( diff --git a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_fmod.py b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_fmod.py index 28cd0590730..65b45a5ba6b 100644 --- a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_fmod.py +++ b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_fmod.py @@ -16,7 +16,7 @@ from tests.tt_eager.python_api_testing.sweep_tests.run_pytorch_ci_tests import ( run_single_pytorch_test, ) -from models.utility_functions import skip_for_grayskull, skip_for_blackhole +from models.utility_functions import skip_for_grayskull mem_configs = [ ttnn.MemoryConfig(ttnn.TensorMemoryLayout.INTERLEAVED, ttnn.BufferType.DRAM), @@ -24,7 +24,6 @@ ] -@skip_for_blackhole("Only supported on WH, see #12349") @pytest.mark.parametrize( "input_shapes", [ diff --git a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_frac.py b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_frac.py index 25e92cbf3fd..9c6907d1fac 100644 --- a/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_frac.py +++ b/tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_frac.py @@ -7,7 +7,7 @@ import random from functools import partial import ttnn -from models.utility_functions import skip_for_grayskull, skip_for_blackhole +from models.utility_functions import skip_for_grayskull from tests.tt_eager.python_api_testing.sweep_tests import ( comparison_funcs, @@ -23,7 +23,6 @@ ] -@skip_for_blackhole("Unsupported on BH, see #12349") @pytest.mark.parametrize( "input_shapes", [ diff --git a/tests/tt_eager/python_api_testing/unit_testing/misc/test_scaled_dot_product_attention_decode.py b/tests/tt_eager/python_api_testing/unit_testing/misc/test_scaled_dot_product_attention_decode.py index 0783e8c464e..dcaac29bc89 100644 --- a/tests/tt_eager/python_api_testing/unit_testing/misc/test_scaled_dot_product_attention_decode.py +++ b/tests/tt_eager/python_api_testing/unit_testing/misc/test_scaled_dot_product_attention_decode.py @@ -469,6 +469,7 @@ def run_test_sdpa_decode_single_iter( assert out_pass +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.parametrize( "dtype, q_dtype", @@ -518,6 +519,7 @@ def test_sdpa_decode( ) +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.parametrize( "dtype, q_dtype", @@ -550,6 +552,7 @@ def test_sdpa_decode_non_causal(device, b, nh, nkv, s, d, dtype, grid_size, q_dt assert device.num_program_cache_entries() == 1 +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.parametrize( "dtype, q_dtype", @@ -869,6 +872,7 @@ def test_sdpa_decode_paged_attention( assert device.num_program_cache_entries() == 4 +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.parametrize( "dtype, q_dtype", @@ -898,6 +902,7 @@ def test_sdpa_decode_sharded(device, b, nh, nkv, s, d, dtype, grid_size, q_dtype ) +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.skip("Skipping Perf Test in CI") def test_sdpa_decode_perf(device, use_program_cache): @@ -952,6 +957,7 @@ def test_sdpa_decode_perf(device, use_program_cache): ) +@skip_for_blackhole("Unsupported on BH, see #12349") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") @pytest.mark.parametrize( "dtype", @@ -1171,6 +1177,7 @@ def run_test_sdpa_decode_ndpcc(device, b, nh, nkv, s, d, dtype, grid_size, q_dty logger.info(f"PCC failed Start Pos: {failed_start_pos}") +@skip_for_blackhole("Unsupported on BH, see #12349") @pytest.mark.timeout(600) @pytest.mark.skip("Skipping due to causing 45 minutes timeout on tt eager unit tests") @skip_for_grayskull("Unsupported in GS since L1 runs OOM with most configs") diff --git a/tests/tt_eager/python_api_testing/unit_testing/misc/test_sum.py b/tests/tt_eager/python_api_testing/unit_testing/misc/test_sum.py index 5bafca9f180..1b204e133fb 100644 --- a/tests/tt_eager/python_api_testing/unit_testing/misc/test_sum.py +++ b/tests/tt_eager/python_api_testing/unit_testing/misc/test_sum.py @@ -9,7 +9,6 @@ from models.utility_functions import skip_for_blackhole -@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "shape_dim", ( diff --git a/tests/tt_eager/python_api_testing/unit_testing/misc/test_transpose.py b/tests/tt_eager/python_api_testing/unit_testing/misc/test_transpose.py index 7ee7809fbb8..29ac447236e 100644 --- a/tests/tt_eager/python_api_testing/unit_testing/misc/test_transpose.py +++ b/tests/tt_eager/python_api_testing/unit_testing/misc/test_transpose.py @@ -631,6 +631,7 @@ def test_transpose_bfloat8_b(device, shape, swap_dims): assert_with_pcc(torch_output, tt_output, 0.9999) +@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "dtype", (ttnn.bfloat16, ttnn.float32), @@ -649,6 +650,7 @@ def test_transpose_hc(dtype, shape, device): transpose(shape, device, dim0=1, dim1=-2, input_dtype=dtype) +@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "dtype", (ttnn.bfloat16, ttnn.float32), @@ -677,6 +679,7 @@ def test_transpose_2D(dtype, shape, layout, device): assert_with_pcc(torch_output, tt_output, 0.9999) +@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "dtype", (ttnn.bfloat16, ttnn.float32), @@ -758,6 +761,7 @@ def test_transpose_failures(config, device): assert_with_pcc(torch_output, tt_output, 0.9999) +@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "config", [ diff --git a/tests/tt_eager/python_api_testing/unit_testing/test_prod_nc.py b/tests/tt_eager/python_api_testing/unit_testing/test_prod_nc.py index 71641bc8071..9bf38150854 100644 --- a/tests/tt_eager/python_api_testing/unit_testing/test_prod_nc.py +++ b/tests/tt_eager/python_api_testing/unit_testing/test_prod_nc.py @@ -28,7 +28,6 @@ def get_tensors(input_shape, output_shape, device): return tt_input, tt_output, torch_input -@skip_for_blackhole("Mismatching on BH, see #12349") @pytest.mark.parametrize( "input_shape", ( diff --git a/ttnn/cpp/ttnn/operations/eltwise/binary/device/binary_composite_op.cpp b/ttnn/cpp/ttnn/operations/eltwise/binary/device/binary_composite_op.cpp index 1303233ab57..96936013a3b 100644 --- a/ttnn/cpp/ttnn/operations/eltwise/binary/device/binary_composite_op.cpp +++ b/ttnn/cpp/ttnn/operations/eltwise/binary/device/binary_composite_op.cpp @@ -280,7 +280,7 @@ Tensor ExecuteBinaryRemainder::invoke(const Tensor& input, float scalar, const s // Binary FMOD will be overloaded by unary FMOD in another PR Tensor ExecuteBinaryFmod::invoke(const Tensor& input_a, const Tensor& input_b, const std::optional& output_mem_config) { auto arch = input_a.device()->arch(); - TT_FATAL(arch == tt::ARCH::WORMHOLE_B0, "Op is only supported on Wormhole"); + TT_FATAL(arch == tt::ARCH::WORMHOLE_B0 or arch == tt::ARCH::BLACKHOLE, "Op is only supported on Wormhole or Blackhole"); DataType input_dtype = input_a.get_dtype(); Tensor a = typecast(input_a, DataType::FLOAT32); Tensor b = typecast(input_b, DataType::FLOAT32); diff --git a/ttnn/cpp/ttnn/operations/eltwise/unary/device/unary_composite_op.cpp b/ttnn/cpp/ttnn/operations/eltwise/unary/device/unary_composite_op.cpp index dee368d713c..1ba9dbd7ac5 100644 --- a/ttnn/cpp/ttnn/operations/eltwise/unary/device/unary_composite_op.cpp +++ b/ttnn/cpp/ttnn/operations/eltwise/unary/device/unary_composite_op.cpp @@ -817,7 +817,7 @@ Tensor _normalize_global(const Tensor& y, const std::optional& ou Tensor _frac(const Tensor& input, const std::optional& output_mem_config) { auto arch = input.device()->arch(); - TT_FATAL(arch == tt::ARCH::WORMHOLE_B0, "Op is only supported on Wormhole"); + TT_FATAL(arch == tt::ARCH::WORMHOLE_B0 or arch == tt::ARCH::BLACKHOLE, "Op is only supported on Wormhole or Blackhole"); Tensor trunc_res = ttnn::trunc(input); Tensor result = ttnn::subtract(input, trunc_res, std::nullopt, output_mem_config); return result;