Skip to content

Commit

Permalink
#5079: add test for tiny resolution 240x320 for yolov4 convs with gro…
Browse files Browse the repository at this point in the history
…ups=1
  • Loading branch information
dvartaniansTT authored and nsmithtt committed May 8, 2024
1 parent 4fdcec6 commit d9c6c04
Showing 1 changed file with 196 additions and 0 deletions.
196 changes: 196 additions & 0 deletions tests/ttnn/unit_tests/operations/test_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,3 +1436,199 @@ def test_yolov4_conv_groups_larger_than_one(
padded_input_channels=16 if input_channels == 3 else None,
output_layout=output_layout,
)


@skip_for_wormhole_b0()
@pytest.mark.parametrize(
"batch_size, output_channels, input_channels, input_height, input_width, filter_height, filter_width, stride_h, stride_w, pad_h, pad_w, use_1d_systolic_array, config_override, use_shallow_conv_variant",
(
# yolov4 convs with batch size 1
# unique convs in yolov4 (complete list) # groups: 1 only
(1, 32, 32, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 32, 32, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 32, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 128, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 128, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 64, 128, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 64, 240, 320, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 128, 256, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 128, 120, 160, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 256, 512, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 256, 60, 80, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 1024, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 1024, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 1024, 512, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
(1, 512, 1024, 30, 40, 1, 1, 1, 1, 0, 0, True, None, False),
),
)
@pytest.mark.parametrize(
"weights_dtype",
[ttnn.bfloat8_b],
)
@pytest.mark.parametrize(
"activations_dtype",
# [ttnn.bfloat8_b, ttnn.bfloat16],
[ttnn.bfloat8_b],
)
@pytest.mark.parametrize("math_fidelity", [ttnn.MathFidelity.LoFi])
# @pytest.mark.parametrize("output_layout", [ttnn.ROW_MAJOR_LAYOUT, ttnn.TILE_LAYOUT])
@pytest.mark.parametrize("output_layout", [ttnn.TILE_LAYOUT])
def test_yolov4_conv_groups_1_low_resolution(
device,
use_program_cache,
math_fidelity,
activations_dtype,
weights_dtype,
batch_size,
output_channels,
input_channels,
input_height,
input_width,
filter_height,
filter_width,
stride_h,
stride_w,
pad_h,
pad_w,
use_1d_systolic_array,
config_override,
use_shallow_conv_variant,
output_layout,
):
if output_layout == ttnn.ROW_MAJOR_LAYOUT and activations_dtype == ttnn.bfloat8_b:
pytest.skip("Row major layout not compatible with bfloat8_b")
if output_layout == ttnn.ROW_MAJOR_LAYOUT and input_height >= 1056:
pytest.skip("OOM")
run_conv(
device,
math_fidelity,
activations_dtype,
weights_dtype,
batch_size,
output_channels,
input_channels,
input_height,
input_width,
filter_height,
filter_width,
stride_h,
stride_w,
pad_h,
pad_w,
use_1d_systolic_array,
config_override,
use_shallow_conv_variant=use_shallow_conv_variant,
# groups=groups,
padded_input_channels=16 if input_channels == 3 else None,
output_layout=output_layout,
)

0 comments on commit d9c6c04

Please sign in to comment.