diff --git a/backends/vulkan/_passes/remove_redundant_ops.py b/backends/vulkan/_passes/remove_redundant_ops.py index b95733021fc..545a25f69e9 100644 --- a/backends/vulkan/_passes/remove_redundant_ops.py +++ b/backends/vulkan/_passes/remove_redundant_ops.py @@ -28,6 +28,8 @@ class RemoveRedundantOpsTransform(ExportPass): exir_ops.edge.aten.clone.default, torch.ops.aten.alias.default, exir_ops.edge.aten.alias.default, + torch.ops.aten.alias_copy.default, + exir_ops.edge.aten.alias_copy.default, exir_ops.edge.aten.lift_fresh_copy.default, exir_ops.edge.dim_order_ops._to_dim_order_copy.default, exir_ops.edge.dim_order_ops._clone_dim_order.default, diff --git a/backends/vulkan/op_registry.py b/backends/vulkan/op_registry.py index f9881f637d3..ddb843e2335 100644 --- a/backends/vulkan/op_registry.py +++ b/backends/vulkan/op_registry.py @@ -1125,6 +1125,20 @@ def register_clone_dim_order(): ) +# alias_copy is a no-op identity operation (same as clone/alias). It is removed +# by RemoveRedundantOpsTransform during preprocess, so the C++ runtime never sees +# it. Registering it here ensures the partitioner delegates it to Vulkan rather +# than creating partition boundaries that break the graph. +@update_features(exir_ops.edge.aten.alias_copy.default) +def register_alias_copy(): + return OpFeatures( + inputs_storage=utils.ANY_STORAGE, + inputs_dtypes=utils.FP_INT_BOOL_T, + supports_resize=True, + supports_highdim=True, + ) + + # ============================================================================= # Gather.cpp # =============================================================================