Skip to content

Commit 449035d

Browse files
author
ssjia
committed
Update on "[ET-VK] Miscellaneous fixes"
Collecting fixes for various models/ops in this diff/PR. They have all been squashed into this single change to make it easier to cherry pick. # Fixes ## Wav2Letter Type: Output correctness failure This is caused by a bug in swiftshader, and not reproducible on any other platform. Specifically, the issue is in the softmax shader; the exact cause of the issue is unknown, but it is related to using shared memory within shaders. The workaround for this issue is to use separate shared memory arrays for the shared max and shared sum. ## ConvNeXT Type: Exception during runtime This is caused by an incompatible memory layout being used for mean2d. More technically, the packed dimension of the tensor cannot be one of the dims being reduced. The current operator registry system did not have a way to select valid tensor representations based on the actual arguments of an op. To fix, we have to introduce a mechanism for ops to specify valid representations once a node's arguments are known. Once the model is exported with supported memory layout, the model test passes. ## Inception_V3/ViT Type: Exception during runtime The root cause of this was an interaction betwen the fuse batch norm pass and how `vulkan_preprocess.py` was applying passes. Essentially, the fuse batch norm pass creates a new param node for the fused weight, but after the pass is applied `_copy_module` is used to copy the transformed graph back into the ExportedProgram. However, it seems that _copy_module lowercases the node names without updating the exported program's graph signature. Therefore, subsequent passes couldn't recognize the weight tensor of convolution tensors as a constant/parameter node. The solution was to migrate vulkan_preprocess.py to use the _transform() API instead of using _copy_module. ## DenseNet 161 (w/ dynamic shapes) Type: Output Mismatch Cause: the native_batch_norm op doesn't support dynamic shapes. However, the backend test runner doesn't set the correct compile option to filter ops without dynamic shape support. Differential Revision: [D83703496](https://our.internmc.facebook.com/intern/diff/D83703496/) [ghstack-poisoned]
2 parents 9172821 + f0480bb commit 449035d

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

backends/vulkan/test/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ python_unittest(
3434
deps = [
3535
"//caffe2:torch",
3636
"//executorch/backends/vulkan/_passes:vulkan_passes",
37-
"//executorch/backends/vulkan/quantizer:vulkan_quantizer",
3837
"//executorch/backends/vulkan:vulkan_preprocess",
3938
"//pytorch/ao:torchao", # @manual
4039
]

backends/vulkan/test/test_vulkan_passes.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@
33

44
import torch
55

6-
from executorch.backends.transforms.addmm_mm_to_linear import AddmmToLinearTransform
7-
from executorch.backends.vulkan._passes import FuseQuantizedOpsTransform
86
from executorch.backends.vulkan._passes.fuse_patterns import FusePatternsPass
97

10-
from executorch.backends.vulkan.quantizer.vulkan_quantizer import (
11-
get_symmetric_quantization_config,
12-
VulkanQuantizer,
13-
)
14-
158
from executorch.exir import EdgeCompileConfig, EdgeProgramManager, to_edge
169

1710
from executorch.exir.backend.canonical_partitioners.config_partitioner import (

0 commit comments

Comments
 (0)