Skip to content

Commit 9661eac

Browse files
committed
[ET-VK] Add CUNET model test
CUNET uses 3 operators: ``` aten.convolution.default aten.max_pool2d_with_indices.default aten.relu.default ``` which correspond to these signatures: ``` - func: convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, SymInt[] padding, int[] dilation, bool transposed, SymInt[] output_padding, int groups) -> Tensor - func: max_pool2d_with_indices(Tensor self, int[2] kernel_size, int[2] stride=[], int[2] padding=0, int[2] dilation=1, bool ceil_mode=False) -> (Tensor, Tensor) - func: relu(Tensor self) -> Tensor ``` Differential Revision: [D54700658](https://our.internmc.facebook.com/intern/diff/D54700658/) ghstack-source-id: 221534993 Pull Request resolved: #2889
1 parent c38f563 commit 9661eac

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

backends/vulkan/test/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ python_unittest(
2020
"//executorch/extension/pybindings:portable_lib", # @manual
2121
"//executorch/extension/pytree:pylib",
2222
"//executorch/kernels/portable:custom_ops_generated_lib",
23+
"//wearables/camera/ml/model_experimentation/person_segmentation/cunet:cunet_lib",
2324
],
2425
)
2526

backends/vulkan/test/test_vulkan_delegate.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
from executorch.exir import EdgeProgramManager, to_edge
1919
from torch.export import Dim, export, ExportedProgram
20+
from wearables.camera.ml.model_experimentation.person_segmentation.cunet.cunet import (
21+
C_UNet,
22+
)
2023

2124
ctypes.CDLL("libvulkan.so.1")
2225

@@ -628,3 +631,13 @@ def forward(self, x):
628631
sample_inputs,
629632
memory_layouts=[vk_graph_schema.VkMemoryLayout.TENSOR_CHANNELS_PACKED],
630633
)
634+
635+
def test_vulkan_backend_cunet(self):
636+
module = C_UNet()
637+
sample_inputs = (torch.rand((1, 3, 96, 72), dtype=torch.float32),)
638+
639+
self.lower_module_and_test_output(
640+
module,
641+
sample_inputs,
642+
memory_layouts=[vk_graph_schema.VkMemoryLayout.TENSOR_CHANNELS_PACKED],
643+
)

0 commit comments

Comments
 (0)