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
7 changes: 6 additions & 1 deletion backends/openvino/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def __init__(self):


class OpenvinoOperatorsSupport(OperatorSupportBase):
extended_support_dict = {
"torch.ops.dim_order_ops._clone_dim_order.default": None,
}

def __init__(
self,
Expand Down Expand Up @@ -77,7 +80,9 @@ def is_node_supported(self, _, node: torch.fx.Node) -> bool:
if node.name in self._enabled_ops_by_name:
return True

supported_ops = OperatorSupport(options)._support_dict
supported_ops = (
OperatorSupport(options)._support_dict | self.extended_support_dict
)
if op_type == "getitem":
return True

Expand Down
8 changes: 8 additions & 0 deletions backends/openvino/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import final, List

from executorch.backends.transforms.remove_clone_ops import RemoveCloneOpsTransform
from executorch.exir.backend.backend_details import (
BackendDetails,
ExportedProgram,
Expand Down Expand Up @@ -36,6 +37,13 @@ def preprocess(
Returns:
PreprocessResult: The result of preprocessing, including the compiled model bytes.
"""
# Apply RemoveCloneOpsTransform to eliminate unnecessary clone operations
transformed_ep = RemoveCloneOpsTransform()(edge_program.graph_module)

# Update the edge_program with the transformed graph
if transformed_ep and transformed_ep.graph_module:
edge_program._graph_module = transformed_ep.graph_module

input_names = edge_program.graph_signature.user_inputs
args = []
for node in edge_program.graph.nodes:
Expand Down
Loading