From df05f80adb09473c3c7ad02d6f80da3874d6f2e9 Mon Sep 17 00:00:00 2001 From: Vivek Trivedi <5340687+trivedivivek@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:43:09 -0700 Subject: [PATCH] [ET-VK] Adding more pointwise convolution tests. Pull Request resolved: https://github.com/pytorch/executorch/pull/11358 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. ghstack-source-id: 288568638 @exported-using-ghexport Differential Revision: [D75961457](https://our.internmc.facebook.com/intern/diff/D75961457/) --- backends/vulkan/test/op_tests/cases.py | 170 +++++++++++++++++++++---- 1 file changed, 146 insertions(+), 24 deletions(-) diff --git a/backends/vulkan/test/op_tests/cases.py b/backends/vulkan/test/op_tests/cases.py index feac3ab42ec..277daa60451 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,152 @@ 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")