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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ option(EXECUTORCH_BUILD_MPS "Build the MPS backend" OFF)

option(EXECUTORCH_BUILD_NEURON "Build the backends/mediatek directory" OFF)

option(EXECUTORCH_BUILD_OPENVINO "Build the Openvino backend" ON)

option(EXECUTORCH_BUILD_PYBIND "Build the Python Bindings" OFF)

option(EXECUTORCH_BUILD_QNN "Build the Qualcomm backend" OFF)
Expand Down Expand Up @@ -621,6 +623,10 @@ if(EXECUTORCH_BUILD_NEURON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/mediatek)
endif()

if(EXECUTORCH_BUILD_OPENVINO)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/openvino)
endif()

if(EXECUTORCH_BUILD_QNN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/qualcomm)
endif()
Expand Down
4 changes: 2 additions & 2 deletions backends/openvino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ target_include_directories(

set(OPENVINO_LIB_PATH ${OPENVINO_DIR}/runtime/lib/intel64)
set(OPENVINO_LIBS
${OPENVINO_LIB_PATH}/libopenvino.so
${OPENVINO_LIB_PATH}/libopenvino_ir_frontend.so.2450
${OPENVINO_LIB_PATH}/libopenvino.so.2025.0.0
${OPENVINO_LIB_PATH}/libopenvino_ir_frontend.so.2025.0.0
${OPENVINO_LIB_PATH}/libopenvino_c.so
${OPENVINO_LIB_PATH}/libopenvino_intel_cpu_plugin.so
${OPENVINO_LIB_PATH}/libopenvino_intel_gpu_plugin.so
Expand Down
6 changes: 0 additions & 6 deletions backends/openvino/partitioner.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Copyright (c) 2024 MediaTek Inc.
#
# Licensed under the BSD License (the "License"); you may not use this file
# except in compliance with the License. See the license file in the root
# directory of this source tree for more details.

from typing import Callable, final, List, Optional, Tuple

import torch
Expand Down
13 changes: 6 additions & 7 deletions backends/openvino/preprocess.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Copyright (c) 2024 MediaTek Inc.
#
# Licensed under the BSD License (the "License"); you may not use this file
# except in compliance with the License. See the license file in the root
# directory of this source tree for more details.

import contextlib
import struct

Expand All @@ -28,6 +22,7 @@ class OpenvinoBackend(BackendDetails):
def preprocess(
cls, edge_program: ExportedProgram, module_compile_spec: List[CompileSpec]
) -> PreprocessResult:

name_to_node_mappings = {node.name: node for node in edge_program.graph.nodes}
input_names = edge_program.graph_signature.user_inputs
output_names = edge_program.graph_signature.user_outputs
Expand All @@ -39,7 +34,11 @@ def preprocess(
input_shapes = []
output_shapes = []

compiled = openvino_compile(edge_program.module(), *args)
compile_options = {}
for spec in module_compile_spec:
compile_options[spec.key] = spec.value.decode()

compiled = openvino_compile(edge_program.module(), *args, options=compile_options)
model_bytes = compiled.export_model()

return PreprocessResult(processed_bytes=model_bytes)
Loading