Skip to content

Commit

Permalink
Merge branch 'master' into tj/inference/coverity/issues_1
Browse files Browse the repository at this point in the history
  • Loading branch information
t-jankowski authored Jul 5, 2024
2 parents 2b2e8bf + 27c872f commit 1672110
Show file tree
Hide file tree
Showing 248 changed files with 2,914 additions and 1,571 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/job_pytorch_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
if: always()
run: |
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel)"
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel or test_pa_precommit)"
env:
TYPE: ${{ inputs.event == 'schedule' && 'nightly' || 'precommit'}}
TEST_DEVICE: CPU
Expand All @@ -146,13 +146,23 @@ jobs:
if: always()
run: |
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_pa_transformation.py -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_pagedattention_tests.html --self-contained-html -v --tb=short
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_pa_transformation.py -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_pagedattention_tests.html --self-contained-html -v --tb=short -n 4
env:
TYPE: ${{ inputs.event == 'schedule' && 'nightly' || 'precommit'}}
TEST_DEVICE: CPU
USE_SYSTEM_CACHE: False
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log

- name: StatefulToStateless Test
if: always()
run: |
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_stateful_to_stateless_transformation.py -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_stateful_to_stateless_tests.html --self-contained-html -v --tb=short
env:
TYPE: ${{ inputs.event == 'schedule' && 'nightly' || 'precommit'}}
TEST_DEVICE: CPU
USE_SYSTEM_CACHE: False

