Skip to content

Commit

Permalink
Add ttnn-pytorch and tt-forge conv2d sweeps to nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavle Josipovic committed Feb 19, 2025
1 parent 7193d38 commit f9c1a62
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/sweep_framework/sweep_utils/conv2d_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ def run_conv2d_short_sweep(
dilation_w,
has_bias,
] = input_specs
print(input_specs)

if is_forge_suite:
torch_input_dtype = torch.bfloat16 if input_dtype == ttnn.DataType(ttnn.bfloat16) else torch.float32
Expand Down Expand Up @@ -317,7 +316,6 @@ def run_conv2d_short_sweep(

torch_output_tensor = torch.permute(torch_output_tensor, (0, 3, 1, 2))

print("End of test case")
return [check_with_pcc(torch_output_tensor, torch_out_golden_tensor, pcc=0.985), e2e_perf]


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from tests.sweep_framework.sweep_utils.conv2d_common import run_conv2d_short_sweep
from tests.sweep_framework.sweeps.conv2d.short.conv2d_short_sweep import parameters as parameters_ttnn_pytorch
from tests.sweep_framework.sweeps.conv2d.short.conv2d_short_sweep import (
failing_parameters as failing_parameters_ttnn_pytorch,
)

from tests.sweep_framework.sweeps.conv2d.short.conv2d_ttforge_sweep import parameters as parameters_ttnn_forge
from tests.sweep_framework.sweeps.conv2d.short.conv2d_ttforge_sweep import (
failing_parameters as failing_parameters_ttnn_forge,
)

from models.utility_functions import (
skip_for_grayskull,
is_wormhole_b0,
)

import pytest


@skip_for_grayskull()
@pytest.mark.parametrize("input_spec", parameters_ttnn_pytorch["short_sweep_suite_conv2d"]["input_specs"])
@pytest.mark.parametrize("device_params", [{"l1_small_size": 16384}], indirect=True)
def test_ttnn_pytorch_sweep(device, input_spec):
if device.core_grid.y != 8 and is_wormhole_b0():
pytest.skip("Needs 8x8 grid for wormhole_b0")

# Check if input_spec is in failing_parameters
if input_spec in failing_parameters_ttnn_pytorch:
pytest.skip(f"Skipping test for failing input_spec: {input_spec}")

pcc, messsage = run_conv2d_short_sweep(
input_spec,
device,
)[0]
assert pcc, messsage


@skip_for_grayskull()
@pytest.mark.parametrize("input_spec", parameters_ttnn_forge["ttforge_sweep_conv2d"]["input_specs"])
@pytest.mark.parametrize("device_params", [{"l1_small_size": 16384}], indirect=True)
def test_tt_forge_sweep(device, input_spec):
if device.core_grid.y != 8 and is_wormhole_b0():
pytest.skip("Needs 8x8 grid for wormhole_b0")

# Check if input_spec is in failing_parameters
if input_spec in failing_parameters_ttnn_forge:
pytest.skip(f"Skipping test for failing input_spec: {input_spec}")

pcc, messsage = run_conv2d_short_sweep(
input_spec,
device,
)[0]
assert pcc, messsage

0 comments on commit f9c1a62

Please sign in to comment.