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
20 changes: 9 additions & 11 deletions .ci/scripts/setup-openvino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .ci/scripts/test_openvino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,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
Expand Down
8 changes: 7 additions & 1 deletion backends/openvino/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions backends/openvino/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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:
Expand Down
Loading