Skip to content

Commit

Permalink
Exclude JAX FE from all distributions except wheel (#26610)
Browse files Browse the repository at this point in the history
### Details:
 - Exclude JAX FE from all distributions except wheel

### Tickets:
 - CVS-152012

---------

Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
  • Loading branch information
ilya-lavrenov and andrei-kochin authored Oct 11, 2024
1 parent 8a02b4c commit 6af61f4
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fedora_29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
python3 -c 'from openvino import Core; Core().get_property("MULTI", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("HETERO", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("BATCH", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 7'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6'
benchmark_app --help
opt_in_out --help
ovc --help
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_debian_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
python3 -c 'from openvino import Core; Core().get_property("MULTI", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("HETERO", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino import Core; Core().get_property("BATCH", "SUPPORTED_PROPERTIES")'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 7'
python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6'
benchmark_app --help
opt_in_out --help
ovc --help
18 changes: 12 additions & 6 deletions cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ endmacro()
# FILEDESCRIPTION <description> # used on Windows to describe DLL file
# [LINKABLE_FRONTEND] # whether we can use FE API directly or via FEM only
# [SKIP_INSTALL] # private frontend, not for end users
# [DISABLE_CPP_INSTALL] # excludes frontend from all cmake rules
# [PROTOBUF_REQUIRED] # options to denote that protobuf is used
# [PROTOBUF_LITE] # requires only libprotobuf-lite
# [SKIP_NCC_STYLE] # use custom NCC rules
# [LINK_LIBRARIES <lib1 lib2 ...>])
#
macro(ov_add_frontend)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL DISABLE_CPP_INSTALL)
set(oneValueArgs NAME FILEDESCRIPTION)
set(multiValueArgs LINK_LIBRARIES PROTO_FILES)
cmake_parse_arguments(OV_FRONTEND "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -306,30 +307,35 @@ macro(ov_add_frontend)
# installation

if(NOT OV_FRONTEND_SKIP_INSTALL)
# convert option (OFF / ON) to actual value
if(OV_FRONTEND_DISABLE_CPP_INSTALL)
set(frontend_exclude_from_all EXCLUDE_FROM_ALL)
endif()

if(BUILD_SHARED_LIBS)
# Note:
# we use 'framework' as component for deployment scenario, i.e. for libraries itself
# and use common 'core_dev' component for headers, cmake files and symlinks to versioned library
set(lib_component "${OV_FRONTEND_NAME}")
set(dev_component "${OV_CPACK_COMP_CORE_DEV}")

# TODO: whether we need to do it configuralbe on Windows installer?
ov_cpack_add_component(${lib_component} HIDDEN)

if(OV_FRONTEND_LINKABLE_FRONTEND)
if(OV_FRONTEND_LINKABLE_FRONTEND AND NOT OV_FRONTEND_DISABLE_CPP_INSTALL)
set(export_set EXPORT OpenVINOTargets)
set(archive_dest ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${dev_component} ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
set(namelink NAMELINK_COMPONENT ${OV_CPACK_COMP_LINKS} ${OV_CPACK_COMP_LINKS_EXCLUDE_ALL})
else()
set(namelink NAMELINK_SKIP)
endif()
install(TARGETS ${TARGET_NAME} ${export_set}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component} ${frontend_exclude_from_all}
${archive_dest}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component} ${frontend_exclude_from_all}
${namelink})

# export to build tree
# Note: we keep this even with passed DISABLE_CPP_INSTALL to ensure that Python API can be built
if(OV_FRONTEND_LINKABLE_FRONTEND)
export(TARGETS ${TARGET_NAME} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
Expand All @@ -338,7 +344,7 @@ macro(ov_add_frontend)
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
endif()

if(OV_FRONTEND_LINKABLE_FRONTEND)
if(OV_FRONTEND_LINKABLE_FRONTEND AND NOT OV_FRONTEND_DISABLE_CPP_INSTALL)
# install library development files
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
DESTINATION ${FRONTEND_INSTALL_INCLUDE}
Expand Down
4 changes: 3 additions & 1 deletion cmake/packaging/archive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ macro(ov_cpack_settings)
# filter out some components, which are not needed to be wrapped to conda-forge | brew | conan | vcpkg
if(NOT OV_CPACK_COMP_${UPPER_COMP}_EXCLUDE_ALL AND
# python_package is not needed in case of archives, because components like pyopenvino are used, as well as wheels
NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*")
NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*" AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down
4 changes: 3 additions & 1 deletion cmake/packaging/common-libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ macro(ov_cpack_settings)
# because in case of VCPKG | CONAN | BREW | CONDA-FORGE distributions, python is either not needed or installed separately
(NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*" OR ENABLE_PYTHON_PACKAGING) AND
# the same for pugixml
NOT item STREQUAL "pugixml")
NOT item STREQUAL "pugixml" AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down
7 changes: 5 additions & 2 deletions cmake/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ macro(ov_cpack_settings)
# don't install Intel OpenMP
NOT item STREQUAL "omp" AND
# the same for pugixml
NOT item STREQUAL "pugixml")
NOT item STREQUAL "pugixml" AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down Expand Up @@ -236,7 +238,8 @@ macro(ov_cpack_settings)
set(ir_copyright "generic")
endif()

if(ENABLE_OV_JAX_FRONTEND)
# It was decided not to distribute JAX as C++ component
if(ENABLE_OV_JAX_FRONTEND AND OFF)
set(CPACK_COMPONENT_JAX_DESCRIPTION "OpenVINO JAX Frontend")
set(CPACK_COMPONENT_JAX_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_DEBIAN_JAX_PACKAGE_NAME "libopenvino-jax-frontend-${cpack_name_ver}")
Expand Down
6 changes: 4 additions & 2 deletions cmake/packaging/npm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ macro(ov_cpack_settings)
string(TOUPPER ${item} UPPER_COMP)
# filter out some components, which are not needed to be wrapped to npm package
if(NOT OV_CPACK_COMP_${UPPER_COMP}_EXCLUDE_ALL AND
# python is not required for npm package
NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*")
# python is not required for npm package
NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*" AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down
4 changes: 3 additions & 1 deletion cmake/packaging/nsis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ macro(ov_cpack_settings)
foreach(item IN LISTS cpack_components_all)
# filter out some components, which are not needed to be wrapped to Windows package
if(# python wheels are not needed to be wrapped by NSIS installer
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS)
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down
7 changes: 5 additions & 2 deletions cmake/packaging/rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ macro(ov_cpack_settings)
# don't install Intel OpenMP
NOT item STREQUAL "omp" AND
# the same for pugixml
NOT item STREQUAL "pugixml")
NOT item STREQUAL "pugixml" AND
# It was decided not to distribute JAX as C++ component
NOT item STREQUAL "jax")
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
Expand Down Expand Up @@ -210,7 +212,8 @@ macro(ov_cpack_settings)
set(ir_copyright "generic")
endif()

if(ENABLE_OV_JAX_FRONTEND)
# It was decided not to distribute JAX as C++ component
if(ENABLE_OV_JAX_FRONTEND AND OFF)
set(CPACK_COMPONENT_JAX_DESCRIPTION "OpenVINO JAX Frontend")
set(CPACK_RPM_JAX_PACKAGE_NAME "libopenvino-jax-frontend-${cpack_name_ver}")
set(CPACK_RPM_JAX_POST_INSTALL_SCRIPT_FILE "${def_triggers}")
Expand Down
12 changes: 1 addition & 11 deletions cmake/templates/OpenVINOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#
# * `Runtime`: OpenVINO C++ and C Core & Inference Runtime, frontend common
# * `Threading`: OpenVINO threading backend for parallel.hpp
# * `JAX`: OpenVINO JAX frontend
# * `ONNX`: OpenVINO ONNX frontend
# * `Paddle`: OpenVINO Paddle frontend
# * `PyTorch`: OpenVINO PyTorch frontend
Expand Down Expand Up @@ -46,9 +45,6 @@
#
# Frontend specific targets:
#
# `openvino::frontend::jax`
# JAX FrontEnd target (optional)
#
# `openvino::frontend::onnx`
# ONNX FrontEnd target (optional)
#
Expand All @@ -75,9 +71,6 @@
# `OpenVINO_Runtime_FOUND`
# OpenVINO C++ Core & Inference Runtime is available
#
# `OpenVINO_Frontend_JAX_FOUND`
# OpenVINO JAX frontend is available
#
# `OpenVINO_Frontend_ONNX_FOUND`
# OpenVINO ONNX frontend is available
#
Expand Down Expand Up @@ -550,7 +543,7 @@ unset(_OV_ENABLE_OPENVINO_BUILD_SHARED)

set(_ov_imported_libs openvino::runtime openvino::runtime::c
openvino::frontend::onnx openvino::frontend::paddle openvino::frontend::tensorflow
openvino::frontend::pytorch openvino::frontend::tensorflow_lite openvino::frontend::jax)
openvino::frontend::pytorch openvino::frontend::tensorflow_lite)

if(_ov_as_external_package)
foreach(target IN LISTS _ov_imported_libs)
Expand Down Expand Up @@ -590,15 +583,13 @@ set(${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND @ENABLE_OV_TF_FRONTEND@)
set(${CMAKE_FIND_PACKAGE_NAME}_TensorFlowLite_FOUND @ENABLE_OV_TF_LITE_FRONTEND@)
set(${CMAKE_FIND_PACKAGE_NAME}_IR_FOUND @ENABLE_OV_IR_FRONTEND@)
set(${CMAKE_FIND_PACKAGE_NAME}_PyTorch_FOUND @ENABLE_OV_PYTORCH_FRONTEND@)
set(${CMAKE_FIND_PACKAGE_NAME}_JAX_FOUND @ENABLE_OV_JAX_FRONTEND@)

set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_ONNX_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_Paddle_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_Paddle_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_TensorFlow_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_TensorFlowLite_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_TensorFlowLite_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_IR_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_IR_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_PyTorch_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_PyTorch_FOUND})
set(${CMAKE_FIND_PACKAGE_NAME}_Frontend_JAX_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_JAX_FOUND})

# if no components specified, only Runtime is provided
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
Expand Down Expand Up @@ -653,6 +644,5 @@ unset(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlowLite_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_PyTorch_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_JAX_FOUND)

cmake_policy(POP)
1 change: 1 addition & 0 deletions src/frontends/jax/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ endif()

ov_add_frontend(NAME jax
LINKABLE_FRONTEND
DISABLE_CPP_INSTALL
FILEDESCRIPTION "FrontEnd to load and convert JAX/Flax models"
LINK_LIBRARIES openvino::util openvino::core::dev)
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ if (ENABLE_OV_PYTORCH_FRONTEND)
list(APPEND DEFINITIONS ENABLE_OV_PYTORCH_FRONTEND)
endif()

if (ENABLE_OV_JAX_FRONTEND)
list(APPEND DEPENDENCIES openvino::frontend::jax)
list(APPEND DEFINITIONS ENABLE_OV_JAX_FRONTEND)
endif()

# Create library

add_library(${TARGET_NAME} MODULE ${LIBRARY_SRC} ${LIBRARY_HEADERS})
Expand Down

0 comments on commit 6af61f4

Please sign in to comment.