Skip to content

Commit

Permalink
#12349: add back tests that now work on blackhole
Browse files Browse the repository at this point in the history
#12550: re-enable some permute tests, disable the ones that aren't
working
  • Loading branch information
sjameelTT committed Dec 11, 2024
1 parent ece65c2 commit 2c2a062
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
]


@skip_for_blackhole("Mismatching on BH, see #12349")
@pytest.mark.parametrize("input_shapes, permute_args", params)
def test_run_permute_test(input_shapes, permute_args, device, function_level_defaults):
datagen_func = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def test_transpose_wh_sharded_program_cache(dtype, device, use_program_cache):
)


@skip_for_blackhole("Mismatching on BH, see #12349")
@skip_for_grayskull("Grayskull has pcc issue when transpose used untilize")
@pytest.mark.parametrize("n", [1])
@pytest.mark.parametrize("c", [1])
Expand Down Expand Up @@ -333,7 +332,6 @@ def test_tranpose_hw_rm_with_padding(device, n, c, h, w):
assert_with_pcc(torch_output_tensor, activation_pyt_padded_out, 0.9999)


@skip_for_blackhole("Mismatching on BH, see #12349")
@skip_for_grayskull("Grayskull has pcc issue when transpose used untilize")
@pytest.mark.parametrize("n", [16])
@pytest.mark.parametrize("c", [128])
Expand Down Expand Up @@ -373,7 +371,6 @@ def run_tranpose_hw_rm_program_cache(device, n, c, h, w, use_program_cache):
assert_with_pcc(torch_output_tensor, activation_pyt_padded_out, 0.9999)


@skip_for_blackhole("Mismatching on BH, see #12349")
@skip_for_grayskull("Grayskull has pcc issue when transpose used untilize")
@pytest.mark.parametrize("n", [16])
@pytest.mark.parametrize("c", [128])
Expand All @@ -400,7 +397,7 @@ def test_tranpose_hw_rm_with_program_cache(device, n, c, h, w, use_program_cache
@pytest.mark.parametrize("c", [224])
@pytest.mark.parametrize("h", [16])
@pytest.mark.parametrize("w", [112])
def test_tranpose_hw_sharded_rm(device, n, c, h, w):
def test_transpose_hw_sharded_rm(device, n, c, h, w):
torch.manual_seed(2005)
torch_input_tensor = torch.rand((n, c, h, w), dtype=torch.bfloat16)
torch_output_tensor = torch_input_tensor.transpose(2, 3)
Expand Down Expand Up @@ -467,7 +464,6 @@ def run_tranpose_hw_sharded_rm_with_program_cache(device, n, c, h, w):
assert_with_pcc(torch_output_tensor, tt_output_tensor, 0.9999)


@skip_for_blackhole("Mismatching on BH, see #12349")
@pytest.mark.parametrize("n", [16])
@pytest.mark.parametrize("c", [128])
@pytest.mark.parametrize("h", [128])
Expand Down Expand Up @@ -579,7 +575,6 @@ def run_tranpose_hc_sharded(device, n, c, h, w, grid_size):
assert_with_pcc(torch_output_tensor, tt_output_tensor, 0.9999)


@skip_for_blackhole("Mismatching on BH, see #12349")
@pytest.mark.parametrize(
"n, c, h, w, grid_size",
[
Expand Down
9 changes: 7 additions & 2 deletions tests/ttnn/unit_tests/operations/test_permute.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import itertools

from tests.ttnn.utils_for_testing import assert_with_pcc
from models.utility_functions import is_blackhole, is_grayskull, skip_for_grayskull
from models.utility_functions import is_blackhole, is_grayskull, skip_for_grayskull, skip_for_blackhole


@pytest.mark.parametrize("h", [32])
Expand Down Expand Up @@ -185,6 +185,7 @@ def generate_permutations(N):
yield perm


@skip_for_blackhole("tilize_block gives bad pcc after second iteration")
@skip_for_grayskull("tilize_block gives bad pcc after second iteration")
@pytest.mark.parametrize("shape", [(7, 7, 7, 7, 7)])
@pytest.mark.parametrize("perm", generate_permutations(5))
Expand All @@ -204,6 +205,7 @@ def test_permute_5d_width(shape, perm, memory_config, dtype, device):
assert_with_pcc(torch_output, tt_output, 0.9999)


@skip_for_blackhole("tilize_block gives bad pcc after second iteration")
@skip_for_grayskull("tilize_block gives bad pcc after second iteration")
@pytest.mark.parametrize("shape", [(3, 65, 3, 3, 65), (1, 6, 256, 20, 50), (6, 20, 50, 1, 256)])
@pytest.mark.parametrize("perm", [(4, 0, 3, 2, 1), (1, 3, 4, 0, 2), (3, 0, 4, 1, 2)])
Expand All @@ -225,8 +227,10 @@ def test_permute_5d_blocked(shape, perm, memory_config, dtype, device):
assert_with_pcc(torch_output, tt_output, 0.9999)


@skip_for_blackhole("tilize_block gives bad pcc after second iteration")
@skip_for_grayskull("tilize_block gives bad pcc after second iteration")
def test_permute_nd(device):
torch.manual_seed(2005)
torch_tensor = torch.rand((1, 3, 16, 16, 16, 16), dtype=torch.bfloat16)
input_tensor = ttnn.from_torch(torch_tensor, layout=ttnn.ROW_MAJOR_LAYOUT, device=device)
output_tensor = ttnn.permute(input_tensor, (0, 2, 4, 3, 5, 1))
Expand All @@ -244,10 +248,11 @@ def test_permute_squeeze(device):

@pytest.mark.parametrize("shape", [(1, 49, 768)])
@pytest.mark.parametrize("perm", generate_permutations(3))
@pytest.mark.parametrize("layout", [ttnn.TILE_LAYOUT, ttnn.ROW_MAJOR_LAYOUT])
@pytest.mark.parametrize("layout", [ttnn.TILE_LAYOUT])
@pytest.mark.parametrize("memory_config", [ttnn.DRAM_MEMORY_CONFIG, ttnn.L1_MEMORY_CONFIG])
@pytest.mark.parametrize("dtype", [ttnn.bfloat16, ttnn.float32])
def test_permute_3D(shape, perm, layout, memory_config, dtype, device):
torch.manual_seed(2005)
if is_grayskull() and dtype == ttnn.float32:
pytest.skip("Grayskull doesn't support float32")
torch_tensor = torch.rand(shape, dtype=torch.bfloat16)
Expand Down

0 comments on commit 2c2a062

Please sign in to comment.