Skip to content

Ship the OpenVINO delegate as its own library - #21770

Open
shoumikhin wants to merge 73 commits into
gh/shoumikhin/96/headfrom
gh/shoumikhin/105/head
Open

Ship the OpenVINO delegate as its own library#21770
shoumikhin wants to merge 73 commits into
gh/shoumikhin/96/headfrom
gh/shoumikhin/105/head

Conversation

@shoumikhin

@shoumikhin shoumikhin commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

The OpenVINO delegate was compiled into the Python extension, so only Python could
use it. A C++ application had no way to link it from the wheel, which is the same gap
the other delegates had before they were split out.

It now builds as its own library and ships beside the runtime, so an application can
ask for it:

find_package(executorch REQUIRED COMPONENTS backend_openvino)
target_link_libraries(my_app PRIVATE executorch::backend_openvino)

Only the adapter ships here. The OpenVINO runtime itself is loaded at run time and is
not part of the wheel, so the component's documentation says to install it separately,
and the wheel does not grow meaningfully: the adapter is a few kilobytes.

The library resolves the runtime from the shared runtime library rather than from the
static core, so the delegate registers into the one registry the process has instead of
a second private one.

Test Plan: built a wheel with OpenVINO enabled on Linux x86_64 and inspected it.
The library ships at executorch/lib/libexecutorch_backend_openvino.so. Its delegate
symbols moved out of the Python extension, 13 in the library and 0 in the extension,
so the process has one copy and one registration. Its only ExecuTorch dependency is
the shared runtime library, and it records no link dependency on OpenVINO, confirming
the runtime is still loaded at run time. Added an ownership row to the shared library
test so a future change that puts the delegate back into the extension fails there.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

@pytorch-bot

pytorch-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21770

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 1 Unrelated Failure, 8 Unclassified Failures

As of commit 765de9e with merge base ed2d9ec (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 12, 2026
@shoumikhin
shoumikhin force-pushed the gh/shoumikhin/96/head branch from 9428da3 to 2cdf978 Compare August 12, 2026 16:19
@shoumikhin
shoumikhin force-pushed the gh/shoumikhin/105/head branch from 00563b2 to d3de6d5 Compare August 12, 2026 16:19
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
target_link_libraries(openvino_backend PRIVATE executorch_core ${CMAKE_DL_LIBS})
target_link_libraries(openvino_backend PRIVATE ${CMAKE_DL_LIBS})

if(EXECUTORCH_BUILD_SHARED)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were not doing all the backends? what made you include this one?

Comment thread backends/cuda/CMakeLists.txt Outdated
# stop supporting. Name the two datacentre architectures the release rows
# build for, so a source build produces device code that runs on the same
# GPUs the wheels target.
set(CMAKE_CUDA_ARCHITECTURES "80;86")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to one of the previous PRs introduces cuda?

Comment on lines +126 to +129
if sys.platform == "darwin":
_BUNDLED_THREADPOOL_SYMBOLS = ("cpuinfo_initialize",)
else:
_BUNDLED_THREADPOOL_SYMBOLS = ("pthreadpool_create", "cpuinfo_initialize")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also OpenVino related?

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries/all Release PRs with this label will build wheels for all python versions ciflow/binaries ciflow/cuda ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants