public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openvino] origin/pr/8/head: Enable ONNX Frontend
@ 2026-06-11 16:10 Alexander F. Lent
0 siblings, 0 replies; only message in thread
From: Alexander F. Lent @ 2026-06-11 16:10 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/openvino
Branch : origin/pr/8/head
Commit : bc9d3f256406ae5607d7209d208c60a60772da17
Author : Alexander F. Lent <lx@xanderlent.com>
Date : 2025-03-03T12:01:58+00:00
Stats : +72/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/openvino/c/bc9d3f256406ae5607d7209d208c60a60772da17?branch=origin/pr/8/head
Log:
Enable ONNX Frontend
This introduces a new subpackage, libopenvino-onnx-frontend, which
contains the ONNX frontend for OpenVINO.
The new patch contains some tweaks to make it build against the
system-provided protobuf and ONNX libraries.
(I think with ONNX we are supposed to include its CMake files
somehow, but I'm not a CMake expert, so I manually set the vars.)
Signed-off-by: Alexander F. Lent <lx@xanderlent.com>
---
diff --git a/onnx-frontend-enable.patch b/onnx-frontend-enable.patch
new file mode 100644
index 0000000..3d8ea0d
--- /dev/null
+++ b/onnx-frontend-enable.patch
@@ -0,0 +1,53 @@
+diff -ur a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
+--- a/cmake/developer_package/frontends/frontends.cmake 2024-11-09 01:14:37.000000000 -0500
++++ b/cmake/developer_package/frontends/frontends.cmake 2024-11-09 01:14:37.000000000 -0500
+@@ -246,7 +246,7 @@
+ set(protobuf_target_name libprotobuf-lite)
+ set(protobuf_install_name "protobuf_lite_installed")
+ else()
+- set(protobuf_target_name libprotobuf)
++ set(protobuf_target_name protobuf)
+ set(protobuf_install_name "protobuf_installed")
+ endif()
+ if(ENABLE_SYSTEM_PROTOBUF)
+diff -ur a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt
+--- a/src/frontends/common/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/common/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
+@@ -83,6 +83,6 @@
+ ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
+
+ # Shutdown protobuf library
+-if(Protobuf_IN_FRONTEND AND BUILD_SHARED_LIBS)
++if(BUILD_SHARED_LIBS)
+ add_subdirectory(shutdown_protobuf)
+ endif()
+diff -ur a/src/frontends/common/shutdown_protobuf/CMakeLists.txt b/src/frontends/common/shutdown_protobuf/CMakeLists.txt
+--- a/src/frontends/common/shutdown_protobuf/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/common/shutdown_protobuf/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
+@@ -9,7 +9,7 @@
+ add_library(openvino::protobuf_shutdown ALIAS ${TARGET_NAME})
+ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME protobuf_shutdown)
+
+-target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
+- $<BUILD_INTERFACE:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>>)
+-set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
+-target_compile_features(${TARGET_NAME} PRIVATE $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_FEATURES>)
++#target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
++# $<BUILD_INTERFACE:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>>)
++#set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
++#target_compile_features(${TARGET_NAME} PRIVATE $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_FEATURES>)
+diff -ur a/src/frontends/onnx/CMakeLists.txt b/src/frontends/onnx/CMakeLists.txt
+--- a/src/frontends/onnx/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/onnx/CMakeLists.txt 2024-11-09 01:14:37.000000000 -0500
+@@ -2,6 +2,11 @@
+ # SPDX-License-Identifier: Apache-2.0
+ #
+
++# TODO: Replace these with including the defs from ONNX's CMake files
++add_definitions(-DONNX_NAMESPACE=onnx -DONNX_ML=1)
++# TODO: The ONNX frontend uses functions only available in -std=c++17
++add_compile_options(-std=c++17)
++
+ add_subdirectory(onnx_common)
+ add_subdirectory(frontend)
+
diff --git a/openvino.spec b/openvino.spec
index 4d93b0b..3f803b4 100644
--- a/openvino.spec
+++ b/openvino.spec
@@ -50,6 +50,7 @@ Patch0: openvino-fedora.patch
# Support numpy 2.2.0
Patch1: https://github.com/openvinotoolkit/openvino/pull/28039.patch
Patch2: npu-level-zero.patch
+Patch3: onnx-frontend-enable.patch
ExclusiveArch: x86_64
@@ -69,12 +70,15 @@ BuildRequires: zlib-ng-compat-devel
BuildRequires: xbyak-devel
BuildRequires: yaml-cpp-devel
BuildRequires: tbb-devel
+BuildRequires: onnx-devel
+BuildRequires: protobuf-devel
# forked version of OpenVINO oneDNN does not have a proper version
Provides: bundled(onednn)
# MLAS upstream does not have any release
Provides: bundled(mlas)
Requires: lib%{name}-ir-frontend = %{version}
Requires: lib%{name}-pytorch-frontend = %{version}
+Requires: lib%{name}-onnx-frontend = %{version}
Requires: numpy
Recommends: %{name}-plugins = %{version}
@@ -114,6 +118,14 @@ The PyTorch Frontend is a C++ based OpenVINO Frontend component that is
responsible for reading and converting a PyTorch model to an ov::Model object
that can be further serialized into the Intermediate Representation (IR) format
+%package -n lib%{name}-onnx-frontend
+Summary: OpenVINO ONNX Frontend
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n lib%{name}-onnx-frontend
+The main responsibility of the ONNX Frontend is to import ONNX models and
+convert them into the ov::Model representation.
+
%package -n python3-%{name}
Summary: OpenVINO Python API
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -195,7 +207,7 @@ sed -i '/#include <vector>.*/a#include <cstdint>' src/plugins/intel_npu/src/plug
-DENABLE_MULTI=ON \
-DENABLE_PROXY=ON \
-DENABLE_TEMPLATE=ON \
- -DENABLE_OV_ONNX_FRONTEND=OFF \
+ -DENABLE_OV_ONNX_FRONTEND=ON \
-DENABLE_OV_PADDLE_FRONTEND=OFF \
-DENABLE_OV_IR_FRONTEND=ON \
-DENABLE_OV_PYTORCH_FRONTEND=ON \
@@ -216,7 +228,7 @@ sed -i '/#include <vector>.*/a#include <cstdint>' src/plugins/intel_npu/src/plug
-DENABLE_TBB_RELEASE_ONLY=ON \
-DENABLE_SAMPLES=OFF \
-DENABLE_TESTS=OFF \
- -DBUILD_SHARED_LIBS=ON
+ -DBUILD_SHARED_LIBS=ON \
%cmake_build
%install
@@ -244,6 +256,7 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}_c.so
%{_libdir}/lib%{name}_pytorch_frontend.so
+%{_libdir}/lib%{name}_onnx_frontend.so
%{_libdir}/cmake/openvino-%{version}
%{_libdir}/pkgconfig/%{name}.pc
@@ -264,6 +277,10 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
%{_libdir}/lib%{name}_pytorch_frontend.so.%{version}
%{_libdir}/lib%{name}_pytorch_frontend.so.%{so_ver}
+%files -n lib%{name}-onnx-frontend
+%{_libdir}/lib%{name}_onnx_frontend.so.%{version}
+%{_libdir}/lib%{name}_onnx_frontend.so.%{so_ver}
+
%files -n python3-%{name}
%{python3_sitearch}/%{name}
%{python3_sitearch}/%{name}-%{version}.dist-info
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-11 16:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 16:10 [rpms/openvino] origin/pr/8/head: Enable ONNX Frontend Alexander F. Lent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox