From 4994d1848a4ded9d43f546d70da49e89bfeed879 Mon Sep 17 00:00:00 2001 From: Austin Ho Date: Fri, 20 Sep 2024 18:21:18 +0000 Subject: [PATCH] #0: Fix mesh_device grid specification for tgg resnet tests after #12479 was merged --- models/demos/tgg/resnet50/tests/test_perf_e2e_resnet50.py | 4 ++-- models/demos/tgg/resnet50/tests/test_resnet50_performant.py | 4 ++-- .../demos/ttnn_resnet/tests/multi_device/perf_e2e_resnet50.py | 4 +++- models/demos/ttnn_resnet/tests/perf_e2e_resnet50.py | 4 +++- tests/ttnn/unit_tests/test_multi_device_trace_tgg.py | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/models/demos/tgg/resnet50/tests/test_perf_e2e_resnet50.py b/models/demos/tgg/resnet50/tests/test_perf_e2e_resnet50.py index 088a6a6b565..3c1d3f31497 100644 --- a/models/demos/tgg/resnet50/tests/test_perf_e2e_resnet50.py +++ b/models/demos/tgg/resnet50/tests/test_perf_e2e_resnet50.py @@ -18,7 +18,7 @@ ) @pytest.mark.parametrize( "mesh_device", - ((16, 4),), + ((8, 8),), indirect=True, ) def test_perf( @@ -53,7 +53,7 @@ def test_perf( ) @pytest.mark.parametrize( "mesh_device", - ((16, 4),), + ((8, 8),), indirect=True, ) def test_perf_trace( diff --git a/models/demos/tgg/resnet50/tests/test_resnet50_performant.py b/models/demos/tgg/resnet50/tests/test_resnet50_performant.py index dcc27fcdbbe..af1ea1eb802 100644 --- a/models/demos/tgg/resnet50/tests/test_resnet50_performant.py +++ b/models/demos/tgg/resnet50/tests/test_resnet50_performant.py @@ -24,7 +24,7 @@ @pytest.mark.parametrize("enable_async_mode", [True], indirect=True) @pytest.mark.parametrize( "mesh_device", - ((16, 4),), + ((8, 8),), indirect=True, ) def test_run_resnet50_inference( @@ -56,7 +56,7 @@ def test_run_resnet50_inference( @pytest.mark.parametrize("enable_async_mode", [True], indirect=True) @pytest.mark.parametrize( "mesh_device", - ((16, 4),), + ((8, 8),), indirect=True, ) def test_run_resnet50_trace_inference( diff --git a/models/demos/ttnn_resnet/tests/multi_device/perf_e2e_resnet50.py b/models/demos/ttnn_resnet/tests/multi_device/perf_e2e_resnet50.py index 4b38be20800..9a07bb45bd5 100644 --- a/models/demos/ttnn_resnet/tests/multi_device/perf_e2e_resnet50.py +++ b/models/demos/ttnn_resnet/tests/multi_device/perf_e2e_resnet50.py @@ -457,5 +457,7 @@ def run_perf_resnet( inference_time_cpu=cpu_time, ) - logger.info(f"{model_name} {comments} inference time (avg): {inference_time_avg}") + logger.info( + f"{model_name} {comments} inference time (avg): {inference_time_avg}, FPS: {batch_size/inference_time_avg}" + ) logger.info(f"{model_name} compile time: {compile_time}") diff --git a/models/demos/ttnn_resnet/tests/perf_e2e_resnet50.py b/models/demos/ttnn_resnet/tests/perf_e2e_resnet50.py index aefdabaf4d6..88ddfe96cf3 100644 --- a/models/demos/ttnn_resnet/tests/perf_e2e_resnet50.py +++ b/models/demos/ttnn_resnet/tests/perf_e2e_resnet50.py @@ -372,5 +372,7 @@ def run_perf_resnet( inference_time_cpu=cpu_time, ) - logger.info(f"{model_name} {comments} inference time (avg): {inference_time_avg}") + logger.info( + f"{model_name} {comments} inference time (avg): {inference_time_avg}, FPS: {batch_size/inference_time_avg}" + ) logger.info(f"{model_name} compile time: {compile_time}") diff --git a/tests/ttnn/unit_tests/test_multi_device_trace_tgg.py b/tests/ttnn/unit_tests/test_multi_device_trace_tgg.py index 3ad1678c6e0..3b269a49121 100644 --- a/tests/ttnn/unit_tests/test_multi_device_trace_tgg.py +++ b/tests/ttnn/unit_tests/test_multi_device_trace_tgg.py @@ -18,7 +18,7 @@ @pytest.mark.parametrize( "shape", [(1, 1, 512, 512), (1, 1, 32, 32), (1, 3, 32, 32), (1, 1, 256, 256), (1, 3, 512, 512), (1, 3, 128, 128)] ) -@pytest.mark.parametrize("mesh_device", [pytest.param((16, 4), id="16x4_grid")], indirect=True) +@pytest.mark.parametrize("mesh_device", [pytest.param((8, 8), id="8x8_grid")], indirect=True) @pytest.mark.parametrize("enable_async", [True]) @pytest.mark.parametrize("enable_multi_cq", [False]) # To be toggled when Galaxy supports Multi-CQ @pytest.mark.parametrize("device_params", [{"trace_region_size": 60000}], indirect=True) @@ -119,7 +119,7 @@ def event_sync(event, record_cq, wait_cq): "shape", [(1, 1, 256, 256), (1, 1, 512, 512), (1, 1, 32, 32), (1, 3, 32, 32)], ) -@pytest.mark.parametrize("mesh_device", [pytest.param((16, 4), id="16x4_grid")], indirect=True) +@pytest.mark.parametrize("mesh_device", [pytest.param((8, 8), id="8x8_grid")], indirect=True) @pytest.mark.parametrize("enable_async", [True]) @pytest.mark.parametrize("enable_multi_cq", [False]) # To be toggled when Galaxy supports Multi-CQ @pytest.mark.parametrize("device_params", [{"trace_region_size": 200000}], indirect=True)