From 9c9943e33c36266544f498f166ce1f7736a6137d Mon Sep 17 00:00:00 2001 From: suryasidd Date: Fri, 3 Oct 2025 11:57:39 -0700 Subject: [PATCH 1/3] Fix OpenVINO CI --- .ci/scripts/setup-openvino.sh | 20 +++++++++----------- .github/workflows/pull.yml | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.ci/scripts/setup-openvino.sh b/.ci/scripts/setup-openvino.sh index ff667619125..587494f46ac 100755 --- a/.ci/scripts/setup-openvino.sh +++ b/.ci/scripts/setup-openvino.sh @@ -10,19 +10,17 @@ set -ex # shellcheck source=/dev/null source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" -git clone https://github.com/openvinotoolkit/openvino.git -cd openvino && git checkout releases/2025/1 -git submodule update --init --recursive -sudo ./install_build_dependencies.sh -mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON -make -j$(nproc) +# Download and install OpenVINO from release packages +OPENVINO_VERSION="2025.3" +OPENVINO_BUILD="2025.3.0.19807.44526285f24" +OPENVINO_URL="https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_VERSION}/linux/openvino_toolkit_ubuntu22_${OPENVINO_BUILD}_x86_64.tgz" -cd .. -cmake --install build --prefix dist +curl -Lo /tmp/openvino_toolkit.tgz --retry 3 --fail ${OPENVINO_URL} +tar -xzf /tmp/openvino_toolkit.tgz +mv openvino_toolkit_ubuntu22_${OPENVINO_BUILD}_x86_64 openvino -source dist/setupvars.sh -cd ../backends/openvino +source openvino/setupvars.sh +cd backends/openvino pip install -r requirements.txt cd scripts ./openvino_build.sh --enable_python diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index c15fadd102f..93b811bf700 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -787,7 +787,6 @@ jobs: contents: read strategy: fail-fast: false - if: false # TODO Re-enable after fixing timeouts (#14314) with: runner: linux.2xlarge docker-image: ci-image:executorch-ubuntu-22.04-gcc9 From e32063c6710d539bf6b42545e766a3be25ee7e52 Mon Sep 17 00:00:00 2001 From: suryasidd Date: Fri, 3 Oct 2025 12:18:56 -0700 Subject: [PATCH 2/3] Fixed paths in openvino tests --- .ci/scripts/test_openvino.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_openvino.sh b/.ci/scripts/test_openvino.sh index 85884a6475b..2bb2115b1ec 100755 --- a/.ci/scripts/test_openvino.sh +++ b/.ci/scripts/test_openvino.sh @@ -10,7 +10,7 @@ set -ex # shellcheck source=/dev/null source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" -source openvino/dist/setupvars.sh +source openvino/setupvars.sh cd backends/openvino/tests python test_runner.py --test_type ops python test_runner.py --test_type models From 431dd829d2c3fb6a9b3e83d55359fa21f12d868d Mon Sep 17 00:00:00 2001 From: suryasidd Date: Fri, 3 Oct 2025 13:13:07 -0700 Subject: [PATCH 3/3] Fixed dim order issues --- backends/openvino/partitioner.py | 8 +++++++- backends/openvino/preprocess.py | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/backends/openvino/partitioner.py b/backends/openvino/partitioner.py index bc3fde573e2..4975dc657c6 100644 --- a/backends/openvino/partitioner.py +++ b/backends/openvino/partitioner.py @@ -27,6 +27,10 @@ class OpenvinoOperatorsSupport(OperatorSupportBase): + extended_support_dict = { + "torch.ops.dim_order_ops._clone_dim_order.default": None, + "torch.ops.dim_order_ops._to_dim_order_copy.default": None, + } def __init__( self, @@ -62,7 +66,9 @@ def is_node_supported(self, _, node: torch.fx.Node) -> bool: op_type = node.target.__name__ else: op_type = str(node.target) - supported_ops = OperatorSupport(options)._support_dict + supported_ops = ( + OperatorSupport(options)._support_dict | self.extended_support_dict + ) if op_type == "getitem": return True diff --git a/backends/openvino/preprocess.py b/backends/openvino/preprocess.py index c343f44a8b5..691115f6579 100644 --- a/backends/openvino/preprocess.py +++ b/backends/openvino/preprocess.py @@ -14,6 +14,8 @@ PreprocessResult, ) from executorch.exir.backend.compile_spec_schema import CompileSpec + +from executorch.exir.passes.memory_format_ops_pass import DimOrderOpsRevertPass from openvino.frontend.pytorch.torchdynamo.compile import ( # type: ignore[import-untyped] openvino_compile, ) @@ -36,6 +38,12 @@ def preprocess( Returns: PreprocessResult: The result of preprocessing, including the compiled model bytes. """ + transformed_ep = DimOrderOpsRevertPass()(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: