-
Notifications
You must be signed in to change notification settings - Fork 607
Openvino backend for Executorch to enable inference on Intel CPUs, GPUs, NPUs #8573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
254 commits
Select commit
Hold shift + click to select a range
86f685e
Fixed library path errors in cmake
ynimmaga bb12f60
Configure device with compile spec
ynimmaga c9c8967
Added aot compiler script for openvino
ynimmaga f5bd832
Temporary build instructions
ynimmaga f3dc62c
Added standalone build script for openvino backend
ynimmaga eec7831
Merge branch 'openvino_backend' of https://github.com/ynimmaga/execut…
ynimmaga ca852de
Handling multiple inputs/outputs with zero-copy
cavusmustafa bdddb16
Merge branch 'pytorch:main' into openvino_backend
ynimmaga 9803bd8
Merge branch 'pytorch:main' into openvino_backend
ynimmaga b1f38f8
Merge branch 'pytorch:main' into openvino_backend
ynimmaga 7c43014
Merge pull request #5 from cavusmustafa/zero_copy_output
ynimmaga 0703814
Added fallback with portable kernels
ynimmaga 0a769be
Added openvino_functions.yaml containing only unsupported ops
ynimmaga 0e6707d
Updated the unsupported ops for fallback
ynimmaga 68a1cd4
Removed redundant example for openvino backend
ynimmaga 4d1b4eb
Reconfigured openvino backend functions
ynimmaga 5c55a56
Updated openvino backend cmake file
ynimmaga 3c6d123
Merge pull request #6 from ynimmaga/portable_kernels
ynimmaga 29d8400
Added arguments for model path and num iters to openvino example
ynimmaga 379937e
Merge pull request #8 from ynimmaga/portable_kernels
cavusmustafa 5806788
Initial unit tests for OpenVINO backend
cavusmustafa 916ba64
Unit test update and cleanup
cavusmustafa e0b1bb7
Input/Output processing for example and unit tests
cavusmustafa 9108770
Added executorch parameter to openvino_compile call
cavusmustafa ecbe5e2
New op unit tests added
cavusmustafa d563e4c
Merge pull request #7 from cavusmustafa/openvino_backend_unit_tests
ynimmaga a4d7458
Added license headers to the openvino files
ynimmaga 197cdc2
Merge branch 'pytorch:main' into openvino_backend
ynimmaga 268255b
Merge pull request #9 from ynimmaga/doc_changes
ynimmaga 8302911
Get openvino backend device from compile specs
ynimmaga 2cda72b
Fixed formatting issues
ynimmaga f7dc3e3
Fixed formatting issues
ynimmaga 4324809
Merge branch 'openvino_backend' into portable_kernels
ynimmaga d9d35e2
Merge branch 'pytorch:main' into openvino_backend
ynimmaga c5ca5c4
Openvino backend model tests added
cavusmustafa 54fac03
removed executorch option into openvino_compile
cavusmustafa 8a5abed
cmake updates for openvino
ynimmaga 415a3ec
Merge pull request #12 from cavusmustafa/model_tests
ynimmaga 2424c72
Added ReadMe for openvino backend
ynimmaga 7f877d4
Merge branch 'pytorch:main' into openvino_backend
ynimmaga 11218a3
Update README.md for openvino backend
ynimmaga f7e03c5
Added directory structure for openvino backend in ReadMe
ynimmaga b49e439
Minor updates for README.md
ynimmaga d122f51
Created README.md for examples
ynimmaga aad2ac7
delete old Readme file for openvino examples
ynimmaga 050259b
Added OpenVINO tutorial in docs
ynimmaga 81460f3
Updated cmake and build scripts to link against gflags
ynimmaga 7139bac
Update backends/openvino/README.md
ynimmaga 58152a2
remove enable_wheel from openvino build instructions
ynimmaga c979f52
Merge pull request #13 from ynimmaga/cmake_updates
ynimmaga 541e44d
Update backends/openvino/README.md
ynimmaga 9968178
Updated executorch environment setup in README.md
ynimmaga 32e7cc7
Update environment setup in build-run-openvino.md
ynimmaga 26f05f5
Merge pull request #14 from ynimmaga/doc_changes
ynimmaga 09a4ffb
Added OpenVINO in the main README.md
ynimmaga 5d2784d
added init integration of quantization
alexsu52 61488d5
deit3_small_patch16_224_in21ft1k
daniil-lyakhov 42155a1
Resnet-like model checked
daniil-lyakhov 7c66314
WIP
daniil-lyakhov c1fa9e2
Formating
daniil-lyakhov e2415af
openvino_executor_runner.cpp can run on several inputs
daniil-lyakhov 8cbb117
Validate option / minor
daniil-lyakhov 4b60fb4
Input shape from the input dataset
daniil-lyakhov e0cd644
--batch_size
daniil-lyakhov 2a04ee6
Adapt subset size to keep +- 300 pics for calibration
daniil-lyakhov db7dc13
Apply suggestions from code review
daniil-lyakhov de3f50b
Comments
daniil-lyakhov 17fe62f
OpenVINOQuantizer: constructor arguments have been refined
daniil-lyakhov c7e0758
set_ignored_scope | readme updates
daniil-lyakhov 70a3b2a
Use to_edge_transform_and_lower in aot_openvino_compiler
cavusmustafa 5ea37c7
Fix input tensor file reading bug
cavusmustafa 6beadb3
Update unit tests
cavusmustafa 4dbe444
Update build-run-openvino.md
ynimmaga 0c07b70
temp changes for debugging
cavusmustafa b086202
Initial document for openvino backend tests
cavusmustafa cb91596
Update openvino backend test documentation
cavusmustafa d756727
Update README.md
cavusmustafa 09b2dbd
Removed debugging lines
cavusmustafa 4953033
Removed comment which was added for debugging
cavusmustafa 19cbc69
openvino_executor_runner.cpp: comments
daniil-lyakhov 0892b9d
Apply suggestions from code review
daniil-lyakhov d1aa425
aot_openvino_compiler.py: comments
daniil-lyakhov b9b604d
README
daniil-lyakhov 9d07bbb
Merge pull request #15 from daniil-lyakhov/dl/openvino/model_enabling
cavusmustafa 2e6707d
Merge branch 'openvino_backend' into test_readme_and_example_updates
cavusmustafa 1a20242
Merge pull request #16 from cavusmustafa/test_readme_and_example_updates
cavusmustafa a980099
Fix for input file path bug
cavusmustafa e9bac9a
Merge branch 'openvino_backend' into portable_kernels
cavusmustafa 209132b
Test script name change
cavusmustafa 4a27c36
Update README.md
cavusmustafa 3a8c033
Merge pull request #11 from ynimmaga/portable_kernels
cavusmustafa 0a981a6
Code formatting
cavusmustafa 68a2043
Merge pull request #17 from cavusmustafa/code_formatting
cavusmustafa 6b13915
Merge branch 'pytorch:main' into openvino_backend
ynimmaga ae661a1
Fix for input path bug in validation
cavusmustafa 9de858e
Code formatting
cavusmustafa 88f4823
Disable openvino build by default
cavusmustafa 44b8979
Update build-run-openvino.md
cavusmustafa b7d302e
Update build-run-openvino.md
cavusmustafa d3daf53
Update build-run-openvino.md
cavusmustafa 685ceb1
Enabled logging for example
cavusmustafa f1db517
Update openvino commit id
cavusmustafa c159421
Update README.md
cavusmustafa f4d2ce3
Added function comments with inputs and outputs
ynimmaga 6c96e78
Merge pull request #20 from ynimmaga/function_updates
cavusmustafa 8959283
Merge branch 'openvino_backend' into input_validate_fix
cavusmustafa e7da0cd
Merge pull request #18 from cavusmustafa/input_validate_fix
cavusmustafa 1a74ed9
nncf requirement syntax updated
cavusmustafa 2baa316
Update README.md
cavusmustafa cbdfc67
Merge pull request #21 from cavusmustafa/requirements_fix_nncf
ynimmaga 4b55597
Build updates for openvino backend
cavusmustafa 1a928d1
Removed executorch_srcs.cmake file
cavusmustafa cbd0671
Update backends/openvino/CMakeLists.txt
cavusmustafa 8ae15e2
Update backends/openvino/CMakeLists.txt
cavusmustafa 0627e44
Merge pull request #22 from cavusmustafa/build_updates
ynimmaga 514d4c0
Logging added for building openvino backend
cavusmustafa e6de60e
Merge pull request #23 from cavusmustafa/build_logging
ynimmaga a28fcf3
Update examples/openvino/aot/README.md
cavusmustafa fa8feac
Comments
daniil-lyakhov bb51412
renamed OpenvinoBackend.h to OpenvinoBackend.hpp
cavusmustafa 935e937
Removed using blanket namespaces
cavusmustafa 83d1946
Fix the path for aot readme file
cavusmustafa e854ee0
Fix the path into aot folder
cavusmustafa 0a18afd
Free processed data after compiling model
cavusmustafa 1620154
Remove directory structure from tutorial readme
cavusmustafa 3e1a061
Move aot insturctions to the main example readme file
cavusmustafa 5627c5e
Delete examples/openvino/aot/README.md
cavusmustafa a993931
Added link for openvino supported hardware
cavusmustafa 1e63eff
code formatting
cavusmustafa 0e76d93
add aot readme file
cavusmustafa 3b6fd88
remove aot readme file
cavusmustafa 99c832b
add aot readme file
cavusmustafa 73431cf
change make command to use max threads available
cavusmustafa bb284e4
Renamed yaml file name for unsupported ops
cavusmustafa ac8df24
License comment line update
cavusmustafa 6051275
atol and rtol update
cavusmustafa 0275c47
Comments
daniil-lyakhov cec2fb0
Update cmake-out directory
suryasidd 53e7c17
Removed unused packages
suryasidd ee54b2f
import nncf.torch
daniil-lyakhov 889e313
Merge pull request #24 from daniil-lyakhov/dl/ov/comments
cavusmustafa 8f702aa
Merge branch 'openvino_backend' into surya/pr_updates
suryasidd bc29b46
Code cleanup
suryasidd 468c890
Merge pull request #27 from ynimmaga/surya/pr_updates
cavusmustafa a42185a
Merge remote-tracking branch 'ynimmaga/openvino_backend' into first_r…
cavusmustafa 751f087
openvino backend: static lib, pybinding, and test updates
cavusmustafa 629d5a4
Typo fix in openvino backend header file
cavusmustafa 63fd3a2
Update README.md
cavusmustafa 6ce9321
Update README.md
cavusmustafa 173970f
Update README.md
cavusmustafa 213a018
pybinding example added for openvino backend
cavusmustafa 2fcceb2
Update README.md
cavusmustafa 34d1cf3
use pybinding for validation
cavusmustafa 4f3df9a
Use common executor, remove custom openvino executor runner, use pybi…
cavusmustafa d89429b
code formatting
cavusmustafa d81f921
renamed openvino_pybinding_example.py to export_and_infer_openvino.py
cavusmustafa fb3685c
Removed yaml file for unsupported ops (not needed)
cavusmustafa 7d5dd96
Update README.md
cavusmustafa 79e5839
Update README.md
cavusmustafa ead3a85
Update README.md
cavusmustafa e30cc4c
build argument update for openvino backend
cavusmustafa 0820520
add is_available call into contructor back
cavusmustafa 3e8e9a1
Fix typo in openvino build script
cavusmustafa 1d37c5c
Fix pybinding build issue and remove is_available call from constructor
cavusmustafa 574d2b0
remove aot folder
cavusmustafa 9251dcf
Update README.md
cavusmustafa ba711cf
Update README.md
cavusmustafa 634b7e8
--pybind changed to --enable_python
cavusmustafa 473b92e
Update README.md
cavusmustafa e783581
Update examples/openvino/export_and_infer_openvino.py
cavusmustafa 62d719e
Update backends/openvino/README.md
cavusmustafa 8a8b3db
removed cmake file for openvino example
cavusmustafa 49e2792
Update backends/openvino/README.md
cavusmustafa cff39cd
Merge pull request #25 from cavusmustafa/first_revise_after_reviews
cavusmustafa 5154ad6
[OpenVINO] Constant folding is removed from the OpenVINOQuantizer
daniil-lyakhov 4685a37
quantize_model cleanup
daniil-lyakhov 0efa875
Update README.md
cavusmustafa db281b6
updated atol and rtol
cavusmustafa 94a351e
Comments
daniil-lyakhov 4f8ca40
Fix executorch/examples/openvino/README.md
daniil-lyakhov d47e3d9
Update NNCF version
daniil-lyakhov 4263a12
Added inference option into aot_openvino_compiler.py, removed inferen…
cavusmustafa 1d975c7
Update README.md
cavusmustafa 1d756e6
Update README.md
cavusmustafa 37b56f8
Update README.md
cavusmustafa 4902c8a
Update README.md
cavusmustafa 3539dd7
Merge pull request #30 from daniil-lyakhov/dl/update_nncf
cavusmustafa ae3a9e7
aot script updated
cavusmustafa 59c90ea
Update README.md
cavusmustafa 8b9f76e
Merge pull request #28 from daniil-lyakhov/dl/ov/remote_constant_folding
ynimmaga f30ee76
Update README.md
cavusmustafa ee032ac
Update examples/openvino/aot_openvino_compiler.py
cavusmustafa e76c440
code formatting
cavusmustafa 3e17d09
Merge pull request #29 from daniil-lyakhov/dl/quantize_model_ex
cavusmustafa c1ad164
Merge remote-tracking branch 'ynimmaga/openvino_backend' into additio…
cavusmustafa a02855f
code formatting
cavusmustafa 4eee40d
Merge pull request #31 from cavusmustafa/additional_updates
cavusmustafa 7e7711f
temp fix for unit tests with nncf
cavusmustafa e0ad620
Merge pull request #33 from cavusmustafa/unit_test_fix_with_nncf
ynimmaga 293b1d5
Update build-run-openvino.md
cavusmustafa 93adab7
preprocess update for latest ov release
cavusmustafa d743bc0
Update README.md
cavusmustafa 69c1902
Merge pull request #34 from cavusmustafa/updates_for_ov_release
ynimmaga ca3ec9c
Fix inputs for hf models
suryasidd ab0cb88
Addressed PR comments
suryasidd 82866db
Merge pull request #35 from ynimmaga/surya/fix_hf_models
cavusmustafa b1756d1
Update build-run-openvino.md
cavusmustafa 2cf3ecf
Update build-run-openvino.md
cavusmustafa e3ceba0
Update build-run-openvino.md
cavusmustafa 3d538de
Update build-run-openvino.md
cavusmustafa 24e823f
remove openvino pybind option from executorch install script
cavusmustafa e0bd72a
Update build-run-openvino.md
cavusmustafa c884129
Update build-run-openvino.md
cavusmustafa e04c874
Update README.md
cavusmustafa f5619e1
Update build-run-openvino.md
cavusmustafa d1be27e
Update build-run-openvino.md
cavusmustafa 1f0cefc
add openvino pybind option into install_executorch.py
cavusmustafa 65aa705
Update backends/openvino/README.md
cavusmustafa 6f52a9a
Update docs/source/build-run-openvino.md
cavusmustafa 15178ce
Update build-run-openvino.md
cavusmustafa dc2c72e
Merge pull request #36 from cavusmustafa/updates_for_second_review
ynimmaga b160608
Merge remote-tracking branch 'executorch/main' into fix_merge_conflicts
cavusmustafa 30c6821
Resolved conflicts with main branch
cavusmustafa 682ae80
code formatting
cavusmustafa 0030fb9
Merge pull request #37 from cavusmustafa/fix_merge_conflicts
ynimmaga 381a65d
Merge branch 'main' into openvino_backend
suryasidd b496425
Updated build dependencies in docs
suryasidd de4cef2
Updated docs
suryasidd a05e3c7
Merge pull request #39 from ynimmaga/docs_update
ynimmaga 3a3e912
pybind update to use new api
cavusmustafa 5a20619
Merge pull request #40 from cavusmustafa/pybind_update
ynimmaga 28af462
fix merge conflict: openvino pybind
cavusmustafa 6258b42
pybind openvino merge update
cavusmustafa 3f53cc2
Merge pull request #42 from cavusmustafa/pybind_merge_fix
ynimmaga 55d5b39
build update for pybind
cavusmustafa a9010ac
Merge pull request #43 from cavusmustafa/build_update
ynimmaga f74e3e3
Addressed typechecker issues
suryasidd 4bb3112
Merge pull request #44 from ynimmaga/fix_linter_issues
ynimmaga bfb6768
Update examples/openvino/README.md
ynimmaga c01e672
Fixed typechecker issues
suryasidd 43060c0
Merge pull request #45 from ynimmaga/fix_typechecks
ynimmaga da55f42
initial openvino github action
cavusmustafa ecbae60
openvino ci script update
cavusmustafa 50aa613
move openvino job into pull.yml
cavusmustafa dd05013
openvino ci test update
cavusmustafa 9dd9b26
openvino ci update
cavusmustafa fc9c722
Merge branch 'main' into openvino_backend
cavusmustafa 468974e
openvino ci update
cavusmustafa e3605f2
openvino ci update
cavusmustafa bae693f
Merge branch 'main' into openvino_backend
ynimmaga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
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) | ||
|
||
cd .. | ||
cmake --install build --prefix dist | ||
|
||
source dist/setupvars.sh | ||
cd ../backends/openvino | ||
pip install -r requirements.txt | ||
cd scripts | ||
./openvino_build.sh --enable_python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -ex | ||
|
||
# shellcheck source=/dev/null | ||
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" | ||
|
||
source openvino/dist/setupvars.sh | ||
cd backends/openvino/tests | ||
python test_runner.py --test_type ops | ||
python test_runner.py --test_type models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ Platform Support: | |
- Arm | ||
- Cadence | ||
- MediaTek | ||
- OpenVINO | ||
- Qualcomm | ||
- Vulkan | ||
- XNNPACK | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Copyright (c) Intel Corporation | ||
# | ||
# Licensed under the BSD License (the "License"); you may not use this file | ||
# except in compliance with the License. See the license file found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# Set minimum required CMake version | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
# Set project name | ||
project(openvino_backend_project) | ||
|
||
# Set C++ standard | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# Ensure compile_commands.json is generated | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
# Set up EXECUTORCH_ROOT if not already set | ||
if(NOT EXECUTORCH_ROOT) | ||
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) | ||
endif() | ||
|
||
# Define common include directories | ||
set(COMMON_INCLUDE_DIRS ${EXECUTORCH_ROOT}/..) | ||
|
||
# Include utility CMake scripts from ExecuteTorch | ||
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake) | ||
|
||
# Find OpenVINO libraries | ||
find_package(OpenVINO REQUIRED) | ||
|
||
# Define OpenVINO backend as a static library | ||
add_library(openvino_backend STATIC .) | ||
|
||
# Enable exceptions and RTTI for OpenVINO backend | ||
target_compile_options(openvino_backend PRIVATE -frtti -fexceptions) | ||
|
||
# Include Executorch directories | ||
target_include_directories(openvino_backend PUBLIC ${COMMON_INCLUDE_DIRS}) | ||
|
||
# Link OpenVINO and ExecuteTorch core libraries | ||
target_link_libraries(openvino_backend PRIVATE openvino::runtime executorch_core) | ||
|
||
# Add source files for OpenVINO backend | ||
target_sources(openvino_backend PRIVATE ${CMAKE_CURRENT_LIST_DIR}/runtime/OpenvinoBackend.cpp) | ||
|
||
target_link_options_shared_lib(openvino_backend) | ||
|
||
if(EXECUTORCH_BUILD_OPENVINO_EXECUTOR_RUNNER) | ||
# Build executor runner binary for openvino backend | ||
list(APPEND openvino_executor_runner_libs openvino_backend executorch) | ||
|
||
set(_openvino_executor_runner__srcs | ||
${EXECUTORCH_ROOT}/examples/portable/executor_runner/executor_runner.cpp | ||
${EXECUTORCH_ROOT}/extension/data_loader/file_data_loader.cpp | ||
${EXECUTORCH_ROOT}/extension/evalue_util/print_evalue.cpp | ||
${EXECUTORCH_ROOT}/extension/runner_util/inputs.cpp | ||
${EXECUTORCH_ROOT}/extension/runner_util/inputs_portable.cpp | ||
) | ||
add_executable(openvino_executor_runner ${_openvino_executor_runner__srcs}) | ||
|
||
list(APPEND openvino_executor_runner_libs) | ||
|
||
target_link_libraries( | ||
openvino_executor_runner gflags portable_ops_lib ${openvino_executor_runner_libs} | ||
) | ||
target_compile_options(openvino_executor_runner PUBLIC ${_common_compile_options}) | ||
endif() | ||
|
||
|
||
|
||
# Install OpenVINO backend library to the lib directory | ||
install(TARGETS openvino_backend DESTINATION lib) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# OpenVINO Backend for ExecuTorch | ||
The OpenVINO backend enables optimized execution of deep learning models on Intel hardware, leveraging Intel's [OpenVINO toolkit](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html) for inference acceleration. | ||
|
||
## Supported Hardware | ||
kimishpatel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
OpenVINO backend supports the following hardware: | ||
|
||
- Intel CPUs | ||
- Intel integrated GPUs | ||
- Intel discrete GPUs | ||
- Intel NPUs | ||
|
||
For more information on the supported hardware, please refer to [OpenVINO System Requirements](https://docs.openvino.ai/2025/about-openvino/release-notes-openvino/system-requirements.html) page. | ||
|
||
## Directory Structure | ||
|
||
``` | ||
executorch | ||
├── backends | ||
│ └── openvino | ||
│ ├── runtime | ||
│ ├── OpenvinoBackend.cpp | ||
│ └── OpenvinoBackend.h | ||
│ ├── scripts | ||
│ └── openvino_build.sh | ||
│ ├── tests | ||
│ ├── CMakeLists.txt | ||
│ ├── README.md | ||
│ ├── __init__.py | ||
│ ├── partitioner.py | ||
│ ├── preprocess.py | ||
│ └── requirements.txt | ||
└── examples | ||
└── openvino | ||
├── aot_optimize_and_infer.py | ||
└── README.md | ||
``` | ||
|
||
## Build Instructions | ||
|
||
### Prerequisites | ||
|
||
Before you begin, ensure you have openvino installed and configured on your system: | ||
ynimmaga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```bash | ||
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) | ||
|
||
cd .. | ||
cmake --install build --prefix <your_preferred_install_location> | ||
ynimmaga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd <your_preferred_install_location> | ||
source setupvars.sh | ||
``` | ||
Note: The OpenVINO backend is not yet supported with the current OpenVINO release packages. It is recommended to build from source. The instructions for using OpenVINO release packages will be added soon. | ||
For more information about OpenVINO build, refer to the [OpenVINO Build Instructions](https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/build_linux.md). | ||
|
||
### Setup | ||
|
||
Follow the steps below to setup your build environment: | ||
|
||
1. **Setup ExecuTorch Environment**: Refer to the [Environment Setup](https://pytorch.org/executorch/stable/getting-started-setup#environment-setup) guide for detailed instructions on setting up the ExecuTorch environment. | ||
|
||
2. **Setup OpenVINO Backend Environment** | ||
- Install the dependent libs. Ensure that you are inside `executorch/backends/openvino/` directory | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
Note: To achieve optimal performance with NNCF quantization, you should install the latest development version of NNCF (version 2.16.0.dev0+191b53d9 or higher). | ||
3. Navigate to `scripts/` directory. | ||
|
||
4. **Build OpenVINO Backend C++ Libraries and Executor Runner**: Once the prerequisites are in place, run the `openvino_build.sh` script to start the build process. By default, OpenVINO backend will be built under `cmake-out/backends/openvino/` as `libopenvino_backend.a` | ||
|
||
```bash | ||
./openvino_build.sh | ||
``` | ||
**Build OpenVINO Backend Python Package with Pybindings**: To build and install the OpenVINO backend Python package with Python bindings, run the `openvino_build.sh` script with the `--enable_python` argument. This will compile and install the ExecuTorch Python package with the OpenVINO backend into your Python environment. This option will also enable python bindings required to execute OpenVINO backend tests and `export_and_infer_openvino.py` script inside `executorch/examples/openvino` folder. | ||
|
||
```bash | ||
./openvino_build.sh --enable_python | ||
``` | ||
|
||
### Run | ||
|
||
Please refer to [README.md](../../examples/openvino/README.md) for instructions on running examples of various of models with openvino backend. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .partitioner import OpenvinoPartitioner | ||
from .preprocess import OpenvinoBackend | ||
from .quantizer.quantizer import OpenVINOQuantizer | ||
|
||
__all__ = ["OpenvinoBackend", "OpenvinoPartitioner", "OpenVINOQuantizer"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.