From c5cae7614aa4ffbcc16329056b7f8da6a104f768 Mon Sep 17 00:00:00 2001 From: Vivek Trivedi <5340687+trivedivivek@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:46:12 -0700 Subject: [PATCH] [ET-VK] Adding more pointwise convolution tests. This diff adds new test cases for pointwise convolution in the Vulkan backend of Executorch. The updated test cases cover different configurations of convolution layers, including kernel size, padding, stride, and groups. Differential Revision: [D75961457](https://our.internmc.facebook.com/intern/diff/D75961457/) [ghstack-poisoned] --- backends/vulkan/test/op_tests/cases.py | 171 +++++++++++++++++++++---- 1 file changed, 147 insertions(+), 24 deletions(-) diff --git a/backends/vulkan/test/op_tests/cases.py b/backends/vulkan/test/op_tests/cases.py index 4692a84a4c..7a4dab7e6d 100644 --- a/backends/vulkan/test/op_tests/cases.py +++ b/backends/vulkan/test/op_tests/cases.py @@ -255,7 +255,7 @@ def get_conv_inputs(): [9, 0], 1, ) - test_cases = [] + test_cases = [ Test( self=(1, 6, 40, 50), @@ -290,17 +290,6 @@ def get_conv_inputs(): output_padding=[0, 0], groups=8, ), - Test( - self=(1, 8, 72, 96), - weight=(8, 8, 1, 1), - bias=(8,), - stride=[1, 1], - padding=[1, 1], - dilation=[1, 1], - transposed=False, - output_padding=[0, 0], - groups=1, - ), Test( self=(1, 6, 40, 50), weight=(8, 6, 3, 3), @@ -356,17 +345,6 @@ def get_conv_inputs(): output_padding=[0], groups=5, ), - Test( - self=(1, 16, 672, 512), - weight=(64, 16, 1, 1), - bias=(64,), - stride=[1, 1], - padding=[0, 0], - dilation=[1, 1], - transposed=False, - output_padding=[0, 0], - groups=1, - ), Test( self=(1, 4, 234, 234), weight=(4, 1, 3, 3), @@ -413,8 +391,153 @@ def get_conv_inputs(): ), ] + test_cases_pw = [ + Test( + self=(1, 16, 3, 5), + weight=(4, 16, 1, 1), + bias=(4,), + stride=[1, 1], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 5, 3, 5), + weight=(4, 5, 1, 1), + bias=(4,), + stride=[1, 1], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 5, 3, 5), + weight=(3, 5, 1, 1), + bias=(3,), + stride=[1, 1], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 5, 3, 5), + weight=(3, 5, 1, 1), + bias=(3,), + stride=[1, 1], + padding=[1, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 5, 3, 5), + weight=(3, 5, 1, 1), + bias=(3,), + stride=[1, 1], + padding=[0, 1], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 5, 3, 5), + weight=(3, 5, 1, 1), + bias=(3,), + stride=[2, 1], + padding=[1, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 8, 72, 96), + weight=(8, 8, 1, 1), + bias=(8,), + stride=[1, 1], + padding=[1, 1], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 16, 240, 320), + weight=(64, 16, 1, 1), + bias=(64,), + stride=[1, 1], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 16, 240, 320), + weight=(64, 16, 1, 1), + bias=(64,), + stride=[2, 2], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 16, 240, 320), + weight=(64, 16, 1, 1), + bias=(64,), + stride=[4, 4], + padding=[1, 1], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 16, 240, 320), + weight=(64, 16, 1, 1), + bias=(64,), + stride=[1, 1], + padding=[4, 4], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + Test( + self=(1, 16, 672, 512), + weight=(64, 16, 1, 1), + bias=(64,), + stride=[1, 1], + padding=[0, 0], + dilation=[1, 1], + transposed=False, + output_padding=[0, 0], + groups=1, + ), + ] + test_suite = VkTestSuite(test_cases) - return test_suite + test_suite.layouts = [ + "utils::kChannelsPacked", + ] + + test_suite_pw = VkTestSuite(test_cases_pw) + test_suite_pw.layouts = [ + "utils::kChannelsPacked", + ] + test_suite_pw.test_name_suffix = "pw" + + return [test_suite, test_suite_pw] @register_test_suite("aten.native_layer_norm.default")