Skip to content

Commit

Permalink
Merge branch 'master' into river/core_remove_memcpy_and_precision_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie authored Jan 31, 2024
2 parents 48d1efc + c2e9591 commit 33e1960
Show file tree
Hide file tree
Showing 372 changed files with 6,850 additions and 2,513 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:

- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
name: Setup Python ${{ inputs.version }}
uses: akashchi/deadsnakes-action@f01521a69eee61eaca3a34440bea3ce838317846
uses: akashchi/deadsnakes-action@92417281055a5878a0450f240a5b95883eb2d7e2
with:
python-version: ${{ inputs.version }}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/job_cpu_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
PARALLEL_TEST_CACHE: ${{ github.workspace }}/install/tests/test_cache.lst
if: ${{ github.event_name != 'merge_group' }}
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/job_cxx_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
if: ${{ github.event_name != 'merge_group' }}
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/job_debian_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
DEBIAN_PACKAGES_DIR: ${{ github.workspace }}/packages
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO debian packages
uses: actions/download-artifact@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/job_onnx_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
ONNX_MODEL_ZOO_SHA: "d58213534f2a4d1c4b19ba62b3bb5f544353256e"
if: ${{ github.event_name != 'merge_group' }}
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/job_onnx_runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
ONNX_RUNTIME_UTILS: ${{ github.workspace }}/install/onnxruntime
ONNX_RUNTIME_BUILD_DIR: ${{ github.workspace }}/onnxruntime/build
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/job_python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -216,6 +219,15 @@ jobs:
TEST_DEVICE: CPU
TEST_PRECISION: FP32

- name: PyTorch torch.export Layer Tests
if: ${{ fromJSON(inputs.affected-components).PyTorch_FE.test && runner.arch != 'ARM64' }} # Ticket: 126287
run: |
python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/pytorch_tests -m precommit_torch_export --junitxml=${INSTALL_TEST_DIR}/TEST-pytorch.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP32
PYTORCH_TRACING_MODE: EXPORT

- name: PyTorch torch.compile TORCHFX Layer Tests
if: ${{ fromJSON(inputs.affected-components).PyTorch_FE.test && runner.os != 'macOS' }}
run: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/job_pytorch_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests
steps:

- name: Check sudo
if: ${{ runner.os == 'Linux' }}
run: if [ "$(id -u)" -eq 0 ]; then apt update && apt --assume-yes install sudo; fi

- name: Set apt retries
run: |
if [ "$(id -u)" -eq 0 ]; then
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
else
sudo sh -c "echo 'Acquire::Retries \"10\";' >> /etc/apt/apt.conf.d/80-retries"
fi
- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/job_samples_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/job_tensorflow_hub_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests
steps:

- name: Check sudo
if: ${{ runner.os == 'Linux' }}
run: if [ "$(id -u)" -eq 0 ]; then apt update && apt --assume-yes install sudo; fi

- name: Set apt retries
run: |
if [ "$(id -u)" -eq 0 ]; then
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
else
sudo sh -c "echo 'Acquire::Retries \"10\";' >> /etc/apt/apt.conf.d/80-retries"
fi
- name: Download OpenVINO package
uses: actions/download-artifact@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ jobs:
if: "!needs.smart_ci.outputs.skip_workflow"

steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Install git
run: |
apt-get update
Expand Down Expand Up @@ -529,6 +532,9 @@ jobs:
if: fromJSON(needs.smart_ci.outputs.affected_components).NVIDIA

steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Fetch install_build_dependencies.sh
uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
if: "!needs.smart_ci.outputs.skip_workflow"

steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Install git
run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }}

steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Install git
run: |
apt-get update
Expand Down Expand Up @@ -273,6 +276,9 @@ jobs:
SCCACHE_AZURE_KEY_PREFIX: ubuntu22_x86_64_cc_Release

steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Install git
run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linux_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
CCACHE_MAXSIZE: 50G
if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }}
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries

- name: Install git
run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates

Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,19 @@ jobs:
- name: Clean sccache stats
run: '& "$Env:SCCACHE_PATH" --zero-stats'

# to get more information on the issue
# described in the next step
- name: Show which network ports are used
run: netstat -ban

# the case is the following:
# sccache: error: An attempt was made to access a socket in a way forbidden by its access permissions. (os error 10013)
# This looks like the attempt to use
# a port below 1024 or a port
# which is occupied by another app
- name: Stop sccache server just in case
run: '& "$Env:SCCACHE_PATH" --stop-server'

- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose

Expand Down Expand Up @@ -201,8 +214,7 @@ jobs:
cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
- name: CMake configure, build and install - OpenVINO JS API
if: ${{ 'false' }} # 128689
# if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
run:
cmake -DCPACK_GENERATOR=NPM -DENABLE_SYSTEM_TBB=OFF -UTBB* -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }}

Expand Down
3 changes: 1 addition & 2 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ ov_dependent_option (ENABLE_SYSTEM_SNAPPY "Enables use of system version of Snap
ov_dependent_option (ENABLE_PYTHON_PACKAGING "Enables packaging of Python API in APT / YUM" OFF
"ENABLE_PYTHON;UNIX" OFF)

ov_dependent_option (ENABLE_JS "Enables JS API building" ON
"NOT WIN32" OFF)
ov_option(ENABLE_JS "Enables JS API building" ON)

ov_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF)

