Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions backends/vulkan/op_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,25 +1233,11 @@ def register_embedding():

@update_features(exir_ops.edge.aten._native_batch_norm_legit_no_training.default)
def register_native_batch_norm_legit_no_training():
def check_batch_norm_node(node: torch.fx.Node) -> bool:
x = node.args[0]
if not isinstance(x, torch.fx.Node):
return False
x_val = x.meta.get("val", None)
if x_val is None:
return False
x_shape = x_val.size()
# Only support 4-D input tensors since this is a restriction enforced by the
# operator implementation.
# TODO(ssjia): Add shape agnostic support for batch norm
return len(x_shape) == 4

return OpFeatures(
inputs_storage=utils.CHANNELS_PACKED_TEXTURE,
inputs_dtypes=utils.FP_T,
supports_prepacking=True,
supports_resize=True,
are_node_inputs_supported_fn=check_batch_norm_node,
)


Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/vulkan_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ def preprocess( # noqa: C901
program = apply_passes(
program,
[
AddmmToLinearTransform(),
FuseBatchNormPass(program),
FusePatternsPass(),
FuseClampPass(),
AddmmToLinearTransform(),
RemoveRedundantOpsTransform(),
FuseQuantizedOpsTransform(),
FoldQDQPass(),
Expand Down
Loading