From 82ba7a562d552fdb1f0b750927e6b4d015df16d2 Mon Sep 17 00:00:00 2001 From: Abhinav Sarje Date: Wed, 9 Oct 2024 22:39:46 +0000 Subject: [PATCH] #0: remove device from all maxpool calls in models --- models/demos/convnet_mnist/tt/convnet_mnist.py | 2 -- .../tt/ttnn_functional_resnet50_large_new_conv_api.py | 2 -- .../ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py | 1 - .../tt/ttnn_functional_resnet50_xlarge_new_conv_api.py | 2 -- .../tt/ttnn_functional_resnet50_xlarge_new_conv_api_24.py | 2 -- .../tt/ttnn_functional_resnet50_xxlarge_new_conv_api.py | 2 -- models/demos/vgg/tt/ttnn_vgg.py | 3 +-- models/experimental/functional_unet/tt/unet_shallow_ttnn.py | 1 - models/experimental/yolov4/ttnn/neck.py | 3 --- tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py | 1 - 10 files changed, 1 insertion(+), 18 deletions(-) diff --git a/models/demos/convnet_mnist/tt/convnet_mnist.py b/models/demos/convnet_mnist/tt/convnet_mnist.py index a98d0db0ed02..a38aa60a770c 100644 --- a/models/demos/convnet_mnist/tt/convnet_mnist.py +++ b/models/demos/convnet_mnist/tt/convnet_mnist.py @@ -74,7 +74,6 @@ def convnet_mnist( stride=[1, 1], padding=[0, 0], dilation=[1, 1], - device=device, ) [x, out_height, out_width, weights_device, bias_device] = ttnn.conv2d( @@ -118,7 +117,6 @@ def convnet_mnist( stride=[1, 1], padding=[0, 0], dilation=[1, 1], - device=device, ) x = ttnn.from_device(x) x = ttnn.reshape(x, (x.shape[0], -1)) diff --git a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_large_new_conv_api.py b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_large_new_conv_api.py index f4249ff76771..dc3acd8a1142 100644 --- a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_large_new_conv_api.py +++ b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_large_new_conv_api.py @@ -560,7 +560,6 @@ def first_run(self, input_tensor, device, batch_size, ops_parallel_config) -> tt stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 128 @@ -867,7 +866,6 @@ def optimized_run(self, input_tensor, device, batch_size, ops_parallel_config, c stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 128 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 d8d09562b8a9..6dfb8df1e8ff 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 @@ -746,7 +746,6 @@ def run(self, input_tensor, device, ops_parallel_config, conv_op_cache={}) -> tt stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 56 diff --git a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api.py b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api.py index 3d366ea38c97..8cf40b334d24 100644 --- a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api.py +++ b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api.py @@ -557,7 +557,6 @@ def first_run(self, input_tensor, device, batch_size, ops_parallel_config) -> tt stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 224 @@ -861,7 +860,6 @@ def optimized_run(self, input_tensor, device, batch_size, ops_parallel_config, c stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 224 diff --git a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api_24.py b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api_24.py index cc87785ea9d4..f6afdd893ca9 100644 --- a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api_24.py +++ b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xlarge_new_conv_api_24.py @@ -559,7 +559,6 @@ def first_run(self, input_tensor, device, batch_size, ops_parallel_config) -> tt stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 224 @@ -891,7 +890,6 @@ def optimized_run(self, input_tensor, device, batch_size, ops_parallel_config, c stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 224 diff --git a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xxlarge_new_conv_api.py b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xxlarge_new_conv_api.py index 48049b4e2eb2..d4a6e9e6e9ab 100644 --- a/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xxlarge_new_conv_api.py +++ b/models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_xxlarge_new_conv_api.py @@ -631,7 +631,6 @@ def first_run(self, input_tensor, device, batch_size, ops_parallel_config) -> tt stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 256 @@ -965,7 +964,6 @@ def optimized_run(self, input_tensor, device, batch_size, ops_parallel_config, c stride=[2, 2], padding=[1, 1], dilation=[1, 1], - device=device, ) x_height = 256 diff --git a/models/demos/vgg/tt/ttnn_vgg.py b/models/demos/vgg/tt/ttnn_vgg.py index 24b785001987..142d82aa74ca 100644 --- a/models/demos/vgg/tt/ttnn_vgg.py +++ b/models/demos/vgg/tt/ttnn_vgg.py @@ -78,7 +78,6 @@ def ttnn_vgg16( stride=[2, 2], padding=[0, 0], dilation=[1, 1], - device=device, ) ttnn.deallocate(ttact_d) tt_x = ttnn.from_device(tt_x) @@ -206,7 +205,7 @@ def ttnn_vgg11( stride=[2, 2], padding=[0, 0], dilation=[1, 1], - device=device, + devie=device, ) tt_x = ttnn.from_device(tt_x) ttnn.deallocate(ttact_d) diff --git a/models/experimental/functional_unet/tt/unet_shallow_ttnn.py b/models/experimental/functional_unet/tt/unet_shallow_ttnn.py index 080f02e52c33..8f672f6d2596 100644 --- a/models/experimental/functional_unet/tt/unet_shallow_ttnn.py +++ b/models/experimental/functional_unet/tt/unet_shallow_ttnn.py @@ -232,7 +232,6 @@ def __call__(self, x): stride=[self.pool.stride, self.pool.stride], padding=[self.pool.padding, self.pool.padding], dilation=[self.pool.dilation, self.pool.dilation], - device=self.device, ) return x diff --git a/models/experimental/yolov4/ttnn/neck.py b/models/experimental/yolov4/ttnn/neck.py index 617ec7adea52..a4e2e9b2e986 100644 --- a/models/experimental/yolov4/ttnn/neck.py +++ b/models/experimental/yolov4/ttnn/neck.py @@ -191,7 +191,6 @@ def __call__(self, device, input_tensor): stride=[1, 1], padding=[2, 2], dilation=[1, 1], - device=device, ) pool_2 = ttnn.max_pool2d( input_tensor=output_tensor, @@ -203,7 +202,6 @@ def __call__(self, device, input_tensor): stride=[1, 1], padding=[4, 4], dilation=[1, 1], - device=device, ) pool_3 = ttnn.max_pool2d( input_tensor=output_tensor, @@ -215,7 +213,6 @@ def __call__(self, device, input_tensor): stride=[1, 1], padding=[6, 6], dilation=[1, 1], - device=device, ) pool_1 = ttnn.sharded_to_interleaved(pool_1, ttnn.L1_MEMORY_CONFIG) diff --git a/tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py b/tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py index 3eabe78c3b37..321171242663 100644 --- a/tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py +++ b/tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py @@ -95,7 +95,6 @@ def run( stride=[stride_h, stride_w], padding=[pad_h, pad_w], dilation=[dilation_h, dilation_w], - device=device, ) out_padded = out_d.cpu() out_pytorch_padded = ttnn.to_torch(out_padded)