Skip to content

Commit

Permalink
#0: remove device from all maxpool calls in models
Browse files Browse the repository at this point in the history
  • Loading branch information
mywoodstock committed Oct 9, 2024
1 parent 07f6e14 commit 82ba7a5
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions models/demos/convnet_mnist/tt/convnet_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions models/demos/vgg/tt/ttnn_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions models/experimental/yolov4/ttnn/neck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/ttnn/sweep_tests/sweeps/sweeps/max_pool2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 82ba7a5

Please sign in to comment.