- name: Reformat unsupported ops file
if: '!cancelled()'
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/job_tokenizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,14 @@ jobs:
if: runner.os != 'Windows'
run: |
# use OpenVINO wheel package only to build the extension
export OpenVINO_DIR=$(python3 -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')")
python -m pip wheel -v --no-deps --wheel-dir ${EXTENSION_BUILD_DIR} ${OPENVINO_TOKENIZERS_REPO}
python -m pip wheel -v --no-deps --wheel-dir ${EXTENSION_BUILD_DIR} --find-links ${INSTALL_DIR}/tools ${OPENVINO_TOKENIZERS_REPO}
env:
CMAKE_BUILD_PARALLEL_LEVEL: '4'

- name: Build tokenizers wheel (Windows)
if: runner.os == 'Windows'
run: |
$env:OpenVINO_DIR=$(python3 -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')")
python3 -m pip wheel -v --no-deps --wheel-dir ${env:EXTENSION_BUILD_DIR} ${env:OPENVINO_TOKENIZERS_REPO}
python3 -m pip wheel -v --no-deps --wheel-dir ${env:EXTENSION_BUILD_DIR} --find-links ${env:INSTALL_DIR}/tools ${env:OPENVINO_TOKENIZERS_REPO}
env:
CMAKE_BUILD_PARALLEL_LEVEL: '4'

Expand Down
4 changes: 2 additions & 2 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ function(ov_download_tbb)
elseif(LINUX AND X86_64 AND OPENVINO_GNU_LIBC AND OV_LIBC_VERSION VERSION_GREATER_EQUAL 2.17)
# build oneTBB 2021.2.1 with gcc 4.8 (glibc 2.17)
RESOLVE_DEPENDENCY(TBB
ARCHIVE_LIN "oneapi-tbb-2021.2.5-lin-trim.tgz"
ARCHIVE_LIN "oneapi-tbb-2021.2.4-lin.tgz"
TARGET_PATH "${TEMP}/tbb"
ENVIRONMENT "TBBROOT"
SHA256 "9bea2c838df3085d292989d643523dc1cedce9b46d5a03eec90104151b49a180"
SHA256 "6523661559a340e88131472ea9a595582c306af083e55293b7357d11b8015546"
USE_NEW_LOCATION TRUE)
elseif(YOCTO_AARCH64)
RESOLVE_DEPENDENCY(TBB
Expand Down
12 changes: 12 additions & 0 deletions docs/articles_en/assets/snippets/compile_model_npu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <openvino/runtime/core.hpp>

int main() {
{
//! [compile_model_default_npu]
ov::Core core;
auto model = core.read_model("model.xml");
auto compiled_model = core.compile_model(model, "NPU");
//! [compile_model_default_npu]
}
return 0;
}
18 changes: 18 additions & 0 deletions docs/articles_en/assets/snippets/compile_model_npu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import openvino as ov
from snippets import get_model


def main():
model = get_model()

core = ov.Core()
if "NPU" not in core.available_devices:
return 0

#! [compile_model_default_npu]
core = ov.Core()
compiled_model = core.compile_model(model, "NPU")
#! [compile_model_default_npu]
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ different conditions:
| :doc:`Heterogeneous Execution (HETERO) <inference-devices-and-modes/hetero-execution>`
| :doc:`Automatic Batching Execution (Auto-batching) <inference-devices-and-modes/automatic-batching>`

To learn how to change the device configuration, read the :doc:`Query device properties article <inference-devices-and-modes/query-device-properties>`.

Enumerating Available Devices
#######################################
Expand Down Expand Up @@ -83,3 +83,10 @@ Accordingly, the code that loops over all available devices of the "GPU" type on
:language: cpp
:fragment: [part3]

Additional Resources
####################

* `OpenVINO™ Runtime API Tutorial <./../../notebooks/openvino-api-with-output.html>`__
* `AUTO Device Tutorial <./../../notebooks/auto-device-with-output.html>`__
* `GPU Device Tutorial <./../../notebooks/gpu-device-with-output.html>`__
* `NPU Device Tutorial <./../../notebooks/hello-npu-with-output.html>`__
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ of the model into a proprietary format. The compiler included in the user mode d
platform specific optimizations in order to efficiently schedule the execution of network layers and
memory transactions on various NPU hardware submodules.

To use NPU for inference, pass the device name to the ``ov::Core::compile_model()`` method:

.. tab-set::

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

.. doxygensnippet:: docs/articles_en/assets/snippets/compile_model_npu.py
:language: py
:fragment: [compile_model_default_npu]

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

.. doxygensnippet:: docs/articles_en/assets/snippets/compile_model_npu.cpp
:language: cpp
:fragment: [compile_model_default_npu]


Model Caching
#############################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ Compile the model for a specific device using ``ov::Core::compile_model()``:
The ``ov::Model`` object represents any models inside the OpenVINO™ Runtime.
For more details please read article about :doc:`OpenVINO™ Model representation <integrate-openvino-with-your-application/model-representation>`.

OpenVINO includes experimental support for NPU, learn more in the
:doc:`NPU Device section <./inference-devices-and-modes/npu-device>`

The code above creates a compiled model associated with a single hardware device from the model object.
It is possible to create as many compiled models as needed and use them simultaneously (up to the limitation of the hardware).
To learn how to change the device configuration, read the :doc:`Query device properties <inference-devices-and-modes/query-device-properties>` article.
To learn more about supported devices and inference modes, read the :doc:`Inference Devices and Modes <./inference-devices-and-modes>` article.

Step 3. Create an Inference Request
###################################
Expand Down Expand Up @@ -432,6 +435,7 @@ To build your project using CMake with the default build tools currently availab
Additional Resources
####################

* `OpenVINO™ Runtime API Tutorial <./../../notebooks/openvino-api-with-output.html>`__
* See the :doc:`OpenVINO Samples <../../learn-openvino/openvino-samples>` page for specific examples of how OpenVINO pipelines are implemented for applications like image classification, text prediction, and many others.
* Models in the OpenVINO IR format on `Hugging Face <https://huggingface.co/models>`__.
* :doc:`OpenVINO™ Runtime Preprocessing <optimize-inference/optimize-preprocessing>`
Expand Down
18 changes: 13 additions & 5 deletions docs/sphinx_setup/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ nav.bd-links .current>a {
padding-right: 0;
padding: 0 0.8rem;
}
ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home):before {
padding: .2rem .5rem 0 !important;
}
li.breadcrumb-item {
align-items: center !important;
}

.bd-sidebar-primary {
display:block !important;
}

a.nav-link:hover {
text-decoration:none !important;
Expand All @@ -163,11 +173,6 @@ a.nav-link:hover {
color: white;
}

li.toctree-l1.has-children > a.reference.internal {
font-weight: 700;
color: black;
}

.rotate {
transform: rotate(270deg);
}
Expand Down Expand Up @@ -462,6 +467,9 @@ div.highlight {
.container-xl {
max-width: 100%;
}
.bd-main .bd-content .bd-article-container .bd-article {
padding-left: 1rem !important;
}
}


Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx_setup/_static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ document.addEventListener('DOMContentLoaded', function () {
});

var parentElement = toggle.parentElement;
if (!parentElement
|| !parentElement.parentElement
if (!parentElement.parentElement
|| !parentElement.parentElement.parentElement
|| !parentElement.classList.contains('current')
|| !parentElement.parentElement.classList.contains('current')
|| (parentElement.parentElement.classList.contains('current') && (parentElement.parentElement))
|| (parentElement.parentElement.classList.contains('current') && (!parentElement.parentElement))
) {
toggle.classList.add('rotate');
}
Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx_setup/_static/js/open_sidebar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function() {
const elems = $( "ul.bd-sidenav > li > input" );
for(let i = 0; i < elems.length; i++){
elems[i].setAttribute("checked", "checked");
const labels = $( "ul.bd-sidenav > li > label" );
for(let i = 0; i < labels.length; i++){
labels[i].classList.remove("rotate");
}
})
Loading

0 comments on commit 1672110

Please sign in to comment.