From 30dea3010d78c29c467dea32a5cd5531d697381b Mon Sep 17 00:00:00 2001 From: ppopovic Date: Fri, 17 Jan 2025 17:30:11 +0000 Subject: [PATCH] #16895: Use working version of act_block_h_override for first conv in resnet. Also, fix PCC check in the demo, as it was not picking up correct values for wormhole --- models/demos/ttnn_resnet/tests/resnet50_test_infra.py | 7 ++++--- .../tt/ttnn_functional_resnet50_new_conv_api.py | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/models/demos/ttnn_resnet/tests/resnet50_test_infra.py b/models/demos/ttnn_resnet/tests/resnet50_test_infra.py index 7c6e113da91..0d7795b9c5e 100644 --- a/models/demos/ttnn_resnet/tests/resnet50_test_infra.py +++ b/models/demos/ttnn_resnet/tests/resnet50_test_infra.py @@ -7,6 +7,7 @@ import pytest import torch import torchvision +import copy import ttnn from ttnn.model_preprocessing import ( @@ -39,7 +40,7 @@ def load_resnet50_model(model_location_generator): ## copied from ttlib version test: # golden pcc is ordered fidelity, weight dtype, activation dtype -golden_pcc = { +golden_pcc_obj = { 8: { ( ttnn.MathFidelity.HiFi4, @@ -142,8 +143,8 @@ def load_resnet50_model(model_location_generator): } golden_pcc = { - ttnn.device.Arch.WORMHOLE_B0: golden_pcc, - ttnn.device.Arch.GRAYSKULL: golden_pcc, + ttnn.device.Arch.WORMHOLE_B0: copy.deepcopy(golden_pcc_obj), + ttnn.device.Arch.GRAYSKULL: copy.deepcopy(golden_pcc_obj), } golden_pcc[ttnn.device.Arch.GRAYSKULL][16][ diff --git a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py index 688f25a9957..790a9eb5c5b 100644 --- a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py +++ b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py @@ -610,7 +610,9 @@ def __init__( if type(device) == ttnn.MeshDevice and device.get_num_devices() > 8: self.conv1_config.act_block_h_override = 64 else: - self.conv1_config.act_block_h_override = 49 * 32 + # Todo: restore after issue #16895 is fixed + # self.conv1_config.act_block_h_override = 49 * 32 + self.conv1_config.act_block_h_override = 2 * 32 self.conv1_kernel_size = (4, 4) self.conv1_stride = (1, 1)