Expand Down
36 changes: 18 additions & 18 deletions docs/articles_en/documentation/openvino_extensibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ OpenVINO Extensibility Mechanism


.. meta::
:description: Explore OpenVINO™ Extensibility API, which allows adding
support for models with custom operations and their further implementation
:description: Explore OpenVINO™ Extensibility API, which allows adding
support for models with custom operations and their further implementation
in applications.

.. toctree::
Expand All @@ -16,18 +16,18 @@ OpenVINO Extensibility Mechanism
openvino_docs_Extensibility_UG_add_openvino_ops
openvino_docs_Extensibility_UG_Frontend_Extensions
openvino_docs_Extensibility_UG_GPU

.. toctree::
:maxdepth: 1
:hidden:

openvino_docs_transformations
OpenVINO Plugin Developer Guide <openvino_docs_ie_plugin_dg_overview>


The Intel® Distribution of OpenVINO™ toolkit supports neural-network models trained with various frameworks, including
TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle (OpenVINO support for Apache MXNet, Caffe, and Kaldi is currently
being deprecated and will be removed entirely in the future). The list of supported operations is different for each of the supported frameworks.
TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle (OpenVINO support for Apache MXNet, Caffe, and Kaldi is currently
being deprecated and will be removed entirely in the future). The list of supported operations is different for each of the supported frameworks.
To see the operations supported by your framework, refer to :doc:`Supported Framework Operations <openvino_resources_supported_operations_frontend>`.

Custom operations, which are not included in the list, are not recognized by OpenVINO out-of-the-box. The need for custom operation may appear in two cases:
Expand Down Expand Up @@ -80,32 +80,32 @@ Registering Extensions

A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.

.. note::
.. note::
This documentation is derived from the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__, which demonstrates the details of extension development. It is based on minimalistic ``Identity`` operation that is a placeholder for your real custom operation. Review the complete, fully compilable code to see how it works.

Use the ``:ref:`ov::Core::add_extension <doxid-classov_1_1_core_1a68d0dea1cbcd42a67bea32780e32acea>``` method to load the extensions to the ``:ref:`ov::Core <doxid-classov_1_1_core>``` object. This method allows loading library with extensions or extensions from the code.
Use the ``ov::Core::add_extension`` method to load the extensions to the ``ov::Core`` object. This method allows loading library with extensions or extensions from the code.

Load Extensions to Core
+++++++++++++++++++++++

Extensions can be loaded from a code with the ``:ref:`ov::Core::add_extension <doxid-classov_1_1_core_1a68d0dea1cbcd42a67bea32780e32acea>``` method:
Extensions can be loaded from a code with the ``ov::Core::add_extension`` method:

.. tab-set::

.. tab-item:: Python
:sync: py

.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [add_extension]

.. tab-item:: C++
:sync: cpp

.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [add_extension]


The ``Identity`` is a custom operation class defined in :doc:`Custom Operation Guide <openvino_docs_Extensibility_UG_add_openvino_ops>`. This is sufficient to enable reading OpenVINO IR which uses the ``Identity`` extension operation emitted by Model Optimizer. In order to load original model directly to the runtime, add a mapping extension:

Expand All @@ -130,7 +130,7 @@ When Python API is used, there is no way to implement a custom OpenVINO operatio
Python can still be used to map and decompose operations when only operations from the standard OpenVINO operation set are used.

.. _create_a_library_with_extensions:

Create a Library with Extensions
++++++++++++++++++++++++++++++++

Expand All @@ -142,7 +142,7 @@ An extension library should be created in the following cases:

To create an extension library, for example, to load the extensions into Model Optimizer, perform the following:

1. Create an entry point for extension library. OpenVINO provides the ``:ref:`OPENVINO_CREATE_EXTENSIONS() <doxid-core_2include_2openvino_2core_2extension_8hpp_1acdadcfa0eff763d8b4dadb8a9cb6f6e6>``` macro, which allows to define an entry point to a library with OpenVINO Extensions.
1. Create an entry point for extension library. OpenVINO provides the ``OPENVINO_CREATE_EXTENSIONS()`` macro, which allows to define an entry point to a library with OpenVINO Extensions.
This macro should have a vector of all OpenVINO Extensions as an argument.

Based on that, the declaration of an extension class might look like the following:
Expand All @@ -162,7 +162,7 @@ This CMake script finds OpenVINO, using the ``find_package`` CMake command.
3. Build the extension library, running the commands below:

.. code-block:: sh
$ cd src/core/template_extension/new
$ mkdir build
$ cd build
Expand All @@ -173,16 +173,16 @@ This CMake script finds OpenVINO, using the ``find_package`` CMake command.
4. After the build, you may use the path to your extension library to load your extensions to OpenVINO Runtime:

.. tab-set::

.. tab-item:: Python
:sync: py

.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [add_extension_lib]

.. tab-item:: C++
:sync: cpp
:sync: cpp

.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
Expand Down
Loading

0 comments on commit 33e1960

Please sign in to comment.