Compare commits

..

549 Commits

Author SHA1 Message Date
csy0225
7cd3c8e86e Fix compile problem when open -Wnon-virtual-dtor compile flag (#10705)
* Fix compile problem when open -Wnon-virtual-dtor compile flag

* update code style

* fix the code style
2022-03-02 16:31:37 +03:00
Ilya Churaev
d3ded2fc36 Fixed declaration of 'xxx' hides global declaration (#10733) 2022-03-02 16:01:21 +03:00
Gorokhov Dmitriy
40fc5334d8 [CPU] Fixed number of streams initialization for hint = throughput (#10728) 2022-03-02 15:44:34 +03:00
Anastasia Kuporosova
cd52cc6767 [Python API][Docs] Remove excess info (#10672)
* [Python API][Docs] Remove excess info

* autodoc: add skip methods (#68)

* remove utils from docs

* undo changes

Co-authored-by: Nikolay Tyukaev <nikolay.tyukaev@intel.com>
2022-03-02 15:36:31 +03:00
Victor Kuznetsov
c54926ecb8 Update nightly memcheck models scope (#10709) 2022-03-02 18:03:28 +08:00
Wilson Seok
969060c8db Add op impl check tests (#10339)
* Remove fp16 of Convert layer test from skip_tests.config.cpp as it works now

* update repo

* add initial op impl check tests

* add op imple check tests

* add op impl check tests

* add rnn cell based ops

* modify lstmsequence

* update rnn cell base op test

* add priorbox, priorboxclustered, proposal

* add ROIAlign to ReverseSequence

* add Roll to ScatterElementsUpdate

* add select to swish tests

* add tensoriterator to variadicsplit test

* temporary block of LSTMCell v1 due to crash in mkldnn

* use ov namespace instead of ngraph as possible

* update indexing of vector array

* update multiple parameter vector

* add loop test

* fix cpplint errors

* fix build error
2022-03-02 12:50:31 +03:00
Ilya Lavrenov
86b175534a Docs: complete migration guide (#10652)
* Updated glossary

* Removed references to OpenVX

* Moved migration_ov_2_0 to OpenVINO User guide

* Replaced IE with OV runtime

* Complete migration guide

* Migration 2.0

* Self-review

* Added property migration guide

* Fixed table

* Added preprocessing migration

* Update docs/OV_Runtime_UG/migration_ov_2_0/preprocessing.md

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update docs/OV_Runtime_UG/migration_ov_2_0/preprocessing.md

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update docs/snippets/ov_preprocessing_migration.cpp

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* reivew fixes

* Preprocessing intro updated

* Updated config migration guide

* Updates

* Fixes

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>
2022-03-02 12:16:58 +03:00
Yuan Xu
d1bcb6d0fc CVS-80445 (#10723)
* Add Overview page

* Revert "Add Overview page"

* fix format

* test formatting

* test formatting

* update

* test formatting

* minor changes
2022-03-02 11:10:58 +03:00
Pavel Zamelin
9cd3bff7df Fix install failures for static libs with EXCLUDE_FROM_ALL (#10706)
* Remove EXCLUDE_FROM_ALL for some static targets

* Add install check for static libs
2022-03-02 03:39:30 +03:00
Vladislav Golubev
e75ee60bec [CPU] Disabled sequences decomposition for dynamic case (#10710) 2022-03-01 22:33:42 +03:00
Nikolay Tyukaev
81cd9d86d1 sphinxdirective: allow commented blocks (#10720)
* sphinxdirective: allow commented blocks

* minor correction
2022-03-01 22:11:37 +03:00
Mikhail Nosov
5e023ebdd9 Fix issue with default arguments in preprocessing python bindings (#10702)
* Fix in Preprocessing python bindings - add correct default arguments for:
    - PreProcessSteps::convert_element_type
    - PostProcessSteps::convert_element_type
    - InputTensorInfo::set_color_format

Otherwise, python users must always specify optional params

E.g. instead of writing `tensor().set_color_format(ColorFormat.RGB)` python users will have to write `tensor().set_color_format(ColorFormat.RGB, [])`

* Corrected 'help' output

* Exposing 'openvino.runtime.Type.undefined' and use it in 'convert_element_type' documentation
2022-03-01 17:32:36 +03:00
Ilya Lavrenov
6b067bc0ed Fixed install on Apple (#8302)
* Fixed Apple install

* Update path to libs in setupvars.sh

* Fix IE_CPACK_RUNTIME_PATH for Apple

* Fix wheels packaging

Co-authored-by: Alexey Suhov <alexey.suhov@intel.com>
2022-03-01 16:56:15 +03:00
David Nam
18035209a0 Add op impl checkt tests (#10414)
* Add op impl checkt tests

* Add op impl check tests

* Add op impl check tests

* Add op impl check test

* Add op impl check tests

* Add op impl check tests

* Fix usage of makeConstant()

* Fix build error in ubuntu18_i386

* Fix error in linux-macos

Co-authored-by: PVA-CI <pva-ci@intel.com>
2022-03-01 16:27:11 +03:00
Anastasia Kuporosova
0f409ccea9 [Python API] Fix typo in method name (#10707) 2022-03-01 16:11:57 +03:00
Anastasia Popova
3f941e3c5f Corrected layout parsing error message. (#10651)
* Corrected error message.

* Corrected message.

* Small correction

* Corrected error message for source and target layout.
2022-03-01 16:03:09 +03:00
Irina Efode
9eca8515b8 [IE TESTS] Extend EvaluatorMaps by Greater, If, Equal (#10026)
* [IE TESTS] Extend EvaluatesMap

* fix code style
2022-03-01 16:01:30 +03:00
Sergey Shlyapnikov
6c6aa8fa95 [GPU] Fix RemoteBlob lock() and ulock() behaviour in case of multiple threads (#10685)
* [GPU] Fix RemoteBlob lock() and ulock() behaviour in case of multiple threads and add tests
2022-03-01 15:15:04 +03:00
Karol Blaszczak
1d469a2b87 [DOCS] hddl update (#10616)
* [DOCS] hddl update

include info on hddl and myriad working at the same time

* Update docs/OV_Runtime_UG/supported_plugins/MYRIAD.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update HDDL.md

* Update MYRIAD.md

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-03-01 15:00:38 +03:00
Maxim Andronov
8e0978818c [CPU] Prevent internalBlobs cleanup for dynamic deconv node (#10697) 2022-03-01 14:31:21 +03:00
Nikita Semaev
64fca57af4 Fix NMS Conformance tests for Template plugin (#9273)
* Added inputs argument to all compare() function overloads

* Rewritten compare() function for NMS

* Implemented sorting by name of expected outputs

* Implemented sorting by name of actual outputs

* Added accounting for simultaneous dynamism and the need to convert outputs in Template plugin

* Added a separate case to the GetBlob function for correct dimensions

* Rewritten Expected outputs sorting to work correctly on cpuFuncTests

* Fixing code style problems

* Implemented sorting by name of actual outputs for functional tests

* Debug prints removed

* Replacing a raw pointer with a vector

* Fixing code style problems

* Shifting the sorting place Expected outputs

* Added sorting of Expected exits in one more place

* Quality transition to SLT2.0

* Removing unnecessary code after SLT2.0

* Fix soft_nms_sigma argument

* Removing unnecessary parts after SLT2.0

* Remove unnecessary outputs sorting

* Removing parts from the code for debugging

* Fix for NMS

* Trying to make CI green

* Checking test passage without adding convert precision

* Checking CI

* There is an algorithm that adds Convert only if there is f16, fp16 in inputs

* Add Convert Op in cases where inputs are not already installed f32

* Check that the CI will go away if you put everything back

* Revert changes, validate f32 change on ci

* Adding Convert f16-f32 only if there is a function parameter of type f16

* The presence of f16/bf16 as a parameter type is now mandatory to add Convert

* Added prints for params, inputs, outputs

* Logic checking the absence of Convert

* Cosmetic fixes

* Setting the correct value for selected_scores_type NMS-5

* Fix bf

* Increased readability

* Missing parts added

* Removed the static for the vector
2022-03-01 12:14:45 +03:00
Ilya Lavrenov
5f40ba9a23 Fixed onecoreuap.toolchain.cmake (#10646)
* Fixed onecoreuap.toolchain.cmake

* Updated mt.runtime.win32.toolchain.cmake
2022-03-01 11:12:12 +03:00
Roman Kazantsev
6c78715749 [MO] Clean up Model Optimizer options, help, and documentation (#10653)
* [MO] Clean-up MO cmd-line options

Remove the following Model Optimizer deprecated options that are no longer used for several releases: disable_fusing, disable_gfusing, generate_deprecated_IR_V7,
legacy_ir_generation, keep_shape_ops, move_to_preprocess
Deprecate through CLI the following options for which functionality triggered from POT or automatically: disable_weights_compression, disable_nhwc_to_nchw,
disable_resnet_optimization, finegrain_fusing.
Correct and extend description of each MO option to be printed during model conversion.

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Correct documentation about input shapes

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Perform final corrections in documentation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Remove legacy_ir_generation overall

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Clean-up tests from deprecated options

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Recover disable_fusing option as deprecated

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix keys for static_shape and extensions

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Remove extension key that does not work

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply feedback: remove disable_gfusing, correct docs

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Recover disable_fusing option for unit-tests

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply feedback for documentation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply feedback about parameters use_legacy_frontend and use_new_frontend

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* DO minor fixes for indentation of MO logs

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Revert log.error for fallback message

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Revert disable_weights_compression parameter for tests

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2022-03-01 10:57:24 +03:00
Ilya Churaev
9da124544a Transformation guide (#10628)
* Fixed some comments about transformations

* Changed transformation guide

* Fixed typo

* Moved transformation doc to extensibility

* Moved images to Extensibility_UG

* Added separate document for each pass

* Added see also section

* Fixed comments
2022-03-01 09:03:59 +03:00
Andrei Kochin
4b29eed013 Update MO requirements to allow TF1.15 if already installed (#10673)
* Update MO requirements to allow TF1.15 if already installed

* Removing pyhton version check as redundant

* Updating requirements.txt as well
2022-02-28 18:55:44 +03:00
Mikhail Nosov
173f328c53 Checking compatibility between 'pyopenvino' and 'libopenvino' (#10668)
* Checking compatibility between 'pyopenvino' and 'libopenvino' on 'import phase'

This fix is to prevent undefined behavior when user loads OpenVINO from python, but pyopenvino loads different version of 'libopenvino'
This may happen if user has several releases installed and played around PATH/PYTHONPATH environment variables.

In such case, user may have undefined behavior - application may crash in the middle of the usage or use incorrect release.

Fix checks build versions for pyopenvino and ov::get_openvino_version. If mismatch occurs, exception is thrown.

This logic is disabled if user has built OpenVINO locally, experienced developers probably know what they're doing, so if version has 'custom_'  prefix - this logic is disabled

* Removed custom logic for CI_BUILD_NUMBER, it is reused from already included version.cmake

* Use addVersionDefines macro
2022-02-28 17:04:59 +03:00
Maxim Andronov
b319acc672 [CPU] Prohibit to load model with dynamic output shapes (#10643) 2022-02-28 17:01:18 +03:00
Mateusz Tabaka
4a8b142fef [PYTHON] fix importing lstm_sequence for opsets >= 5 (#10637)
* [PYTHON] fix importing lstm_sequence for opsets >= 5

* update compat opsets
2022-02-28 17:00:51 +03:00
Nikita Malinin
33ad1b96d4 [POT] Update samples and samplers with the new DataLoader format (#10595)
* Update samples and samplers with the new DataLoader format

* Update with utils

* Pylint updates

* Update metric with the exception

* Pylint

* Update with the exception

* Pylint

* Revert index sampler changes

* Update ImageLoader & SimplifiedEngine

* Update with the different solution

* Remove utils

* Pylint

* Remove list wrapping

* Remove list from meta_data
2022-02-28 16:26:07 +03:00
Maxim Vafin
7d0d950b9a Add pytorch Resnext101 from fb into documentation (#10665) 2022-02-28 15:30:33 +03:00
Irina Efode
f6fbef1f66 Allow to specify conformance by shape_type (#10667)
* Init

* the solution

* Remove extra

* Update CMakeLists.txt

* Readme

* fix build

* dd
2022-02-28 15:06:03 +03:00
Maxim Shevtsov
bed0adf5ef creating remote ocl buffer/tensor per request, to avoid simulteneous locking of the same ocl buffer when auto-batching is used (#10607) 2022-02-28 15:04:03 +03:00
Vladislav Golubev
1ceb9729e9 [CPU] friendly name duplication fixed for the TypeRelaxed case (#10486) 2022-02-28 14:06:17 +03:00
Maxim Gordeev
b9ef57112e [IE Samples] Fixed memory allocation problem for speech sample (#10671) 2022-02-28 12:31:01 +03:00
Vitaliy Urusovskij
d4f77f1d3e Mute 'maybe-uninitialized' error for RELWITHDEBINFO in intel_gpu (#10682) 2022-02-28 12:30:21 +03:00
Fedor Zharinov
f55e69d656 Legacy benchmark_app is added (#10239)
* Legacy benchmark_app is added

* apply fix for supporting multiple -i arguments

* new CMakeLists.txt with OpenCV auto detection

* fixes

* docs

* docs2

* Docs changes

* docs

* CMakeLists.txt modification

* Update tools/legacy/benchmark_app/README.md

Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
Co-authored-by: Vladimir Dudnik <vladimir.dudnik@intel.com>
2022-02-28 12:26:41 +03:00
Andrey Zaytsev
5724c5ac44 Image added (#10674) 2022-02-25 20:42:00 +00:00
Denis Orlov
52b450a5fb [GNA] Update documentation (#10570) 2022-02-25 18:55:15 +03:00
Tatiana Savina
7b58f931b5 [DOCS] Add wb images for nightly docs fix (#10663)
* add img

* wb img for input

* dataset added

* add img

* wb img for input

* dataset added

* ov_fix
2022-02-25 18:22:13 +03:00
Egor Duplensky
18ff8afe63 [IE TESTS] Avoid extra checks for test skipping (#10609)
Avoid double iteration over skip patterns
Skip test after first pattern match
2022-02-25 16:11:16 +03:00
Ilya Znamenskiy
94cbbe063b [GPU] Cum sum int32/64 support (#10629) 2022-02-25 15:48:17 +03:00
Ilya Lavrenov
e9e59cb954 Moved ngraphConfig.cmake to root (#10618) 2022-02-25 15:47:21 +03:00
Jan Iwaszkiewicz
54f39294de [PYTHON] Fix style in python doc strings (#10606)
* Fix style in python doc strings

* New line quotes
2022-02-25 13:02:04 +03:00
Yury Gaydaychuk
14d11a8998 [CPU] Fix of invalid read in DefConv (#10481) 2022-02-25 12:57:03 +03:00
Anuj Mittal
bdee939fe0 installing-openvino-yocto: fix documentation links (#10546)
* installing-openvino-yocto: fix documentation links

Point to the new Yocto docs website.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>

* Update installing-openvino-yocto.md

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
2022-02-25 12:31:32 +03:00
Anton Pankratov
38d87dd9de Removed stream enum (#10645)
* Removed stream enum

* Fixed build

* fixed build

* Fixed test
2022-02-25 11:57:23 +03:00
Ilya Churaev
a32ed5a07a Fixed build for CI (#10659) 2022-02-25 11:41:23 +03:00
Dmitry Pigasin
bacf597516 [CPP Speech Sample] Improve -o and -oname flags (#10321)
* Improve `-o` and `-oname` flags

* Apply clang-format tool

* fix saving output files

* Apply clang-format

* Fix error when `-oname` not specified

* apply clang format

* Fix error `-oname`

* Use output name with port to find model output

* fix comment line breaking

* fix comparison with reference for multiple outputs

* Fix output name printing  error

* try to fix clang format

* fix problem with bs > 1

* minimal change to rerun test pipeline

* clang format

* Revert "Fix error `-oname`"

This reverts commit c33d5f16e8.
2022-02-25 11:25:35 +03:00
Maksim Kutakov
9e3610c028 [CPU] Fix for subnormal numbers nullifying routine (#10622) 2022-02-25 10:55:59 +03:00
Nikolay Tyukaev
6062e3d4b7 DOCS: benchmarks ovino vs tf (#10654)
* benchmarks-ovino-vs-tf

* minor fixes
2022-02-25 10:34:11 +03:00
Ilya Lavrenov
53d3ef8eab Removed ngraph mentions (#10647) 2022-02-25 07:02:09 +03:00
Ilya Lavrenov
ffd63f9758 Replaced IE with OV runtime: docs (#10642)
* Updated glossary

* Removed references to OpenVX

* Moved migration_ov_2_0 to OpenVINO User guide

* Replaced IE with OV runtime
2022-02-25 00:44:48 +03:00
Ilya Churaev
806ce96899 Remove onnx_custom_op doc (#10638)
* Remove onnx_custom_op doc

* Remove test

* Fixed tests
2022-02-24 19:41:47 +03:00
Anastasia Kazantaeva
f2bbd5bbb8 Add original contribution guide to root (#10644) 2022-02-24 16:13:21 +00:00
Sergey Shlyapnikov
e906b3581f [GPU] Replace handle_permute optimization pass with proper Reorder adding instead of Permute primitive (#10569) 2022-02-24 16:41:43 +03:00
Paul Youngsoo Ahn
163a79b232 [GPU] Fix activation fusing issue(#10636) (#10636) 2022-02-24 16:07:33 +03:00
Ilya Churaev
1c18733ade Changed location of extensibility guide (#10433)
* Changed location of extensibility guide

* Removed hardware kernels legacy documentation

* Changed all extension guild to new API

* Removed Custom_Layers_Guide

* Fixed build

* Fixed some moments

* Update docs/Extensibility_UG/Intro.md

* Fixed build

* Added more examples

* Fixed typo

* Fixed comments

* Extend library topic

* Fixed typo
2022-02-24 15:50:31 +03:00
Maksim Derbasov
a2f9963045 Fix warnings from builders.hpp (#10568) 2022-02-24 15:33:30 +03:00
Ilya Churaev
85707198b3 Revert "Disable reshape for new API (#10064)" (#10634)
This reverts commit 3f4e384d5d.
2022-02-24 15:22:08 +03:00
Evgenya Stepyreva
3de428c713 Auto-batch ConvertLike enabled (#10631) 2022-02-24 14:37:03 +03:00
Alina Kladieva
4c01d6c50c Skip canRun3SyncRequestsConsistentlyFromThreads sporadic on Myriad (#10598) 2022-02-24 12:03:36 +03:00
Ivan Novoselov
506303cc79 [Snippets][CPU] Fix empty shapes handling in canonicalization (#10632) 2022-02-24 11:54:15 +03:00
Vladimir Dudnik
23b74840c1 renamed streams property (#10620) 2022-02-24 10:49:38 +03:00
Evgenya Stepyreva
e544f5e66f Enable einsum shape inferenxe test (#10603) 2022-02-23 15:29:12 +00:00
Anton Pankratov
9dec8db964 Common OV configuration tests (#10286)
* Used new config for streams and threads

* Fixed review coments in ba

* format fix

* fixed hello_query_device

* Added STL string io

* fixed tests

* Fixed test

* Fixed build

* fixed format

* Fixed build

* try fix win

* other any io specialization

* Fixed after merge

* renamed streams

* build fixed

* fixed build

* fixed format

* fix for old mac build

* Fixed type of exception

* test fix

* Added ov configuration test

* Added common OV properties tests

* fix mklnn

* fixed foramat

* merge conflicts

* Remoed compile_model tests

* removed duplicated test
2022-02-23 13:03:37 +03:00
Karol Blaszczak
c1919a0f1d update documents for Paddle inclusion (#10613)
Introduce PaddlePaddle articles and include PP references in other articles
2022-02-23 12:53:37 +03:00
Ilya Churaev
7ff8ada805 Fixed API for transformations (#10584)
* Fixed API for transformations

* Fixed code style

* Fixed build

* Fixed typo
2022-02-23 06:29:03 +03:00
Fedor Zharinov
75cca1e9e9 [benchamrk_app] error if -b is set but there's no batch info (#10592)
* Added code showing error message if -b is provided, but got no batch info for inputs

* stylefix / batch>1 case
2022-02-23 01:30:08 +03:00
Vladimir Dudnik
817550fa0a [OMZ] update OMZ submodule, docs updated (#10594)
* update OMZ submodule, docs updated

* rebase to master
2022-02-22 23:37:55 +03:00
Ilya Churaev
3f4e384d5d Disable reshape for new API (#10064)
* Disable reshape for new API

* Update cnn_network_ngraph_impl.cpp

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-02-22 23:05:23 +03:00
Ilya Lavrenov
5b3b48aa17 samples overview & model protection: docs (#10596)
* Renamed hetero md

* Renamed some guides

* Updated OpenVINO_Runtime_User_Guide.md

* Updated plugin's page

* More updates

* Fixed links

* Updated link names

* Fixed links

* Fixed docs build

* Self-review

* Fixed issues in doc snippets

* Updated Samples_Overview.md

* Updated model protection guide

* Renamed ngraph_function creation samples
2022-02-22 20:11:42 +03:00
Liubov Talamanova
37923a9183 [POT] Remove DataFreeEngine (#10600) 2022-02-22 18:38:08 +03:00
hyunback kim
14d31d59af [GPU] Enable deconv with oneDNN (#10580)
* [GPU] Enable deconv with oneDNN

remove post-op data_type into oneDNN.

Signed-off-by: hyunback <hyunback.kim@intel.com>

* Update to use data_type in conv sum post-op.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-23 00:25:26 +09:00
Ivan Novoselov
b12c3389ee [Sinppets] Add virt destructors to Emitter and TargetMachine (#10588) 2022-02-22 18:18:49 +03:00
Indira Salyahova
e2df6d149b [POT] Update face detection sample (#10471)
* support cascade model for sw api

* update mtcnnengine

* delete empty line
2022-02-22 17:46:08 +03:00
Maxim Shevtsov
dab1a34aa2 checking the network batch-ability (internal helper func on top of bat… (#10446)
* checking the network batchability (internal helper func on top of batch tracking) before doing hetero

* more general logic with respect to batch-ability of the network

* a dynamism check that I've owed from the PR-10560

* using the DO-detached mechanism for early hetero exit, also fixed this flag in the Batching plugin (although minor, as the DO is removed by HETERO)

* adding the dimension tracking logic depending on whether implicitly/expicitly the auto-batching is enabled

* changed the DetectionOutput affinity markup to go over results, also accomodate Convert, so only 2 subgraphs are made by the HETERO
2022-02-22 17:19:23 +03:00
Nikolay Shchegolev
e59739ce88 [CPU] RNN node enforce bf16 mode does not work. (#9859) 2022-02-22 16:57:26 +03:00
Mikhail Ryzhov
71a0a6d261 [GNA] Klocwork fixes 2022-02-22 16:54:56 +03:00
Roman Kazantsev
bc0a84a1c1 [MO] Print information about new API 2.0 (#10567)
* [MO] Print information about new API 2.0

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply feedback

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply feedback

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2022-02-22 16:54:20 +03:00
Indira Salyahova
aced89a655 fix: don't pass parametr inplace_statistic for weights (#10593) 2022-02-22 16:53:53 +03:00
Anastasia Kuporosova
5bb8f77c3f [Python API] Remove get/set_config methods from the PyOV (#10587) 2022-02-22 16:51:41 +03:00
Maxim Vafin
435584bb91 Support dynamic Broadcast and new pattern for TI condition (#9735)
* Support dynamic Broadcast and new pattern for TI condition

* Apply review feedback

* Fix broadcast if statement
2022-02-22 16:46:48 +03:00
Min, Byungil
487bb67995 Resolve onednn fc issue to enable bert-base (#10177)
+ Enabled bert-base-ber model
+ Resolve failure of onednn fc

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2022-02-22 22:23:45 +09:00
Maksim Kutakov
850f93f21b [CPU] INT8 tests for convolution sum fusing (#10359)
* int8 tests

* Sum second term port selection fix

* Fix after rebase
2022-02-22 15:42:26 +03:00
Tingqian Li
51ef938385 [CPU] fix crash in resnet binary model (#9761) 2022-02-22 15:23:20 +03:00
Tatiana Savina
6dc8b8b047 add note (#10566) 2022-02-22 14:50:37 +03:00
Anton Romanov
c80a872f73 Fix Coverity in samples (#10583)
* Fix coverity samples

* Fixed coverity issue in speech sample
2022-02-22 14:49:35 +03:00
Alexey Lebedev
a3004e7d80 [PYTHON API] reshape helper (#10402)
* Add reshape helper

* add dimension(range)

* Add partial_shape helper

* Fix code style

* fix comments

* Split reshape on several overloads

* Fix code style

* correct exception

* remove range support

* fix code style

* Add exception

* Dimension from str, PartialShape from str, reshape(str) support

* Apply review comments

* Add default init for shape

* Add PS syntax examples

* Remove pshape parsing from benchmark_app

* Update src/bindings/python/src/pyopenvino/graph/model.cpp

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>

* Update src/bindings/python/src/pyopenvino/graph/model.cpp

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>

* Apply suggestions from code review

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>
2022-02-22 14:48:55 +03:00
Ilya Lavrenov
991c9db1c1 Config api docs (#10563)
* Renamed hetero md

* Renamed some guides

* Updated OpenVINO_Runtime_User_Guide.md

* Updated plugin's page

* More updates

* Fixed links

* Updated link names

* Fixed links

* Fixed docs build

* Self-review

* Fixed issues in doc snippets
2022-02-22 14:32:57 +03:00
Sofya Balandina
3f15afb926 [IE TEST] Continue run after crash (#10037) 2022-02-22 13:55:51 +03:00
Pavel Esir
3d223ebc2a [MO] update error message when reverse infer was not successful (#10576)
* update error message when reverse infer was not successful

* corrected message when there are several undefined Parameters
2022-02-22 13:51:10 +03:00
Andrey Zaytsev
efd3c119fa Update Yocto documentation (#10547) (#10591)
* installing-openvino-yocto: fix documentation links

Point to the new Yocto docs website.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>

* Update installing-openvino-yocto.md

* installing-openvino-yocto: add step to checkout specific branch

Request users to checkout specific branch of meta-intel where this
version of OpenVINO is available.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>

Co-authored-by: Anuj Mittal <anuj.mittal@intel.com>
Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
2022-02-22 13:33:44 +03:00
Ivan Novoselov
6500ec775d [Snippets] Check for cyclic dependencies during ternary merge. (#10374) 2022-02-22 13:30:15 +03:00
Alexey Varyzgin
a3887f3328 [CPU] Transpose node optimized with Reorder (#10551) 2022-02-22 13:05:19 +03:00
Irina Efode
b7ead46943 [IE TESTS] Functional tests Review. Part 2 (#10476)
* [IE TESTS] Functional tests Review. Part 2

* tmp

* revert set_blob changes
2022-02-22 13:02:05 +03:00
Irina Efode
d57fb75ba6 migration to OV2.0 (#10562) 2022-02-22 12:58:07 +03:00
Mikhail Letavin
171ad9536f [GPU] Disable unrolling by default for LSTMsequence and TensorIterator having length>=16 (#10406) 2022-02-22 12:45:32 +03:00
Egor Duplensky
3f56438d06 [CPU] Align return types handling for all the new API parameters (#10363) 2022-02-22 12:42:24 +03:00
Ivan Tikhonov
472ebc0cd9 [TF FE] Add translators for ScatterND, Conv3DBackpropInputV2 ops (#10550)
* Add translators for ScatterND, ConvBackpropInputV2 ops

* add a new line
2022-02-22 12:20:32 +03:00
Maxim Shevtsov
5247fdfcaf avoiding layouts (#10560) 2022-02-22 12:15:19 +03:00
Nikolay Tyukaev
100fff83bf dynamic title tag (#10575)
* dynamic title tag

* dynamic title tag
2022-02-22 12:05:55 +03:00
Evgenya Stepyreva
4afd8667cf DO detachment (#10577) 2022-02-22 12:05:18 +03:00
Egor Duplensky
4075f8ed51 [CPU] Fix ScaleShift and FQ merge optimization (#9244) 2022-02-22 11:38:02 +03:00
Taylor Yeonbok Lee
746b77c74a [GPU] Revised unique ID setting scheme. (#10548)
* Revised unique ID setting scheme. Previously it was using program id to distinguish the loop body networks' id.
However, it results in cl cache miss for same network loaded multiple time, because program ids are differnt.
Now revised it to use parent primitive id instead of program_id for unique id of nodes in body networks.

* Revised adding unique_id to entry points to have a temporal number as unique id

* Revert the canceld change

* Added test to check whether two networks loaded from same function creates same cl cache
2022-02-22 09:34:46 +03:00
Liubov Talamanova
1891967ad3 [POT] Add quantization templates to wheel (#10557) 2022-02-22 09:11:43 +03:00
Andrew Kwangwoong Park
33062bef7a [GPU] Fix permute performance degradation (#10559)
* [GPU] Fix permute performance degradation

Signed-off-by: Andrew Kwangwoong Park <andrew.kwangwoong.park@intel.com>

* add description for update

Signed-off-by: Andrew Kwangwoong Park <andrew.kwangwoong.park@intel.com>
2022-02-22 11:35:04 +09:00
Andrey Zaytsev
aea0532d76 Fixed POT docs (#10574) 2022-02-22 02:15:58 +03:00
Edward Shogulin
5be402750a [LPT] FuseConvert transformation extension (#10558)
* [LPT] FuseConvert transformation extension

* [LPT] Tests

* [LPT] Cleanup & tests refactoring
2022-02-22 02:02:11 +03:00
Mikhail Letavin
d7ad1bd9cd [GPU] Extra graph transformation passes in case of Dynamic Batch for correct optimization behavior (#10561) 2022-02-22 00:40:26 +03:00
Maxim Gordeev
e7145bd343 [IE Samples] Changed input's tensor preprocessing for speech sample (#10552)
* Changed input's tensor preprocessing

* improved processing
2022-02-21 23:29:38 +03:00
Ilya Lavrenov
d26fd3aa22 Ability to fully override OUTPUT_DIR (#10524) 2022-02-21 22:39:26 +03:00
Mikhail Nosov
f82533005b [OV2.0] Preprocessing documentation (#10451)
* [OV2.0] Preprocessing documentation - first draft

* Small update

* Added ov::Layout overview

* Fix code style

* Preprocessing details - ~50% done

* Corrected links

* Fixed comments, added more docs

* Minor updates

* Couple more links

* Fixed comments

* Remove 'future' link
2022-02-21 19:20:23 +03:00
Nikolay Tyukaev
65d1575642 DOCS: ovms integration (#10528)
* ignore model server pages

* merge

* fixed link to ovms docs

* workbench fix

Co-authored-by: azaytsev <andrey.zaytsev@intel.com>
2022-02-21 18:48:29 +03:00
Vladislav Volkov
1d33c37970 [CPU] Issue in opset name determining (#10479) 2022-02-21 18:47:24 +03:00
Egor Duplensky
b7fede89c8 [CPU] Fix uninitialized reorder implementation type (valgrind, asan) (#10520) 2022-02-21 18:26:20 +03:00
Mateusz Tabaka
6bb8701651 Add MatMulConstTransposesExtraction transformation (#10412)
Transformation insert Transpose for MatMul's weights and
sets its transpose_b attribute to true.
If executed by MO, it helps to reduce LoadNetwork time on CPU plugin,
since ConvertMatMulToFC doesn't have to insert Transpose by itself.

Ticket: 78635
2022-02-21 16:08:28 +01:00
Fedor Zharinov
4decf16927 Set Latency performance mode in case of sync mode. (#10516) 2022-02-21 18:08:05 +03:00
Yuan Hu
09379dca86 [AUTOPLUGIN] add device priority if set ov::device::priorities (#10296)
* support config key device priority

for example:
if AUTO:CPU,GPU
the priority of CPU will be higher than GPU

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* add test and fix compile and test error

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* add an info for device priority and add lost [AUTOPLUGIN] on log

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* parseMetaDevice return all DEVICE of GPU, when use AUTO:GPU

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix compile issue

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* modify test and add test case, fix code issue

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix a bug and mutli with HETERO test failed

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix mock test faild issue

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix misprint

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* Disable AUTO:MYRIAD case

MYRIAD/CoreThreadingTests.smoke_QueryNetwork/targetDevice=MULTI_config=MULTI_DEVICE_PRIORITIES:MYRIAD_
faild on windows
the error is
myriadFuncTests-0 INFO: [E:] [BSL] found 0 ioexpander device

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* use ov::device::priorities key in this PR

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix a logic bug in key_network_priority after enable device priority

add test case cover it

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>
2022-02-21 23:06:51 +08:00
Irina Efode
ae42bf1e86 [IE TESTS] Functional test review. Part1 (#10328)
* [IE TESTS] Move Preprocess&Chacing tests to plugin. Add Cachinf tests for OV2.0

* Conformance

* Fix

* Apply Ilya's comments

* Update caching_tests.cpp

* Fixes

* Update mkldnn_plugin.cpp

* try to skip

* try to fix

* Fix cpu

* tmp
2022-02-21 16:22:01 +03:00
Gorokhov Dmitriy
f53f09f020 [CPU] Fixed legacy post ops behavior (#10542) 2022-02-21 16:09:29 +03:00
Ilya Lavrenov
68e873c6c8 Config and hetero (#10555)
* Updated properties documentation

* Fixed doc refernce

* merged snipet files

* fixed build

* Updated Hetero docs

* Self-review

Co-authored-by: Anton Pankratv <anton.pankratov@intel.com>
2022-02-21 16:01:47 +03:00
Alexey Lebedev
0ce255e56a [tools][benchmark_app] update readme (#10518)
* Save work

* update readme

* Name refactoring

* Remove duplicated readme

* Add note about default hint
2022-02-21 15:35:07 +03:00
Maksim Derbasov
11bf540018 Simple patch for fix random bool vector generation (#10493)
* Dirty patch for fix bool generation

* Bernoulli distribution for bool
2022-02-21 14:24:27 +03:00
Mikhail Ryzhov
5dbf2f7088 [GNA] Compact mode ordering fix (#10408)
* Compact mode ordering fix

* Fixed comment
2022-02-21 14:05:36 +03:00
Jan Iwaszkiewicz
206442fb19 [PYTHON] Add OV Types support to parameter and constant from opsets (#10489)
* Add OV Types to parameter and constant node factory, refactor tests and error handling

* Fix name mismatch in docstring

* Fix docs and hints
2022-02-21 12:45:55 +03:00
Yuan Xu
828d9d810a updating apt, yum, conda installation for 22/1 (#10219)
* Add Overview page

* update yum installation

* update apt installation

* update conda installation

* Revert "Add Overview page"

* Update docs/install_guides/installing-openvino-apt.md

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>

* update Ubuntu version format

* update as per review comments

* integrate comments

* update version format

* add a configurations chapter

* update

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-conda.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-apt.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* update comments

* Update docs/install_guides/installing-openvino-apt.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-yum.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* update references to OpenVINO Runtime User Guide

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>
Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-02-21 12:15:15 +03:00
Yuan Xu
cd77b33f3a docker installation updates for 22/1 (#10341)
* Add Overview page

* Revert "Add Overview page"

* update

* update install flows

* update

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* update structure

* small changes

* improve structure

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* integrate comments

* remove outdated note

* Update docs/install_guides/installing-openvino-docker-windows.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* Update installing-openvino-docker-windows.md

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* Update docs/install_guides/installing-openvino-docker-linux.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* integrate comments

* adding an issue: Permission Errors for `/dev/shm`

* Update docs/install_guides/troubleshooting.md

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>

* update comments

* fix mistake

* fix mistake

* fix a link

Co-authored-by: Ilya Naumov <ilya.naumov@intel.com>
2022-02-21 12:11:08 +03:00
Mateusz Tabaka
430e898c33 Add bf16, f64, i4, u4, i16, u16 types to Equal's evaluate (#10508)
* Add f64 type to Equal's evaluate

Required by t2t-vit models.

Ticket: 79610.

* add also i16 u16 because prior_box tests fail with "Check eval_status failed at"

* code style

* add i4, u4, bf16 to equal's evaluate
2022-02-21 11:37:17 +03:00
Maxim Andronov
1fa5d44769 [CPU] WA for MergeTransposeAndReorder after conv + sum (#10466) 2022-02-21 11:30:24 +03:00
Ivan Tikhonov
33ab7f9063 remove redundant node_context.hpp files, fix handling nodes with several output ports (#10484) 2022-02-21 10:27:11 +03:00
Maxim Andronov
31f517a3b4 [CPU] Fix error message for shape infer (#10522) 2022-02-21 10:16:29 +03:00
Ivan Tikhonov
e5d6f18366 [TF FE] Fix BatchToSpace op translator (#10511)
* use shape value, not rank in batch_to_space conversion

* codestyle

* resolve review comment
2022-02-21 10:14:08 +03:00
Tingqian Li
2cc6629624 [CPU] Avoid using xmm0 for input to store_emitter (#6566) 2022-02-21 10:02:31 +03:00
Nikita Demashov
f7a85c59fe [LPT] Disable Move Fake Quantize on shuffle channels pattern (#10389)
* added shuffle channels check

* refactoring
2022-02-21 10:01:37 +03:00
Ivan Tikhonov
e89c7ed8e5 Describe MakeStateful transformation in MO help (#10536)
* Update --transform help for MakeStateful transformation

* add quotes
2022-02-21 09:55:26 +03:00
Taylor Yeonbok Lee
73a6d50dbc [GPU] Fixed batch size again to 8 as a workaround of compiler restriction. (#10502) 2022-02-21 09:42:08 +03:00
Roman Lyamin
0ee6959537 [GPU] Replacing get_shape() with get_partial_shape() (#10525) 2022-02-21 09:41:24 +03:00
Andrew Kwangwoong Park
a7fff7447c Fix to extract scores for each class in consideration of background label's id (#10500)
Signed-off-by: Andrew Kwangwoong Park <andrew.kwangwoong.park@intel.com>
2022-02-21 15:35:44 +09:00
Andrei Molotkov
575ded54a9 [GPU] Move adding biases to the end convolution_bfyx_to_bfyx_f16 kernel (#10533) 2022-02-21 09:30:00 +03:00
Xuejun Zhai
ea3bd087c4 [CVS-78727][python version] bug fix for -d AUTO:CPU,GPU the return device should be AUTO only (#10506)
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2022-02-21 03:21:52 +00:00
Ilya Znamenskiy
7c93902dac [GPU] Fix issues with floating point fusings support for cldnn / onednn fully connected kernels (#10519)
* [GPU] Fix of floating point fusings inside fc kernels

* [GPU] Fix for related tests
2022-02-21 12:03:23 +09:00
Maxim Shevtsov
a52c755d21 refactor the perf counters to get really on-demand (rather than on every inference) (#10526)
* refactor the perf counters to get really on-demand (rather than on every inference)

* removed the (now) un-needed needPerfCounters flag
2022-02-20 20:56:15 +03:00
Maxim Vafin
982942fa5d Fix typo in CropAndResize translator (#10541) 2022-02-20 12:39:52 +03:00
Nikita Malinin
a312dd4a9f [POT] IEEngine output data order (#10527)
* IEEngine fix for multiply-output nets

* Update docstrings and docs

* Codestyle changes

* Update docs

* Update docstring

* Pylint
2022-02-20 09:44:04 +03:00
Alexander Kozlov
5c7be85435 [POT] Documentation update (#10068)
* Updated main README

* Added saturation fix desciption

* Changed Low-precision model representation document

* Added Simplified mode desciption. Updated DefaultQuantization, AccuracyAware, API descriptions.

* Added Data-free model description. Adjusted other Readmes accordingly

* Revised Configuration file description

* Revised AA method description

* Changed Quantization readme

* Cross-links in quantization methods

* Fixed reference

* Fixed the structure

* Removed data-free

* Update tools/pot/docs/CLI.md

Co-authored-by: Nikita Malinin <nikita.malinin@intel.com>

* Update tools/pot/openvino/tools/pot/api/README.md

Co-authored-by: Nikita Malinin <nikita.malinin@intel.com>

* Applied comments

* Fixed comments

* Applied more comment

* Applied comments

* Fixed build errors

* Fixed build errors

* Small changes

* Fixed a typo

Co-authored-by: Nikita Malinin <nikita.malinin@intel.com>
2022-02-20 09:43:14 +03:00
Alexey Lebedev
5671ca2cf5 add test (#10531) 2022-02-19 20:19:28 +03:00
Mingyu Kim
af62ff22b1 [GPU] Mixed precision fix for mask rcnn (#10467) (#10535)
* Select proper layout for fp16-int8 mixed precision network
* Set proper layout in layout propagation for mixed precision
2022-02-19 21:55:15 +09:00
Alexey Lebedev
661002689f latency mode is default for sync (#10521) 2022-02-19 05:58:51 +03:00
Maxim Vafin
71fdcdf899 Fix Unpack translator in TF FE (#10494)
* Fix Unpack translator in TF FE

* Apply review feedback
2022-02-19 02:52:48 +03:00
Anastasia Popova
2e164b4ddc AvgPool3D translator, fix of MaxPool translator in TF FE (#10530)
* Fixed MaxPool translator, added AvgPool3D translator.

* Update src/frontends/tensorflow/src/op/avg_pool.cpp

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>

* Code style.

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2022-02-19 02:47:01 +03:00
Pavel Esir
fb6359586d fix ConvertGroupedStridedSlice.py for XLNet (#10496) 2022-02-18 22:40:28 +03:00
Ilya Lavrenov
6b22d0d109 Revert "repair TF FE tests after build (#10432)" (#10523)
This reverts commit 306b7611d9.
2022-02-18 19:48:35 +03:00
Yuan Xu
c9bfd3bf8b Updating installation guide structure for 22/1 (#10343)
* Add Overview page

* update overview

* update install dev tools page

* Revert "Add Overview page"

* create overview page

* update movidius setup guide

* split the configurations for linux part to a separate topi

* split the general configurations for linux to a separate topic

* create a separate topic for configurations for vpu on windows

* create a separate topic on configurating gpu

* create a separate topic for configurations for ncs2

* update structure

* update structure

* update structure

* restructure

* update overview

* update

* update according to comments

* update structure

* update the structure

* correct naming

* correct naming

* update trademark symbol

* remove .bak file

* update

* test formatting

* update

* update

* fix errors

* add a leading sentence for GPU configurations

* update structure

* delete redundant files

* Update docs/install_guides/configurations-for-intel-gpu.md

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>

* Update docs/install_guides/configurations-for-ncs2.md

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>

* Update docs/install_guides/installing-openvino-config-ivad-vpu.md

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>

* fix formatting

* fix errors

* fix errors

* fix errors

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>
2022-02-18 19:47:00 +03:00
Svetlana Dolinina
d2177cf177 remove old protobuf eggs (#10473) 2022-02-18 18:12:23 +03:00
Gleb Kazantaev
b22585a696 Fix Coverity issue (#10510) 2022-02-18 18:00:40 +03:00
Alina Kladieva
7985c92095 Revert "[GPU] Mixed precision fix for mask rcnn (#10467)" (#10515)
This reverts commit 10ac5b280b.
2022-02-18 16:38:49 +03:00
Anton Voronov
d9b1f10074 [CPU] [OneDNN] disabled unused amx primitives and conv primitives (#10326) 2022-02-18 16:36:49 +03:00
Katarzyna Mitrus
f52f129ed8 [Python API] Improvement of dynamic reshape error message in compatibility ie (#10495)
* Add test_reshape_dynamic to tests compatibility

* Catch OverflowError on dynamic dimension reshape
2022-02-18 14:23:10 +03:00
Zhang Yi
ba9d18f181 [CPU] Parallel copy for output in case data doesn't fit L2 cache capacity (#10340) 2022-02-18 13:16:51 +03:00
Ilya Churaev
a18c8076cc Removed obsolete documentation (#10504)
* Removed obsolete documentation

* Fixed documentation

* Additional fix
2022-02-18 13:02:55 +03:00
Ekaterina Aidova
e8ff31f4fb [OMZ]: update submodule (#10490) 2022-02-18 12:58:38 +03:00
Roman Kazantsev
20266dd0c3 [MO] Upgrade TensorFlow version dependency due to SNYK hits (#10487)
* [MO] Upgrade TensorFlow version dependency due to SNYK hits

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Still use 2.5.0 TensorFlow for Python 3.6 and older

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2022-02-18 12:29:58 +03:00
Anton Voronov
7a82bb2acb [CPU] fixed including <cpuid.h> on android (#10482) 2022-02-18 11:50:38 +03:00
Andrey Somsikov
dea35b8e6e Upgrade protobuf to 3.18.2 (#10435)
* Upgrade protobuf to 3.19.4

* Upgdate precompiled protoc version

* Update protobuf to v3.18.2

Updating further peding this fix to be released
https://github.com/protocolbuffers/protobuf/pull/9437

* Disable warnings for protobuf
2022-02-18 11:43:19 +03:00
Nikita Semaev
03862e780f Fixing SetUp for SLT tests of ShapeOF (#10323)
* Fixing SetUp for SLT tests of ShapeOF

* Attempting to pass outputPrecision into the test

* Correcting deficiencies, taking into account in the name of the test of the output precision
2022-02-18 10:37:39 +03:00
Jacek Skowron
3a89c87f52 [DOCS] update install guides gifs (#10444) 2022-02-18 10:31:42 +03:00
Maxim Shevtsov
dcd6e3e961 removed unsed var and fixed mixup from code shuffling (#10492) 2022-02-18 10:05:23 +03:00
Xuejun Zhai
2ac15eae3d [CVS-78727] bug fix for -d AUTO:CPU,GPU the return device should be AUTO only (#10417)
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2022-02-18 09:56:56 +03:00
Edward Shogulin
17311c46b3 [LPT] checkElementwise extending for 1D tensor (#10498) 2022-02-18 09:41:17 +03:00
Anton Romanov
b8ac041da9 Fixed coverity issues in samples (#10421)
* Fixed coverity issues

* Fixed coverity isuues samples part 2

* Fixed code style

* Delete goto

* update after comments
2022-02-18 08:08:09 +03:00
Vitaliy Urusovskij
76ade7a7d0 Update docstrings with information about static build (#10488) 2022-02-18 07:48:58 +03:00
Xuejun Zhai
9b36daf23b Modify for CVS-69023(python version): hint configuration (#10312)
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2022-02-18 09:40:27 +08:00
guozhong wang
2d88e67616 Guozhong/remove format time (#9923)
* remove formatTimeMilli from time_utils.cpp

* add traceCallStacks test case

* add traceCallStacks test case in format_test.cpp

* add param:"test" to function TraceCallStacks()

* rollback file in master branch

* add traceCallStacks test case in format_test.cpp

* remove formatTimeMilli from time_utils.cpp and add traceCallStacks test case in format_test.cpp
2022-02-18 09:36:01 +08:00
Mingyu Kim
10ac5b280b [GPU] Mixed precision fix for mask rcnn (#10467)
* Select proper layout for fp16-int8 mixed precision network
* Set proper layout in layout propagation for mixed precision
2022-02-18 10:27:54 +09:00
hyunback kim
215db2dad8 [GPU] Enable shuffle and fsv32 in implicit concat (#9888)
[GPU] Enable shuffle and fsv32 in implicit concat

* Support shuffle fsv32
* Check feature depths in first input depedency.
* Add to select onednn convolution in case block format in get_preferred_impl_type func.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-18 09:40:14 +09:00
Vladislav Volkov
b6a75d7d91 CPU plugin namespaces and files renaming (#10248) 2022-02-17 23:48:26 +03:00
Nikolay Tyukaev
7fa9d07a1f ignore api/reference.rst warnings (#10491) 2022-02-17 23:13:09 +03:00
Maxim Vafin
f482f9765e Fix values reading from protobuf (#10391)
* Fix values reading from protobuf

* Remove exception

* Small fix
2022-02-17 21:42:49 +03:00
Maxim Vafin
ac880f601c Fix getting attribute in TF FE (#10458)
* if attribute is not present and default value provided it should return default value
2022-02-17 20:30:04 +03:00
Anton Grishin
b8bbe056b1 Improve l-capturing (#10468) 2022-02-17 19:17:07 +03:00
Artur Kulikowski
73caba0f67 Fix ONNX boolean tests (#10404) 2022-02-17 15:31:11 +00:00
Nikita Malinin
a090abbc92 Update remove_converts pass with shape inference (#10474) 2022-02-17 18:17:07 +03:00
Yegor Kruglov
6e5eb87340 Add note to YOLO-v3 conversion instructions (#10428)
* added note to yolo v3 conversion instructions

* fix typo

* Update docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_YOLO_From_Tensorflow.md

style fix

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-02-17 18:00:38 +03:00
Ivan Tikhonov
ade4c6c7f9 OpExtension: fix framework attributes handling (#10445)
* Fix attribute handling in OpExtension, add unit tests

* add missed file

* fix warning

* fix warning

* rename convert_from_py_object method to py_object_to_any, fix PEP8

* fix PEP8

* delete redundant include dir, fix includes
2022-02-17 17:42:12 +03:00
Anton Pankratov
61f657795c Streams property with special values (#10411)
* Streams  property with special values

* Fixed clang
2022-02-17 16:39:06 +03:00
Fedor Zharinov
198f44fdc7 Fix for missing throughput in case of Multi device (#10407)
* Fix for missing throughput in case of Multi device

* stylefix
2022-02-17 16:32:19 +03:00
Ilya Lavrenov
306b7611d9 repair TF FE tests after build (#10432)
* repair TF FE tests after build

* Small improvements

* Fixed static build
2022-02-17 16:28:24 +03:00
Maxim Gordeev
3144c5fab8 Added processing of layout for speech sample (#10254)
* Added processing of layout for speech sample

* fixed notes

* some improvements

* Code style format

* changed NCC value for NullStatement

* improved batch processing

* added loading batch for imported model

* fixed notes

* fixed notes

* added layout parameter to azure tests
2022-02-17 16:11:57 +03:00
Irina Efode
ccd7104108 [IE TESTS][CONFORMANCE] Add support of dynamic shapes in SubgraphDumper (#10380)
* Initial commit. Need to remove debug code

* Remove extra flags. Fix comparation in the matchers

* Fix small issue with the default args

* Update eltwise.hpp

* Update ov_subgraph.cpp
2022-02-17 15:52:37 +03:00
Nikolay Tyukaev
fc1157cf68 add api folder if enable python (#10477) 2022-02-17 15:24:29 +03:00
Egor Shulman
8ae4bc95fd [CPU] Coverity fixes (#10392) 2022-02-17 15:11:18 +03:00
Anton Pankratov
0882f863d6 Any compilation time optimization (#10335)
* Optimized any compilation time

* Fixed Any  compilation time

* any::addressof

* reverted

* Fixed read write

* format fix

* Fixed build

* format fix

* Moved any tests back

* removed inline

* fix format

* used static inline

* format fix

* removed inline static

* fixed merge confkicts
2022-02-17 14:55:37 +03:00
Anton Pankratov
7ce9801ec3 Added mkldnn ov properties test for compile_model (#10442)
* Added mkldnn ov properties test

* fixed  macos build
2022-02-17 13:54:02 +03:00
Anton Pankratov
d1378d94b8 Fixed default inference precision in benchmark app (#10443) 2022-02-17 13:53:50 +03:00
Vladislav Golubev
ff4e97ab09 [LPT] Security fixes (#10465) 2022-02-17 13:47:27 +03:00
Anton Chetverikov
e444715c8d [MO] Restore inputs order in IR Reader (#10403)
* Restore inputs order in IR Reader

* Add saving of outputs order
2022-02-17 13:07:34 +03:00
Tomasz Dołbniak
83a8ac800c ONNX model validator enhancements (#10456) 2022-02-17 11:01:47 +01:00
Anton Voronov
61f915b4f6 [CPU] changed checks with_cpu_x86...() to mayiuse() (#9911) 2022-02-17 12:56:55 +03:00
Pavel Esir
43784e2cec fix convert_nms_gather_path_to_unsigned: added opset8::Slice into patter_list (#10439) 2022-02-17 12:47:25 +03:00
Aleksandr Korolev
8abb949af9 [VPU] Coverity fixes (#10396)
Tickets:
-79244
-78866
2022-02-17 12:29:28 +03:00
Aleksandr Korolev
5ace7bb96f [MYX] Added missing supported properties in GetMetric method (#10440) 2022-02-17 12:23:41 +03:00
Anton Pankratov
a7b28953e2 Added Import export device capability into hetero plugin (#10455) 2022-02-17 12:15:45 +03:00
hyunback kim
8148921fa7 [GPU] Fix deconv b32 onednn regression in onednn (#10462)
After enabling deconv b32 onednn, colorization-siggraph f16 b32 has regresison,
Fix it. Add to check sum post ops in case deconv onednn.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-17 18:09:51 +09:00
Irina Efode
68f523010e [IE TESTS][CONFORMANCE] Support dynamic shapes in Operation Conformance (#10400)
* emove namespeca unity

* [IE TESTS][IE CONFORMANCE] Suppot dynamic shapes in Operation Conformance runner

* Update CMakeLists.txt

* Fix dim generation
2022-02-17 11:27:45 +03:00
hyunback kim
ed323afc93 [GPU] Remove default bfyx quantize in get_preferred_format (#9654)
* [GPU] Remove default bfyx quantize in get_preferred_format

Default bfyx occurs redundant reorder in fsv-format network.
And remove onednn concat limitation for depdendency input should be
onednn impl.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-17 17:25:55 +09:00
Taylor Yeonbok Lee
d35335193a [GPU] Adjust build batch size to 9 from 10 due to the compiler limitation w.r.t the entire module size (#10450) 2022-02-17 11:01:31 +03:00
Anastasia Kuporosova
861d43e06d [Python API] Fix benchmark hanging (#10457) 2022-02-17 10:59:55 +03:00
Liubov Talamanova
be6a3c34f1 [POT] Throw exception for IRv10 (#10345)
* [POT] Throw exception for IRv10

* Update reference models

* Updated AC framework name from dldt to openvino
2022-02-17 10:54:08 +03:00
Vladimir Dudnik
29883a152a fix 79520 (#10449) 2022-02-17 10:52:30 +03:00
Egor Shulman
ff293f5560 [CPU] Disable display of constant layers in PerfMap (#10307) 2022-02-17 10:51:07 +03:00
Egor Duplensky
541627d319 [CPU] [SANITIZER] Avoid possible stack-use-after-scope (#10377) 2022-02-17 10:27:58 +03:00
Ivan Tikhonov
3597ae61f9 Fix increased build time and memory consumption caused by multiple ov::Any instantiation (#10452)
* Fix increased build time and memory consumption caused by multiple instansion of ov::Any.

* delete unused method, correct exception message

* codestyle

* Resolve review comment

* fix exception: throw it in else branch
2022-02-17 09:08:55 +03:00
Gleb Kazantaev
926460e603 Fix Coverity issues (#10427) 2022-02-17 08:54:57 +03:00
Mateusz Tabaka
ab4a11b3bd Remove unnecessary AutoBroadcastSpec parameter in MatMulMultiplyFusion (#10005) 2022-02-17 08:51:32 +03:00
Julia Kamelina
1fc61299c8 update omz submodule (#10441) 2022-02-17 00:50:21 +03:00
Tomasz Dołbniak
90a100d5f6 Default opset bump in ONNX FE (#10437) 2022-02-17 00:47:07 +03:00
Fedor Zharinov
00abcbacc4 Fix for Layout and image_info related issues (#10258)
* bugfix78627

* stylefix

* fix
2022-02-17 00:42:51 +03:00
Maxim Vafin
5cadee20eb Fix issue with constants having inputs in TF FE (#10393) 2022-02-16 20:40:23 +03:00
Andrey Zaytsev
abeb910ce2 Removing the old Intel logo from docs (#10429)
* Added info on DockerHub CI Framework

* Feature/azaytsev/change layout (#3295)

* Changes according to feedback comments

* Replaced @ref's with html links

* Fixed links, added a title page for installing from repos and images, fixed formatting issues

* Added links

* minor fix

* Added DL Streamer to the list of components installed by default

* Link fixes

* Link fixes

* ovms doc fix (#2988)

* added OpenVINO Model Server

* ovms doc fixes

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>

* Updated openvino_docs.xml

* Updated the link to software license agreements

* Revert "Updated the link to software license agreements"

This reverts commit 706dac500e.

* Removed the Intel logo

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>
2022-02-16 17:26:26 +03:00
Yuan Xu
4f000b780d update pypi installation (#10217)
* Add Overview page

* update pypi installation

* Revert "Add Overview page"

* integrate review comments

* update formatting

* Update docs/install_guides/installing-openvino-pip.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-pip.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/install_guides/installing-openvino-pip.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

Co-authored-by: Adrian Boguszewski <adekboguszewski@gmail.com>
Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-02-16 17:09:56 +03:00
Egor Shulman
5bf9631073 Fixed ProfilingInfo layer status (#10342) 2022-02-16 16:10:19 +03:00
Anton Grishin
05650551b7 [GNA] Fix static analyzer issues (#10379)
* fix incorrect braces

* move pointer check

* add pointer check to VerifyConcat

* Prevent iterator invalidation
2022-02-16 15:46:32 +03:00
Ilya Churaev
434d7bbecc Fixed 4458 warning for Windows (#10418) 2022-02-16 11:39:43 +00:00
Anton Pankratov
5b8b698f88 Fixed ICore GetSupportedProperties (#10394)
* Added ICore::get_property

* Added tests

* Format fix

* All properties
2022-02-16 14:36:01 +03:00
Andrey Noskov
7a24f53b57 [GNA] Moved am_intel_dnn tests (#10294)
* [GNA] am_intel_dnn tests moved from deprecated tests

* fixed code style

* [GNA]fixed copyright date
2022-02-16 14:21:12 +03:00
Andrey Noskov
e2948a807c [GNA] Moved cpp_wrapper test (#10297)
* [GNA] Moved cpp_wrapper test

* [GNA] fixed copyright data
2022-02-16 14:19:29 +03:00
Nadezhda Ageeva
fc5a416423 [SAMPLES][GNA] Update C++ speech sample with new config API (#10357)
* [SAMPLES][GNA] Update speech sample with new cofig API

* Review comments

* Some additional checks
2022-02-16 13:23:50 +03:00
Alexander Zhogov
2e71fccd82 Azure CI: Disable tests on Mac due to long building 2022-02-16 13:12:06 +03:00
Anton Dudchenko
483b3828ca [VPU] Enable CheckTensorPrecision tests (#10390)
Enable CheckTensorPrecision tests for the myriad plugin.
-75944
2022-02-16 13:06:13 +03:00
Artyom Anokhov
ba69bae055 [Scripts] Remove MacOS install dependencies (#10397)
* OpenVINO scripts: Removed legacy install install_guide.html. Removed installation of scripts for MacOS

* scripts/CMakeLists: optimized if case
2022-02-16 12:52:57 +03:00
Chen Xu
4d954d0c13 [CPU] Fix the unnecessary calculation of blk_stride for dynamic shape (#10385) 2022-02-16 12:20:01 +03:00
Andrew Kwangwoong Park
2a1d8d7e99 [GPU] Minor fix for dump layer (#10291)
- Replace find with compare func to avoid dumping all layers that contain layer name

Signed-off-by: Andrew Kwangwoong Park <andrew.kwangwoong.park@intel.com>
2022-02-16 12:02:28 +03:00
Nikolay Tyukaev
0c4d50239a update requirements to fix tabs (#10409) 2022-02-16 11:47:11 +03:00
Gleb Kazantaev
709084888a Remove deprecated classes from openvino headers (#10371)
* Remove deprecated classes from openvino headers

* Fix tests
2022-02-16 11:41:16 +03:00
Ilya Churaev
0b27fb80b1 Fix for new coverity issues (#10378)
* Fix for new coverity issues

* Fixed cc coverity

* Fixed code style

* Revert some changes

* Fixed build
2022-02-16 11:12:24 +03:00
Nikita Malinin
c8ce93290e [POT] Sync mode only for gna_sample (#10355)
* Sync mode only for gna_sample

* Disable test
2022-02-16 11:00:13 +03:00
Vladimir Zinoviev
e22a2b3076 [CommonTransformations] Fix default output take from Split/VariadicSplit (#10395) 2022-02-16 10:59:11 +03:00
Mateusz Bencer
0a056857c5 fix handling stride_y (#10398) 2022-02-16 07:57:56 +00:00
Mingyu Kim
c0d54e48bb [GPU] Bugfix for onednn post op optimization (#10416)
When post-op has pattern like below, binary_mul was ignored previously.
1. binary_add
2. eltwise_linear
3. binary_mul
4. binary_add

It happens when prev_post_op_idx == 2, cur_post_op_idx == 4.
prev_post_op_idx was supposed to proceed to idx 3, but it did not.
2022-02-16 10:44:42 +03:00
Vladislav Golubev
fa4246d531 [LPT] Security fixes (#10381) 2022-02-16 10:31:17 +03:00
Taylor Yeonbok Lee
cbb5dff9c1 Fix coverity errors (#10384) 2022-02-16 10:10:10 +03:00
Ivan Tikhonov
06eb74b77f Fix MakeStateful transformation: use tensor names instead of friendly names (#8997)
* Use tensor names instead of friendly names, handle one output tensor to several Result ops case

* fix python tests

* fix python test

* fix incorrect merge

* remove redundant files

* fix variable names generation, fix python test

* Apply review comments

* fix python test
2022-02-16 09:26:31 +03:00
Jan Iwaszkiewicz
e71f23fc7e [PYTHON] Add __repr__ to main objects (#10365) 2022-02-15 21:30:33 +00:00
Evgenya Stepyreva
d14f1e54a5 MatMul Shape Inference (#10348)
* Proper dynamic dimension broadcasting

* make shape infer race condition reproducer

* Use ngraph only

* MatMul shape inference

* Style

* Dynamic rank case covered

* Build fix

Co-authored-by: Maksim Kutakov <maksim.kutakov@intel.com>
2022-02-16 00:22:46 +03:00
Vladimir Dudnik
eda4cbf30e [OMZ] rest of public models with layout (#10293)
* update OMZ submodule, rest of public models with layout

* sync with PR-10150

* ac fixes for WB

* fix CVS-78616
2022-02-15 23:42:41 +03:00
Maxim Shevtsov
317b956d2e fixed possible situation when auto-batching returns zero requests (#10388) 2022-02-15 15:13:25 +00:00
Mikhail Nosov
d5e8e0fb88 Fix coverity findings - add nullptr check before dereferencing (#10375)
Even though it is not possible to hit into this situation using existing plugins - there is theoretical possibility that some plugin may return 'nullptr' as it is allowed.
So this check shall remain in generic part which should not rely on plugin-specific behavior
2022-02-15 18:01:05 +03:00
Maxim Andronov
dc905f972a [CPU] AdaptivePooling child edges number check fix (#10372) 2022-02-15 17:59:51 +03:00
Ivan Novoselov
fa6865d569 [CPU] Disable MatMul+FQ(I8 out) if MatMul cant execute in I8 (#10316) 2022-02-15 17:59:06 +03:00
Maxim Vafin
0793a56260 Fix Conv3D translator in TF FE (#10387) 2022-02-15 17:53:13 +03:00
Mikhail Letavin
f150e2ad09 [GPU] Remove debug suffix from OpenCL.dll on Windows (#10361) 2022-02-15 16:43:40 +03:00
Sergey Lyubimtsev
498d865ea6 Correction for install guides: (#10373)
- OpenVINO installer path for macOS
- Default install pathnon macOS
- Red Hat Enterprise Linux 8.x, 64-bit is not part of IRC installer
2022-02-15 16:22:26 +03:00
Gleb Kazantaev
b837b7e32c Fix Coverity Isues (#10376) 2022-02-15 15:26:04 +03:00
Pavel Esir
121d59aa80 [MO] move importlib-metadata into setup.py (#10319)
* handle 'and' marker in requirements

* Revert "handle 'and' marker in requirements"

This reverts commit 952bb949ca.

* moved importlib-metadata from requirements.txt into setup.py
2022-02-15 15:01:27 +03:00
Indira Salyahova
f1557c06de [POT] Fix inference sample in fbc when get list prediction (#10159)
* fix: inference sample in fbc when get list prediction

* update reference metrics
2022-02-15 14:42:40 +03:00
Wilson Seok
e168c9b1c3 Add slt in template plugin/tensor iterator (#9692)
* Remove fp16 of Convert layer test from skip_tests.config.cpp as it works now

* update repo

* add initial op reference code of TensorIterator with LSTM body function

* add GRU/RNN case in setup

* add all other test cases

* add visitor api test

* remove unnecessary header files

* fix clang-format issue

* fix copyright year and remove ngraph_helper namespace

* rename ti.cpp to tensor_iterator.cpp in core unit test

* apply suggestions
2022-02-15 13:48:18 +03:00
Ivan Novoselov
68c390f679 [Snippets][CPU] MKLDNNSnippetNode adopts canBeInPlace logics from eltwise node (#10334) 2022-02-15 13:13:35 +03:00
Maksim Kutakov
788a5bb9f2 [CPU] Convolution plus sum fusing in the case of dynamic shapes (#10235) 2022-02-15 13:12:07 +03:00
Anastasia Kazantaeva
ccc38d22a8 Upgrade MO message for 2022.1 (#10315) 2022-02-15 13:10:45 +03:00
Alexander Zhogov
2b8e1ec49a Azure CI: no ARM triggers on docs/* (#10322)
* Azure CI: no triggers on docs/*

* Remove "PR:"
2022-02-15 13:04:44 +03:00
Taylor Yeonbok Lee
f5283300f0 Reduced available host VRAM & phys mem limitation (#10360) 2022-02-15 19:01:05 +09:00
Mateusz Tabaka
a875f6ed9c Add transformation that aligns elementwise input ranks (#10125)
* [CPU] Add transformation that aligns elementwise input ranks

* fix tests - check also aBcd16b format

* add support for fq

* add test for sqr diff

* move to moc transformations

* fix tests

* align only for numpy autobroadcast type

* fix fetching autob from fq

* [CPU] Eltwise tests corrected & callback for CPU removed

* remove transformation callback call

* revert changes to getMKLDNNOutputMemoryFormats

* remove comment

* use single wrap_type

Co-authored-by: Vladislav Golubev <vladislav.golubev@intel.com>
2022-02-15 12:47:54 +03:00
Ilya Znamenskiy
523adff17a [GPU] Fully connected int8 optimizations, some fixes, better fused ops support (#10035) 2022-02-15 12:33:16 +03:00
Andrei Gorbachev
64812fd635 [GPU] disable options in batch compilation (#10311) 2022-02-15 08:50:58 +00:00
Ilya Znamenskiy
0099755434 [GPU] Gemm opt tile_n min size fix (#10369) 2022-02-15 11:48:02 +03:00
Artur Kulikowski
004daca1fa Clear outputs vector after run TestCase (#10279) 2022-02-15 09:41:01 +01:00
wood-ghost
ded2d00711 Add paddle logical and reduce ops support. (#10352) 2022-02-15 16:23:50 +08:00
Anton Pankratov
39c90e9d48 Streams number fix (#10336)
* Streams number fix

* fixed perfomance hint

* fixed format

* removed dbg

* simplified code

* reverted becnhmark_app
2022-02-15 08:04:45 +00:00
Bartek Szmelczynski
2b03d5fe66 [MO args][ONNX FE]fix cutting graph with input, output or both (#9698)
* fix cutting graph with input, output or both

* fix collisions

* add regex

* revert changes to regex, fix decond_name_with_port function

* fix collisions

* optimize try_get_node function

* swap bool with enum

* revert accidental import

* optimize the code

* Update tools/mo/unit_tests/mo/moc_frontend/moc_extractor_test_actual.py

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update tools/mo/unit_tests/mo/moc_frontend/moc_extractor_test_actual.py

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update tools/mo/unit_tests/mo/moc_frontend/moc_extractor_test_actual.py

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update tools/mo/unit_tests/mo/moc_frontend/moc_extractor_test_actual.py

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* Update tools/mo/unit_tests/mo/moc_frontend/moc_extractor_test_actual.py

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>

* remove redundant check

* fix wrong nodes returns

* fix decode_with_port_name implementation, add comments

* reduce code duplicates

* remove redundant imports

Co-authored-by: Mikhail Nosov <mikhail.nosov@intel.com>
2022-02-15 10:55:40 +03:00
Vladislav Golubev
d48dd1f26c [Transformaitons] BatchNormDecomposition fix (#10310)
* [Transformaitons] Changed BN decomposition

* matcher updated to cover dynamic shape in opset1 case

* BatchNormDecomposition: added positive test-cases

* removed WA
2022-02-15 10:48:30 +03:00
Alexey Lebedev
e85c473d59 [tools] fix bin processing in benchmark app (#10366)
* fix bin reading

* Remove unsupported type
2022-02-15 10:34:14 +03:00
Indira Salyahova
acf6185bf3 Update load image in sample (#10223) 2022-02-15 10:18:27 +03:00
Mingyu Kim
13c024b7a3 Remove unnecessary cout message (#10346) 2022-02-15 16:14:56 +09:00
Ilya Churaev
8020a7abcc Disabled LTO for frontend_common (#10362) 2022-02-15 06:03:20 +00:00
bell
f75e50cc88 limit gpu compiling threads (#10349)
* limit gpu compiling threads

Signed-off-by: fishbell <bell.song@intel.com>

* switch to 2.0

Signed-off-by: fishbell <bell.song@intel.com>

* clang format

Signed-off-by: fishbell <bell.song@intel.com>
2022-02-15 08:52:49 +03:00
Maxim Andronov
c3c52bae63 [CPU] Convolution caching support (#9954) 2022-02-15 08:47:03 +03:00
Anton Chetverikov
84ee38d89e [MO] Move redundant checks in ScatterUpdate operation shape infer (#10306)
* Add extender for ScatterUpdate operation

* Remove scatterupdate extender

* Remove redundant checks in Scatter shape inference function

* Move checks to ScatterElementsUpdate operations

* mava checks to appropriate place
2022-02-15 04:55:38 +03:00
Jacek Skowron
a0ad849c19 [DOCS] add install guides minor changes (#10317)
* [DOCS] add minor changes to install guides

[DOCS] add minor changes to install guides

[DOCS] add minor changes to install guides

[DOCS] add minor changes to install guides

[DOCS] add minor changes to install guides

[DOCS] add minor changes to install guides

* [DOCS] add minor changes to install guides
2022-02-15 02:43:50 +03:00
Maxim Andronov
1ab9c07ccd [CPU] Skip dynamic tests which executed via legacy API (#10358) 2022-02-15 00:45:50 +03:00
Daniil Lyakhov
2f9c5df271 [Ngraph transformation][Pruning]Matmul ops pruning support (#10211)
* Linear pruning support

* Minor fix

* Fix types

* Fix: stop 1d multiply propagation
2022-02-14 22:00:29 +03:00
Mikhail Nosov
2f876e3b5b Fix ONNX's PriorBoxClustered accuracy (#10091)
* Fix ONNX's PriorBoxClustered accuracy
If step_heights == 0 and step_heights == 0, but 'step' is 16, then we should treat this as both = 16

* Removed workaround for ONNX frontend
2022-02-14 20:55:41 +03:00
Alexey Lebedev
d3712a148b [tools] cross check tool with api 2.0 (#10058)
* save work

* save work

* save work

* basic changes with api 2.0

* Support input file mapping and bin files

* Some impovements

* remove mapping support

* Add -ref_layers parameter

* Fix error handler

* Update Readme and remove old parameters

* Fix readme

* remove info about precision

* rename layer to op

* rename blob to tensor

* remove info about shape

* remove unused imports
2022-02-14 20:25:31 +03:00
Katarzyna Mitrus
0050643e9b Add BroadcastConstRangeReplacement transformation (#10318) 2022-02-14 19:42:51 +03:00
Dmitry Pigasin
3a5d821219 [IE Python Sample] Update docs (#9807)
* update hello_classification readme

* update classification_async readme

* update hello_query_device readme

* Fix hello_classification launch line

* Update hello_reshape_ssd readme

* update speech sample docs

* update ngraph sample docs

* fix launch command

* refactor py ngraph imports

* Replace `network` with `model`

* update example section with openvino-dev

* Update samples/python/classification_sample_async/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/classification_sample_async/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/hello_classification/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/hello_classification/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/hello_reshape_ssd/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/ngraph_function_creation_sample/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/ngraph_function_creation_sample/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/ngraph_function_creation_sample/README.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Update samples/python/ngraph_function_creation_sample/README.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Replace `Inference Engine` with `OpenVINO`

* fix ngraph ref

* Replace `Inference Engine` by `OpenVINO™ Runtime`

* Fix IR mentions

Co-authored-by: Vladimir Dudnik <vladimir.dudnik@intel.com>
Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>
Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-02-14 19:03:45 +03:00
Dmitry Pigasin
310eb81403 [IE Samples] Update docs for C++ samples (#9937)
* update hello classification readme

* update hello classification readme

* update classification async readme

* replace `network` with `model`

* update example section with openvino-dev

* update hello query device readme

* Update hello reshape readme

* Update ngraph func creation readme

* update speech sample readme

* update hello nv12 readme

* Apply suggestions from code review

review comments accepted

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Replace `Inference Engine` with `OpenVINO`

* fix model ref

* Replace `Inference Engine` by `OpenVINO™ Runtime`

* Fix IR mentions

Co-authored-by: Vladimir Dudnik <vladimir.dudnik@intel.com>
Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>
2022-02-14 19:03:19 +03:00
Egor Duplensky
3fcff15166 [CPU] Fix performance hint property handling (#10351) 2022-02-14 18:42:57 +03:00
Ilya Lavrenov
2d3bd40c3d Removed dead code (#10331) 2022-02-14 17:57:27 +03:00
Katarzyna Mitrus
e1197065fe [Docs] Add Slice-8 op cpp constructors docs (#10320) 2022-02-14 17:46:45 +03:00
Xuejun Zhai
9b41aa707d Modify for CVS-69023: hint configuration (#10259)
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2022-02-14 17:46:11 +03:00
Gleb Kazantaev
a3d5b6501d Fix get_constant_from_source (#10350) 2022-02-14 16:03:12 +03:00
Pavel Esir
d1477b8569 fixed setting 'out_ports_count' in ir_reader (#10265) 2022-02-14 16:01:22 +03:00
Mateusz Tabaka
08eb4766f2 [CPU] Don't change inputs child precision if it has Subgraph consumers (#10238) 2022-02-14 15:54:35 +03:00
Andrey Zaytsev
25bd2c8aee Feature/azaytsev/docs dlsteamer revision (#10155)
* Added info on DockerHub CI Framework

* Feature/azaytsev/change layout (#3295)

* Changes according to feedback comments

* Replaced @ref's with html links

* Fixed links, added a title page for installing from repos and images, fixed formatting issues

* Added links

* minor fix

* Added DL Streamer to the list of components installed by default

* Link fixes

* Link fixes

* ovms doc fix (#2988)

* added OpenVINO Model Server

* ovms doc fixes

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>

* Updated openvino_docs.xml

* Updated the link to software license agreements

* Revert "Updated the link to software license agreements"

This reverts commit 706dac500e.

* Revised dlstreamer documentation

* Minor edits

* Fixed link

* Fix

* Edits after review

* Shorten DL Streamer name in the TOC

* Update documentation.md

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>
2022-02-14 12:43:52 +00:00
Maxim Andronov
9ac542c455 [CPU] Restore legacy SetBlob and GetBlob to API 1.0 version (#10094) 2022-02-14 15:35:13 +03:00
Daniil Lyakhov
56be1a5438 Change User Transformations applying order in MO (#10241)
* Fix user transformation order in mo

* Move user transformation behind FP16 compression

* Move user transformation call before fp16 compression
2022-02-14 15:06:09 +03:00
Tomasz Dołbniak
a9b6eaf5c0 Multiple ONNX opset imports handling (#10332) 2022-02-14 12:59:41 +01:00
Dmitry Pigasin
9b1e4b801b Add -layout option (#10272) 2022-02-14 14:47:10 +03:00
Nikolay Shchegolev
3cb7592607 [CPU] Gather node. Support case with batchDims == indicesRank. (#10170) 2022-02-14 14:44:10 +03:00
Gorokhov Dmitriy
be4464ca2b [CPU] Migrated legacy post ops mechanism on runtime data pointers (#9938) 2022-02-14 14:17:45 +03:00
Jan Iwaszkiewicz
9e89ee2478 [PYTHON] New Python docs and refactor/improvements (#10032) 2022-02-14 10:24:33 +01:00
Irina Efode
7ff5f5ea70 [IE TESTS][IE CONFORMANCE] Move Read_ir tests to Conformance (#10300) 2022-02-14 12:15:37 +03:00
hyunback kim
c5b26bc10c [GPU] Support deconv double blocked format for b=32 (#10164)
* [GPU] Support batch32 deconv onednn

onednn rls-v2.6-pc2 support deconv batch32,
so remove the batch size limitation.

Signed-off-by: hyunback <hyunback.kim@intel.com>

* Update to merge duplicated checking onednn condidton in deconv.

Signed-off-by: hyunback <hyunback.kim@intel.com>

* Update to use is_node_for_onednn func in get_preferred_impl_type

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-14 17:39:26 +09:00
Anastasia Kuporosova
931f4c077d [Python API] Update python test installation (#10283) 2022-02-14 11:24:29 +03:00
Anton Pankratov
be8e15c180 fix HETERO with branching without splits (#10325)
* Default value of streams in ba is AUTO

* Fixed hetero cases with branches

* Fixed format
2022-02-14 10:36:41 +03:00
Roman Lyamin
d13e04a693 [GPU] convolution_kernel_bfyx_1x1_opt fix (#10338) 2022-02-14 10:32:19 +03:00
Maksim Derbasov
bb0d82f724 Fix warnings (#10278) 2022-02-14 07:48:41 +03:00
Mikhail Nosov
d85715f991 Remove dynamism from API 1.0 (#10167)
* Refresh the PR

* Added check for dynamic inputs to LoadNetwork/QueryNetwork

* Fix review comment

* Added 'validation' callback to 'load network from file'

* Fix MockICore

* Added null-pointer check
2022-02-13 20:41:14 +03:00
Ilya Lavrenov
ba19551b13 Fixed typo (#10313) 2022-02-13 16:20:41 +03:00
Anastasia Popova
ac2e639ff8 Added telemetry to modules names list. (#10295) 2022-02-13 10:28:17 +03:00
Ilya Lavrenov
80a901e103 Add TF FE to OpenVINO package (#10314)
* Add TF FE to OpenVINO package

* Add double install for TF FE
2022-02-12 23:42:12 +03:00
Indira Salyahova
ea00eae922 [POT] Fix for measuring input shape when inference model with batch greater 1 in FBC (#10063)
* fix: diffrent batch shape in prediction and target in ac

* add calculate metric in engine True

* resolve conflicts
2022-02-12 19:12:58 +03:00
Nikita Malinin
8e43987cd7 [POT] Update IEEngine for SW API support (#10304)
* Update IEEngine for SW API support

* Change Engine for GNA sample

* Change stacks into reshape
2022-02-12 18:57:35 +03:00
Indira Salyahova
976a20cedf [POT] Update input pattern (#10220)
* Update special_patterns.py

* Update IgnoredPatterns.md
2022-02-12 18:56:41 +03:00
Vladislav Volkov
78281fef74 [CPU] [Ngraph] Fix of memory leak in PassBase::get_name and leak in jit_avx2_1x1_convolution_with_dw_conv_fwd_t kernel (#10199) 2022-02-12 15:48:49 +03:00
Maksim Kutakov
451453c4ce [CPU] Fixes for CpuBlockedMemoryDesc constructor and reorder availability checks (#10299) 2022-02-12 15:29:55 +03:00
Alexander Zhogov
e49370c008 Azure CI: Enable tests on Mac again 2022-02-12 14:22:37 +03:00
Alexander Zhogov
74475e216d Azure CI: Add ccache on Mac (#10290)
* Azure CI: Add ccache on Mac

* Temp OFF

* disable tests
2022-02-12 11:52:07 +03:00
Ivan Tikhonov
9989db5ae0 Rename frontend extension files (#10257)
* Delete _extension suffix in file names; add extension.hpp header to include all extensions

* add extension.hpp file to include all extensions

* codestyle
2022-02-12 09:19:20 +03:00
Maxim Shevtsov
e3cc4833f4 Auto batch smart reshape strict testing (once we moved to dim tracking) (#10253)
* fixed perf-counters

* explicit auto-batching params that should guarantee the auto-batching is triggered ( to avoid fallback to no-batching when the selected batch1 size is just 1)

* makeConvPoolReluNoReshapes and using that whenever applicable to gaurantee the auto-batching is required (not important for things like plugin/executable-network config tests, but important for the inference-requests)

* getDefaultNGraphFunctionForTheDevice moved to the ov_behavior_test_utils.hpp
2022-02-12 02:00:34 +03:00
Pavel Esir
653ed4a34c [MO] use revision hashes to compare IE & MO versions (#10230)
* fixed version comparison: for comparsion extracted hashes are used

* shortened 7 -> 11 to match the current version fromat from nightly

* corrected regex, added comparing by minimal hash len
2022-02-12 00:13:48 +03:00
Anton Pankratov
897e2acd91 Default value of streams in ba is AUTO (#10305) 2022-02-12 00:09:31 +03:00
Roman Lyamin
7b288d125a [GPU] Gather fusion tests fix (#10308) 2022-02-11 20:57:44 +03:00
Aleksandr Korolev
c2a9036482 [VPU] Fix performance hint (#10309) 2022-02-11 19:39:00 +03:00
guozhong wang
14c1e98e8c Guozhong/check format (#10184)
* remove formatTimeMilli from time_utils.cpp

* add traceCallStacks test case

* add traceCallStacks test case in format_test.cpp

* add param:"test" to function TraceCallStacks()

* catch the exception of checkFormat

* add space for try catch

* rollback time_utils.cpp time_utils.hpp and log_utils_format_test.cpp

* modify testcase for log.hpp

* modify testcase from format_s to format_s_d_ld_u_lu2
2022-02-11 19:10:13 +03:00
Yuan Hu
7abd61f867 [AUTOPLUGIN] OV config 2.0 support (#10191)
* add support for LOG_LEVEL and supported_properties

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix compile error

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* add test case for log_level and full_name

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* update to ov 2.0

Signed-off-by: fishbell <bell.song@intel.com>

* fix benchmark_app faild for AUTO:GPU, GPU

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* add case

Signed-off-by: fishbell <bell.song@intel.com>

* refine logic

Signed-off-by: fishbell <bell.song@intel.com>

* add test cases

Signed-off-by: fishbell <bell.song@intel.com>

* add more cases

Signed-off-by: fishbell <bell.song@intel.com>

* fix redifinition

Signed-off-by: fishbell <bell.song@intel.com>

* cpu plugin only in cpu tests

Signed-off-by: fishbell <bell.song@intel.com>

* typo in parameter

Signed-off-by: fishbell <bell.song@intel.com>

* use _core directly

Signed-off-by: fishbell <bell.song@intel.com>

* fix multi case failure

Signed-off-by: fishbell <bell.song@intel.com>

Co-authored-by: fishbell <bell.song@intel.com>
2022-02-11 23:39:09 +08:00
Ivan Novoselov
cc602ac6fd [Snippets] Convert Load/Store to slarar versions if shape ends with 1 (#10292) 2022-02-11 17:27:32 +03:00
Liubov Talamanova
4d61600077 [POT] Fix cascade model names (#10112) 2022-02-11 15:54:41 +03:00
Victor Kuznetsov
bcd192e882 Revert changes with single-image-super-resolution-1032 - memcheck precommit (#10271) 2022-02-11 20:30:09 +08:00
Anton Pankratov
f36d3303d2 Added callback capturing notes (#10256)
* Added callback capturing notes

* fixed spelling
2022-02-11 14:51:32 +03:00
Sergey Shlyapnikov
03566b4e4d [GPU] Fix outputs blobs allocation for U16/I16 data types (#10180)
* [GPU] Fix outputs blobs allocation for U16/I16 data types

* [GPU] Add U32, U64, FP64 data types support; add information about legacy fused activations to .info file

* Update auto_batch.cpp

fixed u64 inputs for the auto-batching

Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com>
2022-02-11 14:08:36 +03:00
Nikita Demashov
20d2633af0 removed defaultPrecisions as global variable and added as field in Params class (#9185)
fix canConvolutionBeTransformed arguments

fix isAsymmetricOnWeights in GPU plugin

added defaultPrecisions in TestTransformationParams

set new default attribute precisions

try to set const default precisions in network_helper.cpp

apply precision_set

[LPT] Default precisions

rebase

remove extra const

used defaultPrecision in tests

fixed SimpleLowPrecisionTransformer default argument

fixed AttributeParameters default argument

added defaultPrecisions in functions

fix assign_and_read_value_transformation tests

fixed wrong defaultPrecisions definition

fixed ConcatWithNeighborsWithConvolutionTransformation tests

remove getDefaultPrecisions

rebase

remove getDefaultPrecisions from gpu plugin

remove getDefaultPrecisions from lpt_mkldnn_plugin.cpp

use predefined member

update mkldnn_plugin.cpp & lpt_mkldnn_plugin.cpp

resolved conversations

make all lambda captures by ref
2022-02-11 13:41:03 +03:00
tgubanova-lohika
04c1b9760c [GPU] Implement ExperimentalDetectronTopKROIs operation (#10208) 2022-02-11 13:32:49 +03:00
Vladimir Paramuzov
dc1e9aa9bd [GPU] 6d broadcast support (#10280) 2022-02-11 13:29:09 +03:00
Vladimir Paramuzov
013b5f5b5f [GPU] Added cl batched headers post-processing (#10093) 2022-02-11 13:26:22 +03:00
Nikita Malinin
d758a21d6e Update gna_sample with API 2.0 features (#10236) 2022-02-11 13:23:02 +03:00
Alexey Lebedev
31501a7992 Fix random (#10240) 2022-02-11 13:06:07 +03:00
Mateusz Tabaka
6e1bc49862 Update xfail reason for ssd mobilenet models (#10287) 2022-02-11 10:34:42 +01:00
Nikolay Tyukaev
f03590d245 fix edit on github for pot and ovsa (#10285) 2022-02-11 12:13:12 +03:00
Mikhail Nosov
5535fdefa9 Fix coverity scan issues (#10266)
* Fix coverity scan issues

For virtual 'noexcept' functions everything that can throw exception shall be handled inside function

* Remove 'noexcept'
2022-02-11 10:44:57 +03:00
Tomasz Dołbniak
c186449735 Do not process null nodes in JSON analysis (#10269) 2022-02-11 08:42:25 +01:00
Mang Guo
8bbabf8720 [CPU] Get interpolate scales input during interpolate node init if the input is Constant. (#10229) 2022-02-11 10:27:50 +03:00
Maxim Andronov
cf805b17b9 [CPU] Support legacy dynamic batch via dynamic shapes (#9646) 2022-02-11 10:17:58 +03:00
Min, Byungil
281e38bd83 Use onednn reorder for newly added format (#10273)
+ Added new format to onednn optimized format list

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2022-02-11 15:58:11 +09:00
Anton Pankratov
1621a5a0b5 Used new config for streams and threads (#10150)
* Used new config for streams and threads

* Fixed review coments in ba

* format fix

* fixed hello_query_device

* Added STL string io

* fixed tests

* Fixed test

* Fixed build

* fixed format

* Fixed build

* try fix win

* other any io specialization

* Fixed after merge

* renamed streams

* build fixed

* fixed build

* fixed format

* fix for old mac build

* Fixed type of exception

* test fix
2022-02-11 09:22:45 +03:00
Nikolay Tyukaev
437bc3280d Feature/ntyukaev/add doxygen snippet sphinx (#10277)
* add doxygensnippet directive

* update MANIFEST.in
2022-02-11 09:19:46 +03:00
Jade Cho
dedcbeafa8 [GPU] Binary post-op support for full tensor. (#9856)
* [GPU] Binary post-op support for full tensor.

* Add unit tests

* Add a reorder if output dtype of conv layer is fp32.
2022-02-11 11:33:31 +09:00
Paul Youngsoo Ahn
fa69ee9596 [GPI] Update kernels to cache.json (#10260) (#10260) 2022-02-11 10:51:37 +09:00
Irina Efode
fd79ca91a1 [IE TESTS] Rename Op_impl_check (#10275) 2022-02-10 21:39:54 +03:00
Maxim Shevtsov
e41e1f51a0 Auto batch smart reshape (relies on the dim tracking) (#9964) 2022-02-10 20:43:06 +03:00
Andrey Somsikov
510e5fb746 Do not publish coverity submission to azure (#10274) 2022-02-10 19:09:36 +03:00
Vladimir Gavrilov
7b1b6f22e5 Added i64 and i32 as admissible element types of input port 0 into op::v4::Interpolate::validate_and_infer_types(). (#10263) 2022-02-10 18:59:38 +03:00
Anton Pankratov
7c455c7f23 Removed ov::Any rvalue cast (#10267) 2022-02-10 18:53:21 +03:00
hyunback kim
efbfd957ff [GPU] Enable disabled network fro oneDNNv2.6-pc2 (#10226)
Some networks newly uses wtags in oneDNN.
Add g_os_is_yx_osa2_isa8_osv8_isv2

Signed-off-by: hyunback <hyunback.kim@intel.com>
2022-02-10 18:13:33 +03:00
Anton Chetverikov
50dffb80bb Add missed DeformableConvolution to back transformations (#10255) 2022-02-10 17:20:11 +03:00
Anastasiya Ageeva
87f8ff5918 Reviewed header files for new APIs (#9873)
* Reviewed header files for new APIs

* Update compiled_model.hpp

* Resolved conflicts

* Implemented review comments

* Fixed code style issues

* Fixed code style issues

* Fixed code style issues

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2022-02-10 17:12:18 +03:00
Anton Chetverikov
9af8d9339c [MO] Avoid maskedconstant to array conversion (#10233)
* Avoid maskedconstant to array conversion

* remove redundant input

* Add link to github issue
2022-02-10 16:24:05 +03:00
Sergey Shlyapnikov
bc21e52912 [GPU] Fix FC 3D input size propagation and bias fusion (#10249) 2022-02-10 16:16:12 +03:00
Anton Grishin
d94cff59a3 [GNA] Add PReLu and LeakyReLu activations in tests (#10194)
original commit #9414
2022-02-10 16:15:47 +03:00
Andrey Zaytsev
54f56be077 Feature/azaytsev/docs update openvino readme (#10270)
* Added info on DockerHub CI Framework

* Feature/azaytsev/change layout (#3295)

* Changes according to feedback comments

* Replaced @ref's with html links

* Fixed links, added a title page for installing from repos and images, fixed formatting issues

* Added links

* minor fix

* Added DL Streamer to the list of components installed by default

* Link fixes

* Link fixes

* ovms doc fix (#2988)

* added OpenVINO Model Server

* ovms doc fixes

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>

* Updated openvino_docs.xml

* Updated the link to software license agreements

* Revert "Updated the link to software license agreements"

This reverts commit 706dac500e.

* Added POT, replaced IE with OV Runtime

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>
2022-02-10 15:44:35 +03:00
Aleksandr Korolev
8b7aeb7f52 [VPU] Coverity fixes (#10090) 2022-02-10 15:31:00 +03:00
Evgenya Stepyreva
9ad09f2120 Shape inference adoption for dimension tracking (#10016)
* Shape inference adoption for dimension tracking

* Style

* test adj

* tests fixed
2022-02-10 15:30:18 +03:00
Anton Voronov
d5c837cc1b [CPU] added some legacy parallel methods to fix perf issues (#9758) 2022-02-10 15:13:05 +03:00
Andrei Molotkov
80be557605 [GPU] Fix Backpropagation issue with BS >= 16 (#10228) 2022-02-10 14:53:27 +03:00
Ilya Lavrenov
ea26ec32b3 Removed runtime namespace (#10231) 2022-02-10 14:53:13 +03:00
Alexey Lebedev
d484411f39 [tools] Fix image_info detection in benchmark app (#10192)
* Fix image_info detection

* exception instead warning in case input data is not compatible with input
2022-02-10 14:32:56 +03:00
Andrew Kwangwoong Park
51c89dff26 [GPU] Fix detection output stage-0 kernel (#10262)
- Change the constant value to the maximum work group size
- Add CLK_GLOBAL_MEM_FENCE barrier to synchronize storing result in intermediate buffer
- Add condition to prevent access local array out of range

Signed-off-by: Andrew Kwangwoong Park <andrew.kwangwoong.park@intel.com>
2022-02-10 19:43:16 +09:00
Evgenya Stepyreva
89c3a18f83 Fix TensorIterator dynamic rank output (#10247)
* Fix TensorIterator dynamic rank output

* style
2022-02-10 13:03:16 +03:00
Ivan Tikhonov
3f0e532dce Fix the issue in values_from_const method in OVTF integration with TF FE (#10225)
* Fix the issue in values_from_const method in OVTF integration with TF FE

* fix comment
2022-02-10 11:33:42 +03:00
Min, Byungil
334e9e994e Revert WA for onednn first conv (#9783)
+ Reverted WA for fsv32 format first conv
+ Applied blocked input format bsv8fsv4 & bsv8fsv2 for onednn first conv
+ Implemented onednn usage for first conv of feature size 1
+ Added new weight format ABcd16a4b
+ Bugfix in fetch_weight
+ Updated thirdparty onednn_gpu
+ Known issue : AcdB16a4b is not supported

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2022-02-10 12:12:09 +09:00
Bartek Szmelczynski
36de4e8e28 [Model Enablement] fix default onnx domain (#10106) 2022-02-10 03:16:24 +03:00
Gleb Kazantaev
87c6e09cae Fix Add/MulFQFusion transformations (#10252) 2022-02-10 01:22:16 +03:00
Maxim Andronov
36afedd93d [CPU] Increase executor cache capacity (#10232) 2022-02-09 21:49:37 +03:00
Alexandra Sidorova
fce49e6d80 [Transformations] Added interchangeable reshape elimination (#9691)
* [Transformations] Added interchangeable reshape elimination

* Applied comments #2

* returned Reshape in condition

* applied comments #3

* applied comments #4

* added comment in plugin with reason about transformation
2022-02-09 21:11:49 +03:00
Mikhail Ryzhov
a002b26294 Fixed import for the new api 2.0 (#10175) 2022-02-09 20:51:49 +03:00
Vladislav Golubev
d28f8b7857 [LPT] Security fixes (#10243) 2022-02-09 20:46:39 +03:00
Tomasz Dołbniak
aedd902cd8 Use double quotes in JSON analysis (#10237) 2022-02-09 20:41:49 +03:00
Egor Shulman
840d2fb80d [CPU] Coverity fixes (#10207) 2022-02-09 20:39:50 +03:00
Gorokhov Dmitriy
6ea20340d1 [CPU] Fixed out of bounds read in JIT planar convolution (#7025) 2022-02-09 20:26:57 +03:00
Irina Efode
a37195492c [IE TESTS] Add exception to comparation to provide correct conformance results (#10197)
* [IE TESTS] Add exception to comparation to provide correct conformance results

* Apply comments
2022-02-09 19:15:00 +03:00
Nikolay Tyukaev
e81ca9f975 DOCS: change doc tests (#10213)
* change doc tests

* fixes

* fixes

* fixes

* fixes

* fixes
2022-02-09 18:28:54 +03:00
Maxim Shevtsov
c0a375f844 adding I64/U64 support to the auto-batching (#10234)
* adding I64/U64/etc support

* inputs precisions tests instantiations for the GPU and BATCH:GPU
2022-02-09 18:28:13 +03:00
Mikhail Nosov
f56c640550 SmartReshape: support Param->Convert->Reshape->Proposal pattern (#10204)
Current SmartReshape finds matched to Param->Reshape->Proposal patterns

    For FP16 models, there is additional 'Convert' is inserted after 'Parameter'.

    It causes transformation is not applied and 'ov::set_batch' or CNNNetwork::set_batch will throw

    Proposal1Scales and Proposal4Scales transformations were updated to handle these conditions
2022-02-09 17:44:54 +03:00
Tomasz Dołbniak
a60c110b96 Use i64 for ONNX Split attribute (#10203) 2022-02-09 17:30:00 +03:00
Vitaliy Urusovskij
c186069025 Fix several coverity issues (#10205)
* Update def value for GetParamAsBool() in legacy parseParams()

* Remove extra check from legacy convertFunctionToICNNNetwork()
2022-02-09 15:43:04 +03:00
Chen Xu
c93c9ec3d5 [CPU] Fix bug in topk_bubble_BLK_on_channel_horiz method (#10218) 2022-02-09 14:40:46 +03:00
Victor Kuznetsov
21601398d6 Remove dynamism from time_tests (API 1.0) (#10193) 2022-02-09 19:15:16 +08:00
Vladislav Golubev
051724f0d5 [LPT][Dynamic shapes] MoveFakeQuantize trasformation fix (#10178)
* [LPT] MoveFQ fix

* [LPT] MoveFQ: added check on dynamic channel in case of per-channel fq

* [LPT] MoveFQ: tests extending
2022-02-09 13:55:50 +03:00
Taylor Yeonbok Lee
603ea50277 Fix max batch size to respect available virtual memory in linux environment. (#10201) 2022-02-09 19:40:29 +09:00
Ilya Churaev
79fceddd7e Fixed some coverity issues (#10165) 2022-02-09 12:37:19 +03:00
Gleb Kazantaev
60011b6eb2 Fix EltwiseBroadcastFusion pass (#10214) 2022-02-09 12:35:38 +03:00
Pavel Esir
654b025a26 [MO] set explicitly argument dtype to int for np.split (#9988)
* forced split argument dtype to int

* added unit-test

* fixed typo in split_test.py

* set explicitly np.int64 instead of np.int

* use split_length's dtype
2022-02-09 12:16:33 +03:00
Anton Chetverikov
25ca17e789 [MO IR Reader] Update *Sequence backend_attrs (#10041)
* Update LSTMSequence backend_attrs

* Add missed attribute clip

* Update backend_attrs for all *sequence operations

* Add extender for GRUSequence

* Add GRUSequence to custom ops list

* use has_and_set instead if direct acces to attributes
2022-02-09 12:13:23 +03:00
Gleb Kazantaev
4fdf71cdc1 Preserve RTInfo in output ports (#10114)
* Automation for preserving rt info in output ports; Update FunctionComparator to compare rt info correctly

* Update LPT tests to use real rt_info attributes, so they can be compared

* Fix tests
2022-02-09 12:09:23 +03:00
Daniil Lyakhov
0168bda833 [Offline Transformations] Reshape Layer Pruning Transformation Support (#9350)
* Reshape op pruning support

* Minor reshape fix

* GroupConv reshape extended support

* Comment ir test

* Fix: reshape can only work with constants

* Apply comments

* Fix output shape computing for reshape op

* Fix comment
2022-02-09 12:03:56 +03:00
Maxim Shevtsov
320c64de24 disabling auto-batching when batch<4 (as batch1 kernels are heavily optimized) (#10188) 2022-02-09 12:02:30 +03:00
Anastasia Kuporosova
04194b292d [Python API] Add if for yocto cross-compilation (#10216) 2022-02-09 11:56:42 +03:00
Maxim Vafin
52374a4b8b Write runtime version and how IR was genarated (legacy path or not) (#10196) 2022-02-09 11:41:49 +03:00
Daria Mityagina
6dd6fb6c12 [VPU][XLink] Printf over XLink fails on OpenVINO 2021.4.2 - fix (#10099)
The XLinkReadDataWithTimeout() is used with and incorrect value for timeout parameter.
2022-02-09 11:30:29 +03:00
Edward Shogulin
c4e54d882b [LPT] StridedSlice extending (#10148)
* [LPT] StridedSlice extending

* [LPT] tests
2022-02-09 11:23:18 +03:00
Ilya Churaev
9d40c5184f Removed legacy names and environment variables from the code (#10195)
* Removed legacy names and environment variables from the code

* Support documented legacy variables

* Fixed core unit tests

* Fixed some test
2022-02-09 11:04:25 +03:00
Vitaliy Urusovskij
532a1da548 Fix "Error handling issue" (#10119)
* Fix coverity 'error handling issue' in ~CacheGuard()

* Fix coverity 'error handling issue' in reshape()
2022-02-09 11:04:02 +03:00
Sergey Lyubimtsev
acf8cacfbc requirements markers clean up (#10179)
* requirements markers clean up

* formatting & comments

* typos
2022-02-09 10:18:24 +03:00
Roman Lyamin
0d64afc2c8 [GPU] program_helpers::are_layouts_identical fix (#10109) 2022-02-09 09:27:15 +03:00
Sergey Shlyapnikov
8f0e974ee6 [GPU] Add new properties and fix bechmark_app (#10149) 2022-02-09 09:18:54 +03:00
Maxim Vafin
1970baeb1c Apply RIC for dynamic dimension in legacy MO (#10130)
* Apply RIC for dynamic dimension in legacy MO and fail if RIC wasn't applied to any input

* Fix moc tests
2022-02-08 22:17:19 +03:00
Smirnov Grigorii
d951433b12 fix bug in Serialize (#74447) (#9840)
* fix bug in Serialize (#74447)

add simple serialization test to check pads changes

clang fix

add check and change pads in conv

refactor ov::clone_model

fix

check in test

* fix FrameworkNode and add test

* fix assert in identiry.cpp

* fix clone_nodes

* remove for node and constructor for node_input.cpp

add spaces

add space
2022-02-08 22:00:20 +03:00
Evgenya Stepyreva
a18069926e Partial Value propagation from partial to static value (#10162)
* Partial Value propagation from partial to static value

* Style

* Tests ajustment
2022-02-08 21:55:17 +03:00
Yury Gaydaychuk
0dfdadb531 [CPU] Clamp reduces float boundaries in the case of integer data (#6668) 2022-02-08 19:50:45 +03:00
Ivan Novoselov
b47b8ad4bf [CPU] Snippets throughput mode fixes (#9488) 2022-02-08 17:58:42 +03:00
Jacek Skowron
dfc738b493 [docs] update macos installation guide 2 (#9636)
* update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

update macos installation guide

* update macos installation guide
2022-02-08 16:44:57 +03:00
Nikita Malinin
0c855ee8b2 [POT] Renaming NXModel (#10168)
* NXModel -> CompressedModel renaming

* Update references & remove Dicts

* Pylint fixes
2022-02-08 14:07:12 +03:00
Indira Salyahova
f17c26506f Update utils.py (#10186) 2022-02-08 13:51:29 +03:00
Alexey Lebedev
24c4ccc621 [PYTHON API] add __hash__ for Type (#10059)
* define hash operator for type

* Fix code style
2022-02-08 13:28:25 +03:00
Evgenya Stepyreva
47b8c77a59 Q-DQ pairs folding where applicable (#10181) 2022-02-08 13:18:26 +03:00
Maxim Andronov
42a0ce0514 [CPU] Fixed dummy shape creation for Pooling (#10147) 2022-02-08 12:54:00 +03:00
Maksim Kutakov
7406b1ffc3 [CPU] Memory manager was introduced in MKLDNNMemory (#7925) 2022-02-08 12:34:17 +03:00
Anton Chetverikov
f9eaaa9ff6 [MO] Sqrt operation implementation (#9950)
* Add sqrt extender

* Update check to not use default infer in infer was set before

* Update comment

* Fix comment

* Remove Sqrt extender

* Remove unnecessary changes

* Add MO implementation of SQRT operation
2022-02-08 11:41:13 +03:00
Maxim Shevtsov
863c74471f Auto batch fix default val +test (#10169)
* default config value for the AUTO_BATCH_TIMEOUT

* test for default config value for the AUTO_BATCH_TIMEOUT

* default val for timeout var
2022-02-08 10:14:15 +03:00
Vladimir Dudnik
0a316216f3 update open_model_zoo submodule (#10182) 2022-02-08 09:31:22 +03:00
Vladislav Golubev
c4c46beb6b [CPU] Optimize*SequenceTransposes: Gather7->Gather8 (#10122) 2022-02-08 08:56:38 +03:00
Mingyu Kim
67e2bdfc28 [GPU] Update onednn to rls-v2.6-pc2 (#10156)
It is expected to have functional improvements
2022-02-08 09:47:33 +09:00
Nadezhda Ageeva
2215440188 [GNA] Set performance mode to undefined (#10174) 2022-02-07 23:04:29 +03:00
Jacek Skowron
65701e12ef [docs] update raspbianos installation guide (#9728)
* update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

update raspbianos installation guide

* update raspbianos installation guide

* update raspbianos installation guide

* update raspbianos installation guide
2022-02-07 20:01:28 +00:00
Yegor Kruglov
9d3028a9f7 [MO] Pip installation message for not satisfied dependencies (#9952)
* changed message for not satisfied package

* changed warning message
2022-02-07 22:19:02 +03:00
Jacek Skowron
2d9a248912 [docs] update uninstall guide (#9725)
* CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

CVS-71850 update uninstall guide

* CVS-71850 update uninstall guide
2022-02-07 18:19:09 +00:00
Edward Shogulin
c6c9a06d41 [LPT] getDataPrecision extending (#10071)
* [LPT] getDataPrecision extending

* [LPT] getDataPrecision unit tests addition
2022-02-07 19:49:01 +03:00
Anton Pankratov
e34ff009e0 Fix for mac caching test (#10151)
* Fix for mac

* Fixed rtti comparison

* used defined
2022-02-07 19:22:21 +03:00
Andrey Zaytsev
d62d185ac5 Feature/azaytsev/docs omz revision (#10176)
* Added info on DockerHub CI Framework

* Feature/azaytsev/change layout (#3295)

* Changes according to feedback comments

* Replaced @ref's with html links

* Fixed links, added a title page for installing from repos and images, fixed formatting issues

* Added links

* minor fix

* Added DL Streamer to the list of components installed by default

* Link fixes

* Link fixes

* ovms doc fix (#2988)

* added OpenVINO Model Server

* ovms doc fixes

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>

* Updated openvino_docs.xml

* Updated the link to software license agreements

* Revert "Updated the link to software license agreements"

This reverts commit 706dac500e.

* Added a link to the omz repo

Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>
2022-02-07 16:12:28 +00:00
Yegor Kruglov
bde1d5edb0 added condition for optional outputs (#10097) 2022-02-07 18:24:28 +03:00
Victor Kuznetsov
857c0bd9dd [Time tests] Update reshape pipeline (use default inputs before reshape for data generation) (#10129) 2022-02-07 22:50:12 +08:00
Maxim Shevtsov
14fcd196a3 updated the mem_statistics ( since "current" is removed) and TOTAL_MEM as it is now types thru Any (and hence needs the as<>()) (#10135) 2022-02-07 17:31:12 +03:00
Ivan Tikhonov
707a1b9377 FrontEnd OpExtension (#10153)
* Squash commits: OpExtension, pybindings, unit tests

* fix incorrect merge

* fix builds

* fix macro on Windows

* Update OPENVINO_FRAMEWORK_MAP to support any cnt of attributes, fix pybinding, resolve review comments, add unit tests

* Fix PEP8, fix unit tests build

* Remove exports from template classes

* fix MacOS build, fix copyrights, clean up

* investigate issue with reshape py tests: temporary delete OpExtension python tests

* Revert "investigate issue with reshape py tests: temporary delete OpExtension python tests"

This reverts commit 2ea2bc9e2e.

* fix model name for onnx tests

* fix python unit tests

* add new lines in the end of files

* fix unicode support on Win OS

* fix codestyle

* Update ends_with function implementation

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>

* update copyrights

* resolve review comments

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
2022-02-07 16:21:18 +03:00
Alexey Lebedev
89f071f5fa [PYTHON API] Forbid building python api with debug postfix (#10158)
* Forbid building python api with library postfix

* Fix condition
2022-02-07 13:58:53 +03:00
Alexandra Sidorova
57b08583cc [Benchmark] Align comments with command argument 'data_shape' (#9897) 2022-02-07 13:31:38 +03:00
Pavel Esir
3d6e90b8f9 concat['override_output_shape'] = True in StridedSliceNormalizer.py (#10045) 2022-02-07 13:24:56 +03:00
Mikhail Nosov
abda6eb4af Remove 'evaluate' from I420toRGB/BGR operations (#10128) 2022-02-07 13:05:51 +03:00
Nikita Demashov
74fa60cf86 [LPT] Fixed an incorrect condition & added test to MoveFakeQuantize transformation (#10009)
* fixed an incorrect condition & added test

* fixed an incorrect condition & added test
2022-02-07 12:32:49 +03:00
Anton Grishin
b365e67561 [GNA] Add support for non-functional subgraphs (#9732)
* [GNA] Add support for non-functional subgraphs

Details:
* Insert copy before the last layer to allow nonfunc subgraphs

Tickets:
57363

* Traverse graph in upstream order

* Add param-reshape-result tests

* Fix insert condition

* review comments
2022-02-07 12:21:23 +03:00
Anastasia Kuporosova
3c13cea02b [Python API] Fix import/export of model + update speech sample (#10103)
* Fix import/export of model

* update speech sample

* fix code-style

Co-authored-by: jiwaszki <jan.iwaszkiewicz@intel.com>
2022-02-07 12:12:06 +03:00
Fedor Zharinov
38f470c184 set U8 precision for image-like inputs even in case of random filling (#10140) 2022-02-07 12:09:16 +03:00
Ilya Znamenskiy
ac28063b19 [GPU] Gemm onednn implementation (#9984)
* [GPU] Gemm onednn implementation

* [GPU] Added implementation choice logic
2022-02-07 11:48:42 +03:00
Mikhail Nosov
9f9df184c4 Added compatibility check of layout with partial shape (#10144)
* Added compatibility check of layout with partial shape

E.g. layout "NC" in not compatible with PartialShape{1,3,224,224}

Check is added:
- For parameter set_layout
- For parameter set_partial_shape
- For result set_layout
- Checked also compatibility for all results after 'validate_and_infer_types'

* Fix incorrect tests

* Fix of more incorrect tests

* Removed couple of obsoleted error-handling tests - these are catched now on earlier stages

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-02-07 11:17:28 +03:00
Vladimir Paramuzov
ae4c727b31 [GPU] StridedSlice shape propagation fix (#10095) 2022-02-07 10:08:06 +03:00
Vladimir Paramuzov
12746efbe5 [GPU] Fixed safe index func for per-channel case (#10136)
Co-authored-by: Ilya Znamenskiy <ilya.znamenskiy@intel.com>
2022-02-07 09:59:52 +03:00
Ilya Churaev
a2ca1d4499 Merge IE & nGraph DG (#10055)
* Changed folder for documentation

* Fixed links

* Merged nGraph DG to OpenVINO Runtime UG

* Fixed errors

* Fixed some issues

* Fixed tree

* Fixed typo

* Update docs/documentation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update README.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update README.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Fixed name

* FIxed snippets

* Small fixes

* Update docs/HOWTO/Custom_Layers_Guide.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Fixed comments

* Try to fix doc

* Try to fix doc issue

* Update docs/OV_Runtime_UG/Integrate_with_customer_application_new_API.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

* Update docs/OV_Runtime_UG/model_representation.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2022-02-07 06:57:35 +03:00
Ilya Churaev
788fb5c010 Improvement for AtomicGuard (#10120) 2022-02-06 15:18:54 +03:00
Ilya Churaev
eff6084ec9 Fixed coverity issues for core and frontends (#10123)
* Fixed coverity issues for core and frontends

* Fixed code style

* Fixed comments

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-02-05 14:52:55 +03:00
Anastasia Kuporosova
7d1ad47611 [Python API] Install only one openvino/__init__.py (#10145)
Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2022-02-05 14:48:11 +03:00
Vladislav Volkov
a365ee768b Fix for leaked ExecutorManager (#10070)
* Fix for leaked ExecutorManager

* Code style fix

* Fixed plugin pointer access from ExecutableNetwork
2022-02-05 14:03:50 +03:00
Oleg Pipikin
502c89e4a7 [HETERO] Fix segfault in supported/unsuppoterd layers check (#10104) 2022-02-05 13:35:25 +03:00
Anton Pankratov
ced90de0a5 PERF_COUNT replaced with ov::enable_profiling (#10118)
* String conversions in any

* Fixed chaching tests

* Fixed tests

* fixed build

* PERF_COUNT replaced with ov::enable_profiling

* fixed format

* fixed format

* fixed optimal config

* merge fix

* fix build

* format fix

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-02-05 13:27:46 +03:00
Anton Pankratov
213e02f3b0 Import Export using capabilities (#10081)
* String conversions in any

* Fixed chaching tests

* Fixed tests

* fixed build

* Fixed gpu
2022-02-05 11:16:55 +03:00
Anton Pankratov
5f5bea2c5a Fix for android type info comparison (#10142)
* Any value can fromm inner string

* Fixed review coment

* strict str to value conversion

* fix format

* [VPU] update config header (#9857)

* [VPU] update config header

* Review fixes

* Performance hint config update

* Removal deprecated vpu config stuff

* Review changes

* Rename myriad properties from camelCase to snake_case

* Review changes

* Review fixes

* Removal intel_myriad::common namespace

* OV throughput stream option

* Test fix

* Reverted disable_convert & disable_reorder

* Bugfixes

* Change default value for PerformanceHintNumRequestsOption

* fixed excessive outputs copying (in case when the fallback happened) and updated the test for that (#10110)

* fixed excessive outputs copying (in case when the fallback happened) and updated the test for that

* enum eExecutionFlavor to cover initial state

* Transformations: eltwise and FQ fusings fixes (#10078)

* FQ fusings fixes

* FQ Fusings: added negative test-cases for non-broadcasted constant

* Disable single-image-super-resolution-1032  from MemCheck precommit (#10133)

* add performance hint to time infer

* disable model from memcheck

* Fixed input cut for case when port is not specified. (#10134)

* Fix for android type info comparison

Co-authored-by: Aleksandr Korolev <aleksandr.korolev@intel.com>
Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com>
Co-authored-by: Vladislav Golubev <vladislav.golubev@intel.com>
Co-authored-by: Victor Kuznetsov <victor.kuznetsov@intel.com>
Co-authored-by: Anastasia Popova <anastasia.popova@intel.com>
2022-02-05 11:15:16 +03:00
Alexander Zhogov
18fd46a447 Revert "FrontEnd OpExtension (#9917)" (#10146)
This reverts commit 768f353300.
2022-02-05 10:42:17 +03:00
Alexander Zhogov
e0114fd22d Azure CI: increase timeout on Windows 2022-02-05 08:48:42 +03:00
Alexander Zhogov
6ac54df960 Azure CI: remove IB from running test (#10141) 2022-02-05 08:37:29 +03:00
Ivan Tikhonov
768f353300 FrontEnd OpExtension (#9917)
* Squash commits: OpExtension, pybindings, unit tests

* fix incorrect merge

* fix builds

* fix macro on Windows

* Update OPENVINO_FRAMEWORK_MAP to support any cnt of attributes, fix pybinding, resolve review comments, add unit tests

* Fix PEP8, fix unit tests build

* Remove exports from template classes

* fix MacOS build, fix copyrights, clean up

* investigate issue with reshape py tests: temporary delete OpExtension python tests

* Revert "investigate issue with reshape py tests: temporary delete OpExtension python tests"

This reverts commit 2ea2bc9e2e.

* fix model name for onnx tests

* fix python unit tests

* add new lines in the end of files

* fix unicode support on Win OS

* fix codestyle

* Update ends_with function implementation

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>

* update copyrights

* resolve review comments

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
2022-02-04 22:28:13 +03:00
Egor Duplensky
c83d265416 [CPU] Add support for OV2.0 configuration API (#9997) 2022-02-04 22:26:42 +03:00
Maxim Andronov
a8c520878d [CPU] Dummy shape creation fix for Deconvolution (#10079) 2022-02-04 21:43:25 +03:00
Anton Pankratov
69b118ed7b ov::Any can get value from stored string (#10131)
* Any value can fromm inner string

* Fixed review coment

* strict str to value conversion

* fix format
2022-02-04 20:41:37 +03:00
Nikolay Tyukaev
1abc6e2a16 edit log parse regex (#10117) 2022-02-04 20:15:26 +03:00
Anastasia Popova
12a310636d Fixed input cut for case when port is not specified. (#10134) 2022-02-04 19:03:12 +03:00
Victor Kuznetsov
b3a990b0a7 Disable single-image-super-resolution-1032 from MemCheck precommit (#10133)
* add performance hint to time infer

* disable model from memcheck
2022-02-04 18:00:00 +03:00
Vladislav Golubev
265ab03314 Transformations: eltwise and FQ fusings fixes (#10078)
* FQ fusings fixes

* FQ Fusings: added negative test-cases for non-broadcasted constant
2022-02-04 17:57:13 +03:00
Maxim Shevtsov
8a85bfa312 fixed excessive outputs copying (in case when the fallback happened) and updated the test for that (#10110)
* fixed excessive outputs copying (in case when the fallback happened) and updated the test for that

* enum eExecutionFlavor to cover initial state
2022-02-04 16:58:37 +03:00
Aleksandr Korolev
9743784f91 [VPU] update config header (#9857)
* [VPU] update config header

* Review fixes

* Performance hint config update

* Removal deprecated vpu config stuff

* Review changes

* Rename myriad properties from camelCase to snake_case

* Review changes

* Review fixes

* Removal intel_myriad::common namespace

* OV throughput stream option

* Test fix

* Reverted disable_convert & disable_reorder

* Bugfixes

* Change default value for PerformanceHintNumRequestsOption
2022-02-04 16:32:00 +03:00
Mateusz Tabaka
72216a9b95 [ONNX] Replace subgraph's inputs from parent with Parameter before node is created (#10113)
This patch fixes case when If operator has subgraph with just Identity op,
which input comes from parent graph. Since Identity is eliminated,
its input is incorrectly pulled to this subgraph's body.
For example:
this ONNX subgraph:
```
               +-----------+
               |AveragePool|
               +-+---+-----+
                 |   |
            +----+   v
            |      .....
            |        |
            |        v
    +-------|--------------------------+
    |       |       If                 |
    |   then|branch      else branch   |
    +-------|--------+-----------------+
    |       |        |                 |
    |       v        |                 |
    |  +-----------+ |                 |
    |  | Identity  | |    .........    |
    |  +-----------+ |                 |
    |                |                 |
    |                |                 |
    +----------------+-----------------+
```
was converted to following (incorrect) nGraph representation:
```
              +-------------+
              | AveragePool |
              +--+---+------+
                 |   |
            +----+   v
            |      .....
            |        |
            |        v
    +-------|---------------------------+
    |       |        If                 |
    |   then|branch       else branch   |
    +-------|---------+-----------------+
    |       v         |                 |
    |  +-----------+  |                 |
    |  | Parameter |  |                 |
    |  +-----------+  |                 |
    |       |         |                 |
    |       v         |                 |
    | +-------------+ |                 |
    | | AveragePool | |    .........    |
    | +-------------+ |                 |
    |       |         |                 |
    |       v         |                 |
    |   +--------+    |                 |
    |   | Result |    |                 |
    |   +--------+    |                 |
    |                 |                 |
    +-----------------+-----------------+
```

With this change, subgraph's inputs from parent scope are replaced with
Parameter before nGraph node is created. In that case Identity's input
is a Parameter (and not AveragePool) and therefore 'then branch' looks like:
```
     +-----------+
     | Parameter |
     +-----------+
           |
           v
     +-----------+
     |  Result   |
     +-----------+

```

Ticket: 73895.
2022-02-04 12:23:27 +01:00
Ivan Novoselov
b7c62fcfbc [CPU] Improve weights sharing sync on multiple outputs (#10060) 2022-02-04 12:26:57 +03:00
Tomasz Dołbniak
797b2221be ONNX pooling - extended auto_pad attribute support (#10092) 2022-02-04 10:23:31 +01:00
Alexey Lebedev
7478915ef3 [PYTHON API] Fix InferQueue.is_ready() call (#10096)
* Fix is_ready and add tests

* remove wrong comment

* refactor test

* Fix code style
2022-02-04 11:57:56 +03:00
Indira Salyahova
da02951d67 [POT] Fix get layout from model (#10018)
* fix: layout pot

* layout

* fix: layout

* pylint

* add logger

* Update image_loader.py

* pylint

* repeat layout in data free

* resolve conflicts

* sample

* resolve comments
2022-02-04 11:46:54 +03:00
Victor Kuznetsov
ed6bb8ab2d Update models folder for TimeTests (#10107)
* add performance hint to time infer

* upd time models
2022-02-04 11:33:15 +03:00
Ilya Lavrenov
70ca4b6e40 Fix template plugin tests (#10124)
* Fix template plugin tests

* Fix template plugin tests
2022-02-04 11:25:46 +03:00
Ilya Churaev
7b5a4e8c5e Remove WA from ImportNetwork (#10111) 2022-02-04 07:16:57 +03:00
Taylor Yeonbok Lee
54678f47cf [GPU] Adjust preferred format of resample operation (#9919)
* Adjust preferred format of resample operation

* Applied review comment

* Not to fix resample layout when there is permute user unless the permute order is rotating
2022-02-04 09:57:57 +09:00
Vladimir Dudnik
f9b88c385c upd OMZ submodule. first part public models with layout as MO param (#10108) 2022-02-04 02:57:06 +03:00
Edward Shogulin
e8b88b9021 [LPT] foldFakeQuantize extending to support empty shapes (#10116) 2022-02-03 23:01:27 +03:00
Roman Kazantsev
64aabc74d1 Check the selected frontend to correspond use_new/legacy_frontend options (#10084)
* Check the selected frontend to correspond use_new/legacy_frontend options

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix a default case when no frontend is found

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2022-02-03 20:34:07 +03:00
Ilya Lavrenov
f2f281e60b Renamed ov_runtime => openvino, ov_ => openvino_ prefix (#10069)
* Renamed ov_runtime => openvino, ov_ => openvino_ prefix

* Coverage fix

* More fixes

* Fixed MO tests with custom FE
2022-02-03 20:03:41 +03:00
Anastasia Popova
86faa25724 Fix of output tensor names for mask-rcnn* models (#10042)
* Added op names to tensor names for MaskRCNN replacement transformation. Fixed output layout for MaskRCNN.

* Applied commentes left from PR with tensor names fix.

* Added tests for remove_tensor_names().

* Added checks in emitter.

* Removed debug output.

* Small fix.

* Small fix.
2022-02-03 19:44:47 +03:00
Evgeny Kotov
d30365f3d5 fix (#9868) 2022-02-03 19:14:57 +03:00
Anton Pankratov
8993c4c18a Deprecated ov::Any implicit cast to any types (#9409)
* Depricated Any implicit cast

* Fixed test

* fixed gna build

* Fixed warnings in benchmark_app

* Fixed test build

* ncc exception for PrintTo

* Error mesage in test

* Error mesage in test

* fixed build
2022-02-03 19:10:52 +03:00
Krzysztof Bruniecki
6677079821 Set proper precision for added output (#9496) 2022-02-03 18:34:55 +03:00
Anton Pankratov
5c9b6915dc Added undefined perfomnance hint value (#10082)
* Added undefined perfomnance hint value

* Added tests

* Fixed tests

* fixed dormat
2022-02-03 18:03:45 +03:00
Ilya Lavrenov
168bfe58c4 Fix NCC (#10105) 2022-02-03 16:51:26 +03:00
Ilya Lavrenov
3c35cf73c2 Build only static libraries on Linux Azure (#10062) 2022-02-03 16:26:21 +03:00
Anastasia Popova
ca45bf430a Fixed tensor names set in InputCut and AutomlEfficientDet transformation. (#9998)
* Fixed tensor names setting in InputCut, fixed tensor names losing in AutomlEfficientDet.

* Changed op name adding to tensor names in InputCut for output port case only.
2022-02-03 15:55:16 +03:00
Artyom Anokhov
f57be8fdd8 configs: Updated path to licensing (#10102) 2022-02-03 15:24:40 +03:00
Anton Dudchenko
711d6de33b [VPU] Fix precisions for execGraph (#9767)
ExecGraph didn't contain the parameter node and precisions
65013
2022-02-03 13:20:59 +03:00
Sergey Shlyapnikov
ccf4f4e420 [GPU] Update config api 2.0 (#9649) 2022-02-03 13:04:36 +03:00
Nikolay Shchegolev
b34cb55081 [CPU] Gather JIT implementation + Gather8 support. (#10083) 2022-02-03 12:32:23 +03:00
Ilya Churaev
0b75589e27 Fix cc build (#10073)
* Try to fix cc build

* Fixed build
2022-02-03 11:43:51 +03:00
Wilson Seok
3d9da2901e Template slt bug fix/mish partial dynamic (#9976)
* Remove fp16 of Convert layer test from skip_tests.config.cpp as it works now

* update repo

* fix demension dynamic support bug in mish op reference test
2022-02-03 11:32:39 +03:00
Wilson Seok
8d27103f06 Add slt in template plugin/rnn sequence (#9526)
* Remove fp16 of Convert layer test from skip_tests.config.cpp as it works now

* update repo

* add initial op reference test of rnn_sequence

* add op reference test of GRUSequence

* replace input and refOut data to hard coded value

* update copyright year and namespace of Tensor

* rename S_t to sequence_lengths
2022-02-03 11:32:08 +03:00
Jan Iwaszkiewicz
db334efbbd Fix vector casting for Constants with float16 type (#10088) 2022-02-03 09:15:28 +01:00
Vladislav Golubev
38ed0de9cf Test enabled (#9341) 2022-02-03 10:58:03 +03:00
Liubov Talamanova
b4206fe0a1 Supported Simplified mode without provided config (#10049)
* Support Simplified mode without provided config

* Change data-source default location
2022-02-03 10:56:25 +03:00
Eugeny Volosenkov
e7d8284e4d fix pot (#9980) 2022-02-03 10:47:31 +03:00
Maxim Gordeev
cf69c97765 Added new correct gna frequency result for Alder Lake (#10047)
* Added new correct gna frequency result for Alder Lake

* Update samples/cpp/speech_sample/utils.hpp

Co-authored-by: Krzysztof Bruniecki <krzysztof.bruniecki@intel.com>

Co-authored-by: Krzysztof Bruniecki <krzysztof.bruniecki@intel.com>
2022-02-03 10:38:25 +03:00
Ilya Churaev
03c38ca3fd Changed code which check newAPI flag from Core (#10080)
* Changed code which check newAPI flag from Core

* Fixed typo
2022-02-03 10:36:23 +03:00
Fedor Zharinov
9219242dbd Benchmark_app: JSON writer for statistics (#9887)
* Refactored statistics output with JSON support

* Detailed/average reports are added

* stylefix

* Update samples/cpp/benchmark_app/statistics_report.hpp

Co-authored-by: Ivan Vikhrev <ivan.vikhrev@intel.com>

* Linux Fixes

* stylefixes

* data_shape field format is changed

* stylefix

Co-authored-by: Ivan Vikhrev <ivan.vikhrev@intel.com>
2022-02-03 01:47:46 +03:00
Alina Kladieva
552454a3f0 Revert "[CPU] Gather jit implementation. (#6601)" (#10077)
This reverts commit fbe8aa94a4.
2022-02-02 20:12:24 +03:00
Ilya Churaev
5406839e3f Removed layouts config (#10067) 2022-02-02 15:56:26 +03:00
Nikolay Shchegolev
fbe8aa94a4 [CPU] Gather jit implementation. (#6601) 2022-02-02 15:02:49 +03:00
Nikolay Tyukaev
7a88daa8f7 enable doc html artifact (#10065) 2022-02-02 14:43:20 +03:00
Tomasz Dołbniak
8a05ef2514 Softmax tests fixed (#10051) 2022-02-02 12:28:39 +01:00
Tomasz Dołbniak
0700ba781b ONNX ConvInteger - handling of scalar zero points (#10057) 2022-02-02 12:16:08 +01:00
dependabot[bot]
53af687a0c Bump jinja2 (#9966)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 14:09:45 +03:00
Nikita Malinin
04f5b233f2 [POT] Introduce saturation_fix option (#9940)
* Introduce statiration_fix option

* Pylint fix

* Update namings and pipelilne

* Change node_input target
2022-02-02 13:46:20 +03:00
Andrey Somsikov
9dd4476c58 Reduce noise from security tests (#9774)
* Mute noicy undefined behavior checks

* Fix GCC build error with unsupported option

* Fix missprint
2022-02-02 12:48:21 +03:00
Andrey Somsikov
176bc2d83d Set -DENABLE_FASTER_BUILD=OFF for coverity (#10044) 2022-02-02 12:47:32 +03:00
Victor Kuznetsov
0dd8d895a0 [Time tests] Add API 2.0 support (#9878)
* add performance hint to time infer

* init commit - add api 2 support

* change imInfo filling

* change copyright dates

* check hw positions to default

* add debug info

* fix mistake

* add check layout funcs for api2 time infer

* reformat code (2 -> 4)

* upd with reshape api2

* upd with master

* --

* fix fillTensors - set as template

* fix common_utils.cpp after merge master
2022-02-02 12:33:02 +03:00
Anastasia Kuporosova
70f65bdb74 [Python API] Rename configuration API + update tests/tools (#9927)
* [Python API] Rename configuration API + update tests/tools

* keep old api for compatibility

* add deprecation warnings

* apply comments to query sample

* remove convert to pyobject

* use Any instead of string

* update tests

* update set_property

* fix sample

* update test + try-except for pot

* add docstrings

* fix codestyle for pot
2022-02-02 11:28:41 +03:00
Anton Grishin
336fc37b94 Define static variable (#10053) 2022-02-02 11:26:26 +03:00
Smirnov Grigorii
83b1a247ec move convert_broadcast3_test.cpp to op_coversions (#10043)
* move

* remove convolution_ie header
2022-02-02 10:59:11 +03:00
Mateusz Tabaka
bf908e9bdf Enable argmin/argmax test cases (#10056)
Ticket: 35473
2022-02-02 08:39:58 +03:00
Anton Pankratov
4cbcf4b4e3 Added get property additional arguments (#9993)
* Added get property additional arguments

* Fixed build

* Fixed error

* Added api wiht property and map

* Fixed gna build

* reverted available_devices
2022-02-01 23:56:52 +03:00
Tatiana Troilova
c715fde8f0 Update third party files (#9992)
* Update third party files

* Update third party files (OMZ added)
2022-02-01 21:06:06 +03:00
Nikolay Tyukaev
172cbe7340 DOCS: Fix js and add ipython (#9995)
* js and ipython

* add to suppress warnings

* fixes

* fixes

* fixes

* fixes
2022-02-01 20:39:17 +03:00
Evgenya Stepyreva
ff8c217e03 Not tracking fixed, tracking restored (#10040) 2022-02-01 19:58:29 +03:00
Maxim Andronov
ba736e2bcd [CPU] Fix dynamic RNNSeq with native order (#9932) 2022-02-01 18:52:57 +03:00
Vitaliy Urusovskij
89fe26e3db Copy RandomUniform m_state during clone_with_new_inputs() (#10031)
* Copy RandomUniform m_state during clone_with_new_inputs()

* Add `get_state()` for RandomUniform op

* Add copy.random_uniform test
2022-02-01 18:46:09 +03:00
Jacek Skowron
56759d9cdc [docs] update linux/win installation guide (#9720)
* CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

CVS-71745 update linux installation guide

* CVS-71745 update linux installation guide

* CVS-71745 update linux installation guide

* CVS-71745 update linux installation guide

* lfs

* CVS-71745 update linux installation guide

* CVS-71745 update linux installation guide

Co-authored-by: CCR\ntyukaev <nikolay.tyukaev@intel.com>
2022-02-01 18:33:36 +03:00
Svetlana Dolinina
5e8f997262 Fix bug in AddReshapeTransposeAroundConvPool for Kaldi LSTM networks (#9885)
* change order of transformations to work correctly with Convolutions in Kaldi LSTM networks

* removed unneeded changes and add unit tests

* remove comment

* remove changes from memory_offset_adjustment, move all fixes inside add_reshape_transpose_around_conv_pool to avoid new bugs

* removed test for deleted changes

* replace -1 by None
2022-02-01 17:06:49 +03:00
Fedor Zharinov
c848e55f5e Benchmark_app: Command line args processing is modified to use both tensor and corresponding node names (#9968)
* Node/name conversions

* stylefix
2022-02-01 16:05:00 +03:00
Fedor Zharinov
6845392aa6 Benchmark_app: incorrect indexing during precision set is fixed (#10033)
* Precision problem fix. Behavior of auto precision conversion to U8 (in case of image) is changed

* stylefix
2022-02-01 15:58:48 +03:00
Liubov Talamanova
ca09ddd123 [POT] Implement DataFreeEngine (#9484)
* [POT] Implement DataFreeEngine

* Add CLI

* Updated CLI

* Moved logic to SynteticImageLoader

* Fix bug with draw modes

* Fix bug in DataFreeEngine

* Fix multiprocessing

* Fix pylint

* Add DataFreeEngine test

* Download models

* Fill background

* Fix test

* Fix args

* Support config option for DataFree mode

* Minor fixes

* Add data_free config

* Add more test cases

* Enable RCNN models quantization
2022-02-01 15:15:20 +03:00
Ekaterina Aidova
09f53b56e6 [OMZ]: update submodule (#10036) 2022-02-01 15:03:17 +03:00
Katarzyna Mitrus
52d53d187d Enable reshape sequence fusion transformation based target shape bounds (#9886)
* Calculate value bounds in ReshapeSequenceFusion

* Reashape fusion upper bounds check

* Revert last return to false

* Add transformation unit tests

* Use output node as check param

* Use evaluate helper and remove deprecation macro

* Header update

* Checks refactor and comments

* Update unit tests

* Get element type from node_out
2022-02-01 14:51:47 +03:00
Lidia Toropova
2ce7becc6b Moved memory tests to OV API 2.0 (#9924)
* Moved memory tests to OV API 2.0

* Added configs for OV api 2, updated configs for api 1

* Commented several models in configs (no such models on omz)

* Updated fillTensors

* Fix to get network inputs

* Updated fillTensors and configs
2022-02-01 14:36:05 +03:00
Yuan Hu
8892b7b327 add Debug statistic log for devices infer nums (#9825)
* add statics log

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* change LOG_DEBUG to LOG_INFO

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>

* fix type

Signed-off-by: fishbell <bell.song@intel.com>

Co-authored-by: fishbell <bell.song@intel.com>
2022-02-01 14:18:29 +03:00
Alina Kladieva
f25c450534 Exclude gpu registerPluginsXMLUnicodePath test due to 76197 (#10029) 2022-02-01 13:43:38 +03:00
Pavel Esir
9bb7697b2f [MO] fix simplified MO import for PyCharm Debug (#9866)
* fix simplified MO import for PyCharm Debug

* package_BOM update
2022-02-01 13:14:48 +03:00
Eugeny Volosenkov
e0af970d62 Fix yolov3 documentation (#9901) 2022-02-01 13:12:12 +03:00
Anton Pankratov
b8a4b0742b Streams executor configured using OV2.0 configuration API (#9587)
* Streams executor config OV2.0

* Fixed error

* Reverted CPU tests
2022-02-01 13:08:32 +03:00
Anton Pankratov
8ca6aeae83 New configuration API in set get property (#10012)
* New configuration API in set|get property

* removed supported metrics and keys

* Fixed build

* Fixed build

* Fixed samples build

* Fixed samples build

* Fixed build

* Removed old properties in plugin

* Fixed build
2022-02-01 13:05:14 +03:00
Maxim Andronov
6866ced978 [Transformations] ConvertBroadcast3 for boolean fix (#10001) 2022-02-01 12:53:05 +03:00
Alexey Suhov
e1e467f23f [CMake] Add debug postfix on mac (#10027) 2022-02-01 12:41:26 +03:00
Daria Mityagina
a3f2a4ef99 [VPU] - I64 issue with ONNX models - fix (#9978)
i32 or i64 is used for index_element_type. So it is more convenient to get rid of the condition and stay only with the i32 option.
Tickets:
75748
75747
75029
2022-02-01 11:42:55 +03:00
Roman Kazantsev
298cced3b3 [MO, TF frontend] Correct loaders for StridedSlice and Pack operations (#10034)
* Correct Loaders for TensorFlow StridedSlice and Pack operations

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Supress INFO and WARNING messages from TensorFlow

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2022-02-01 11:02:28 +03:00
Ilya Lavrenov
4717e7639c Param/Const => Result tests (#9294)
* Tests for param => result

* Added const => result, param => result tests

* Disabled tests on CPU

* Added more tests

* Enabled import / export for template

* clang-format

* Reverted scatter tests

* Rename back

* Fixed typo

* Fixed compilation for GNA

* Fixed comments

* Fixed collisions

* Revert renaming back

* Added skip filters for GNA / MYRIAD
2022-02-01 11:01:12 +03:00
Anton Grishin
75abee2500 [GNA] Refactor and install libGNAConfig.cmake (#9793)
* Install libGNAconfig.cmake

* Refactor gnaConfig to correctly find from OV package

* remove ENABLE_INTEL_GNA option from CI

* Apply comments and fix CI

* re-trigger CI (demos issue)

* Enable GNA/samples smoke tests

* rename GNA to GNA_EXT_DIR

* re-trigger CI (mxnet cpu test issue)

* Pick azhogov changes to check CI

* try win wa

* fix win build

* re-trigger onnx

* tests

* disable win samples tests

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2022-02-01 10:51:07 +03:00
Pavel Finashov
ab3207a81b POT: Fixed command line to convert models for Windows platform. (#10024)
* For testing purpose

* Fixed command line for windows: removed re-writing PYTHOPATH

* Changed command line for re-writing PYTHONPATH
2022-02-01 10:31:16 +03:00
Vladislav Volkov
ff784ed6ab [CPU] I420toRGB and I420toBGR operations for CPU plugin (#9118) 2022-02-01 09:26:14 +03:00
Alexandra Sidorova
44362c97be [CPU] Fixed TensorIterator/Loop dynamism leftovers (#9722) 2022-02-01 09:17:03 +03:00
Edward Shogulin
cc19ff74f1 [LPT] [GPU] Multiply to group convolution (#9971)
* [LPT] MultiplyToGroupConvolution optimization for GPU

* [LPT] MatMul in FP32 in GPU workarround support

* [LPT] GPU plugin tests
2022-02-01 08:10:27 +03:00
Ilya Lavrenov
8c7e0d9479 Update include of legacy in tests (#10030) 2022-02-01 06:43:39 +03:00
Mikhail Ryzhov
bcdf7b0cad [GNA] Fixed output convert transformation (#9808)
* Fixed output convert transformation

* Update src/plugins/intel_gna/transformations/remove_converts.cpp

* Reverted wa
2022-01-31 20:08:24 +00:00
Pavel Esir
73e9eb4c61 [MO] add reinterp_shape for StridedSlice (#9622)
* added reinterp_shape for StridedSlice

* package_BOM update

* corrected unit-tests

* returned removed tests
2022-01-31 22:17:15 +03:00
2312 changed files with 72576 additions and 38532 deletions

View File

@@ -1,3 +1,12 @@
trigger:
branches:
include:
- master
- releases/*
paths:
exclude:
- docs/*
resources:
repositories:
- repository: openvino_contrib

View File

@@ -23,9 +23,9 @@ jobs:
- job: Lin
strategy:
matrix:
Dynamic:
CMAKE_BUILD_SHARED_LIBS: 'ON'
PYTHON_STATIC_ARGS:
# Dynamic:
# CMAKE_BUILD_SHARED_LIBS: 'ON'
# PYTHON_STATIC_ARGS:
Static:
CMAKE_BUILD_SHARED_LIBS: 'OFF'
PYTHON_STATIC_ARGS: -m "not dynamic_library and not template_plugin"
@@ -147,7 +147,6 @@ jobs:
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
-DENABLE_PYTHON=ON
-DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS)
-DENABLE_INTEL_GNA=$(CMAKE_BUILD_SHARED_LIBS)
-DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS)
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
-DENABLE_WHEEL=ON
@@ -237,8 +236,16 @@ jobs:
- script: |
export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph $(PYTHON_STATIC_ARGS) --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_utils/test_utils.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
displayName: 'nGraph Python Bindings Tests'
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph $(PYTHON_STATIC_ARGS) --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
displayName: 'nGraph and IE Python Bindings Tests'
continueOnError: false
# Skip test_onnx/test_zoo_models and test_onnx/test_backend due to long execution time
- script: |
export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyopenvino $(PYTHON_STATIC_ARGS) --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_utils/test_utils.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_backend.py
displayName: 'Python API 2.0 Tests'
continueOnError: false
- script: |
@@ -246,7 +253,6 @@ jobs:
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tests/mo/unit_tests --junitxml=TEST-ModelOptimizer.xml
displayName: 'Model Optimizer UT'
continueOnError: false
enabled: true
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
@@ -277,7 +283,6 @@ jobs:
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
displayName: 'GNA UT'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
displayName: 'VPU UT'
@@ -338,16 +343,6 @@ jobs:
workingDirectory: $(INSTALL_DIR)/samples_bin
displayName: 'Samples Smoke Tests'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
enabled: true
- script: |
export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH)
cd $(REPO_DIR)/src/bindings/python/tests_compatibility/test_inference_engine
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest --junitxml=TEST-PythonAPI.xml $(PYTHON_STATIC_ARGS)
displayName: 'Python API Tests'
continueOnError: false
- script: |
. $(SETUPVARS)
@@ -358,7 +353,6 @@ jobs:
workingDirectory: $(LAYER_TESTS_DIR)
displayName: 'Layer Tests'
continueOnError: false
enabled: true
- task: PublishTestResults@2
condition: always()

View File

@@ -1,3 +1,12 @@
trigger:
branches:
include:
- master
- releases/*
paths:
exclude:
- docs/*
resources:
repositories:
- repository: openvino_contrib

View File

@@ -79,11 +79,12 @@ jobs:
- task: CMake@1
inputs:
# Coverity has too many PARSE_ERROR errors with ENABLE_FASTER_BUILD=ON. Disabling FASTER_BUILD.
cmakeArgs: >
-GNinja
-DVERBOSE_BUILD=ON
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
-DENABLE_FASTER_BUILD=ON
-DENABLE_FASTER_BUILD=OFF
-DENABLE_STRICT_DEPENDENCIES=OFF
-DENABLE_REQUIREMENTS_INSTALL=OFF
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
@@ -112,11 +113,6 @@ jobs:
workingDirectory: $(BUILD_DIR)
displayName: 'Pack cov-int folder for submission'
- publish: $(BUILD_DIR)/openvino.tgz
artifact: openvino.tgz
continueOnError: true
displayName: 'Publish submission'
- script: |
curl --form token=$(COVERITY_TOKEN) \
--form email=$(COVERITY_USER) \

View File

@@ -69,9 +69,9 @@ jobs:
- script: >
env -C ~/work
./buildreleasenolto.sh
libinference_engine_preproc.so
ov_intel_cpu_plugin
ov_intel_gpu_plugin
libopenvino_gapi_preproc.so
openvino_intel_cpu_plugin
openvino_intel_gpu_plugin
clDNN_unit_tests64
gpuFuncTests
displayName: Build Lin

View File

@@ -40,6 +40,8 @@ jobs:
INSTALL_DIR: $(WORK_DIR)/install_pkg
INSTALL_TEST_DIR: $(INSTALL_DIR)/tests
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
TMP_DIR: /tmp
CCACHE_DIR: $(WORK_DIR)/ccache/mac
steps:
- script: |
@@ -87,6 +89,7 @@ jobs:
python3 -m pip install -r $(REPO_DIR)/src/core/tests/requirements_test_onnx.txt
# Speed up build
brew install ninja
brew install ccache
# Speed up tests
git clone https://github.com/google/gtest-parallel.git
workingDirectory: $(WORK_DIR)
@@ -96,17 +99,36 @@ jobs:
export PATH="/usr/local/opt/cython/bin:$PATH"
export CC=gcc
export CXX=g++
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules $(REPO_DIR)
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=OFF -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache $(REPO_DIR)
workingDirectory: $(BUILD_DIR)
displayName: 'CMake'
- script: ls -alR $(REPO_DIR)/temp/
displayName: 'List temp SDKs'
- script: ninja
- task: Cache@2
inputs:
key: 'ccache | "$(Agent.OS)"'
path: $(CCACHE_DIR)
restoreKeys: |
ccache | "$(Agent.OS)"
displayName: Cache
- script: ccache --zero-stats --max-size=10G --show-config
displayName: 'Clean ccache stats'
- script: |
export CCACHE_DIR=$(CCACHE_DIR)
export CCACHE_TEMPDIR=$(TMP_DIR)/ccache
export CCACHE_BASEDIR=$(Pipeline.Workspace)
export CCACHE_MAXSIZE=10G
ninja
workingDirectory: $(BUILD_DIR)
displayName: 'Build Mac'
- script: ccache --show-stats
displayName: 'Show ccache stats'
- script: ls -alR $(REPO_DIR)/bin/
displayName: 'List bin files'
@@ -132,34 +154,42 @@ jobs:
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'OV Core UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_filter=-MKLDNNGraphStructureTests.TestNoRedundantReordersBeforeDWConvolution:TestConvolution/MKLDNNGraphConvolutionTests.TestsConvolution/0:TestConvolutionDefaultPrimitivesPriority/MKLDNNGraphConvolutionTests.TestsConvolution/0 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
displayName: 'IE UT old'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
displayName: 'IE UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
displayName: 'CPU UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
displayName: 'VPU UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
displayName: 'ONNX Importer UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
displayName: 'IE FuncTests'
continueOnError: false
enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke*:-smoke_LPT/ReduceMinTransformation.CompareWithRefImpl/f32_Shape* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
displayName: 'CPU FuncTests'
@@ -172,6 +202,7 @@ jobs:
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
displayName: 'IE CAPITests'
continueOnError: false
enabled: false
- task: PublishTestResults@2
condition: always()

View File

@@ -30,7 +30,7 @@ jobs:
maxParallel: 2
# About 150% of total time
timeoutInMinutes: 120
timeoutInMinutes: 150
pool:
name: WIN_VMSS_VENV_D8S_WU2
@@ -133,7 +133,7 @@ jobs:
- script: |
set PATH=$(WORK_DIR)\ninja-win;%PATH%
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_INTEL_GNA=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_INTEL_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_GAPI_PREPROCESSING=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_GAPI_PREPROCESSING=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
workingDirectory: $(BUILD_DIR)
displayName: 'CMake'
@@ -198,8 +198,8 @@ jobs:
python -m pytest $(INSTALL_DIR)\tests\smoke_tests\ --env_conf $(INSTALL_DIR)\tests\smoke_tests\env_config.yml -s --junitxml=TEST-SamplesSmokeTests.xml
workingDirectory: $(INSTALL_DIR)
displayName: 'Samples Smoke Tests'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
continueOnError: false
- script: rd /Q /S $(BUILD_DIR)
displayName: 'Clean build dir'
@@ -218,10 +218,10 @@ jobs:
displayName: 'Tensorflow Frontend UT'
continueOnError: false
- script: |
set PATH=$(IB_DIR);%PATH%
call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\InferenceEngineUnitTests.exe --gtest_output=xml:TEST-InferenceEngineUnitTests-IB.xml
displayName: 'IE UT old - IB'
# set PATH=$(IB_DIR);%PATH%
# call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\InferenceEngineUnitTests.exe --gtest_output=xml:TEST-InferenceEngineUnitTests-IB.xml
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineUnitTests --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
displayName: 'IE UT old'
continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
@@ -235,7 +235,6 @@ jobs:
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
displayName: 'GNA UT'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
displayName: 'VPU UT'
@@ -257,11 +256,10 @@ jobs:
displayName: 'TEMPLATE FuncTests'
continueOnError: false
# call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke* --gtest_output=xml:TEST-cpuFuncTests.xml
- script: |
set PATH=$(IB_DIR);%PATH%
call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24
displayName: 'CPU FuncTests - IB'
# set PATH=$(IB_DIR);%PATH%
# call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuFuncTests --gtest_filter=*smoke* --gtest_output=xml:TEST-cpuFuncTests.xml
displayName: 'CPU FuncTests'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'OFF')

View File

@@ -90,7 +90,7 @@ jobs:
path: build/docs/sphinx.log
- name: 'Upload html'
if: github.event_name == 'push'
if: always()
uses: actions/upload-artifact@v2
with:
name: openvino_html

View File

@@ -82,6 +82,7 @@ jobs:
- name: Install Clang dependency
run: |
sudo apt update
sudo apt --assume-yes remove clang-7 clang-8 clang-9 clang-10 clang-11
sudo apt --assume-yes install libclang-12-dev
- name: Install Python-based dependencies

View File

@@ -34,7 +34,9 @@ endif()
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
message (STATUS "CMAKE_VERSION ......................... " ${CMAKE_VERSION})
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
message (STATUS "CMAKE_SOURCE_DIR ...................... " ${CMAKE_SOURCE_DIR})
message (STATUS "OpenVINO_SOURCE_DIR ................... " ${OpenVINO_SOURCE_DIR})
message (STATUS "OpenVINO_BINARY_DIR ................... " ${OpenVINO_BINARY_DIR})
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID})
@@ -42,7 +44,7 @@ message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
message (STATUS "CMAKE_TOOLCHAIN_FILE .................. " ${CMAKE_TOOLCHAIN_FILE})
# remove file with exported developer targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/ngraph/ngraphTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/ngraphTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
foreach(component IN LISTS openvino_export_components)

68
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,68 @@
# How to contribute to the OpenVINO repository
We suppose that you are an enthusiastic coder, want to contribute some code. For that purpose OpenVINO project now has a repository on the GitHub, to simplify everybody's life! All the bug fixes, new functionality, new tutorials etc. should be submitted via the GitHub's mechanism of pull requests.
If you are not familiar with the mechanism - do not worry, it's very simple. Keep reading.
## Before you start contributing you should
- Make sure you agree to contribute your code under [OpenVINO (Apache 2.0)](https://github.com/openvinotoolkit/openvino/blob/master/LICENSE) license.
- If you are submitting a new module, you should go into [openvino_contrib](https://github.com/openvinotoolkit/openvino_contrib) repository by default.
- If you are going to fix a bug, check that it's still exists. This can be done by building the latest [releases/2020/3](https://github.com/openvinotoolkit/openvino/tree/releases/2020/3) branch (LTS release) or the latest master branch, and make sure that the error is still reproducible there. We do not fix bugs that only affect older non-LTS releases like 2020.2 for example (more details about [branching strategy](https://github.com/openvinotoolkit/openvino/wiki/Branches))
- Make sure that nobody beat you into fixing or reporting the issue by doing a search on the [Github OpenVINO issues](https://github.com/openvinotoolkit/openvino/issues) page, and making sure that there isn't someone working on it. In the latter case you might provide support or suggestion in the issue or in the linked pull request.
- If you have a question about the software, then this is **NOT** the right place. You should open up a question at the [OpenVINO forum](https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/bd-p/distribution-openvino-toolkit). In order to post a decent question from the start, feel free to read the official forum guidelines.
Before you open up anything on the OpenVINO GitHub page, be sure that you are at the right place with your problem.
## "Fork & Pull Request model" for code contribution
### [](https://github.com/openvinotoolkit/openvino/wiki/Contribute#the-instruction-in-brief)The instruction in brief
- Register at GitHub. Create your fork of OpenVINO repository [https://github.com/openvinotoolkit/openvino](https://github.com/openvinotoolkit/openvino) (see [https://help.github.com/articles/fork-a-repo](https://help.github.com/articles/fork-a-repo) for details).
- Install Git.
- Set your user name and email address in a Git configuration according to GitHub account (see [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for details).
- Choose a task for yourself. It could be a bugfix or some new code.
- Choose a base branch for your work. More details about branches and policies are here: [Branches](https://github.com/openvinotoolkit/openvino/wiki/Branches)
- Clone your fork to your computer.
- Create a new branch (with a meaningful name) from the base branch you chose.
- Modify / add the code following our [Coding Style Guide](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLines) and [Documentation guidelines](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLinesDocumentation).
- If you want to add a new sample, please look at this [Guide for contributing to C++/C/Python IE samples](https://github.com/openvinotoolkit/openvino/wiki/SampleContribute)
- Run testsuite locally:
- execute each test binary from the artifacts directory, e.g. `<source dir>/bin/intel64/Release/ieFuncTests`
- If you contribute to the documentation and want to add a new guide:
- Create a new markdown file in an appropriate folder.
- **REQUIRED:** The document title must contain a document label in a form: `{#openvino_docs_<name>}`. For example: `Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ {#openvino_docs_MO_DG_IR_and_opsets}`.
- Add your file to the documentation structure. Open the documentation structure file [`docs/doxygen/ie_docs.xml`](https://github.com/openvinotoolkit/openvino/blob/master/docs/doxygen/ie_docs.xml) and add your file path to the appropriate section.
- When you are done, make sure that your branch is to date with latest state of the branch you want to contribute to (e.g. `git fetch upstream && git merge upstream/master`), push your branch to your GitHub fork; then create a pull request from your branch to the base branch (see [https://help.github.com/articles/using-pull-requests](https://help.github.com/articles/using-pull-requests) for details).
## Making a good pull request
Following these guidelines will increase the likelihood of your pull request being accepted:
- Before pushing your PR to the repository, make sure that it builds perfectly fine on your local system.
- Add enough information, like a meaningful title, the reason why you made the commit and a link to the issue page if you opened one for this PR.
- Scope your PR to one issue. Before submitting, make sure the diff contains no unrelated changes. If you want to cover more than one issue, submit your changes for each as separate pull requests.
- If you have added new functionality, you should update/create the relevant documentation, as well as add tests for it to the testsuite.
- Try not to include "oops" commits - ones that just fix an error in the previous commit. If you have those, then before submitting [squash](https://github.com/openvinotoolkit/openvino/wiki/Contribute#https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits) those fixes directly into the commits where they belong.
- Make sure to choose the right base branch and to follow the [Coding Style Guide](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLines) for your code or [Documentation guidelines](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLinesDocumentation) you are changing documentation files.
- Make sure to add test for new functionality or test that reproduces fixed bug with related test data. Please do not add extra images or videos, if some of existing media files are suitable.
## Testing and merging pull requests
- Your pull request will be automatically tested by OpenVINO's precommit (testing status are automatically reported as "green" or "red" circles in precommit steps on PR's page). If any builders have failed, you should fix the issue. To rerun the automatic builds just push changes to your branch on GitHub. No need to close pull request and open a new one!
- Once all the builders are "green", one of OpenVINO developers will review your code. Reviewer could ask you to modify your pull request. Please provide timely response for reviewers (within weeks, not months), otherwise you submission could be postponed or even rejected.
## PR review good practices
- Originator is responsible for driving the review of changes and should ping reviewers periodically.
- Originator should close comments from the Reviewer when it is resolved. The Reviewer may re-open the comment if he does not agree with the resolution.
- Originator should request re-review from the Reviewer when all comments are resolved by pushing the button in the “Reviewers” section.
- If it is still WIP and you want to check CI test results early then use _Draft_ PR.
- Do **NOT** rewrite history (push -f) once you converted draft PR into regular one, add new commits instead. Looking at diffs makes review easier.
- Write meaningful description of commits resulting from review. _"Addressing review comments"_ is **NOT** a good description! Having a quick look at good descriptions can tell you much what is going on in PR without a need to go through all of resolved comments.
## Merging PR
As soon as the reviewer is fine with the pull request and Precommit likes your code and shows "green" status, the "Approved" review status is put, which signals OpenVINO maintainers that they can merge your pull request.
© Copyright 2018-2022, OpenVINO team

View File

@@ -6,30 +6,29 @@
[![PyPI Downloads](https://pepy.tech/badge/openvino)](https://pepy.tech/project/openvino)
This toolkit allows developers to deploy pre-trained deep learning models
through a high-level C++ Inference Engine API integrated with application logic.
through a high-level OpenVINO™ Runtime C++ and Python APIs integrated with application logic.
This open source version includes several components: namely [Model Optimizer], [nGraph] and
[Inference Engine], as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
This open source version includes several components: namely [Model Optimizer], [OpenVINO™ Runtime], [Post-Training Optimization Tool], as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
It supports pre-trained models from the [Open Model Zoo], along with 100+ open
source and public models in popular formats such as Caffe\*, TensorFlow\*,
MXNet\* and ONNX\*.
source and public models in popular formats such as TensorFlow, ONNX, PaddlePaddle, MXNet, Caffe, Kaldi.
## Repository components:
* [Inference Engine]
* [nGraph]
## Repository components
* [OpenVINO™ Runtime]
* [Model Optimizer]
* [Post-Training Optimization Tool]
## License
Deep Learning Deployment Toolkit is licensed under [Apache License Version 2.0](LICENSE).
By contributing to the project, you agree to the license and copyright terms therein
and release your contribution under these terms.
## Resources:
## Resources
* Docs: https://docs.openvino.ai/
* Wiki: https://github.com/openvinotoolkit/openvino/wiki
* Issue tracking: https://github.com/openvinotoolkit/openvino/issues
* Storage: https://storage.openvinotoolkit.org/
* Additional OpenVINO™ modules: https://github.com/openvinotoolkit/openvino_contrib
* Additional OpenVINO™ toolkit modules: https://github.com/openvinotoolkit/openvino_contrib
* [Intel® Distribution of OpenVINO™ toolkit Product Page](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html)
* [Intel® Distribution of OpenVINO™ toolkit Release Notes](https://software.intel.com/en-us/articles/OpenVINO-RelNotes)
@@ -44,8 +43,8 @@ Please report questions, issues and suggestions using:
\* Other names and brands may be claimed as the property of others.
[Open Model Zoo]:https://github.com/openvinotoolkit/open_model_zoo
[Inference Engine]:https://software.intel.com/en-us/articles/OpenVINO-InferEngine
[Model Optimizer]:https://software.intel.com/en-us/articles/OpenVINO-ModelOptimizer
[nGraph]:https://docs.openvino.ai/latest/openvino_docs_nGraph_DG_DevGuide.html
[OpenVINO™ Runtime]:https://docs.openvino.ai/latest/openvino_docs_OV_Runtime_User_Guide.html
[Model Optimizer]:https://docs.openvino.ai/latest/openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html
[Post-Training Optimization Tool]:https://docs.openvino.ai/latest/pot_README.html
[tag on StackOverflow]:https://stackoverflow.com/search?q=%23openvino

View File

@@ -23,14 +23,14 @@ ie_coverage_extract(INPUT "openvino" OUTPUT "legacy"
ie_coverage_genhtml(INFO_FILE "legacy"
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
ie_coverage_extract(INPUT "openvino" OUTPUT "ov_hetero_plugin"
ie_coverage_extract(INPUT "openvino" OUTPUT "hetero_plugin"
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/src/plugins/hetero/*")
ie_coverage_genhtml(INFO_FILE "ov_hetero_plugin"
ie_coverage_genhtml(INFO_FILE "hetero_plugin"
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
ie_coverage_extract(INPUT "openvino" OUTPUT "ov_auto_plugin"
ie_coverage_extract(INPUT "openvino" OUTPUT "auto_plugin"
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/src/plugins/auto/*")
ie_coverage_genhtml(INFO_FILE "ov_auto_plugin"
ie_coverage_genhtml(INFO_FILE "auto_plugin"
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
ie_coverage_extract(INPUT "openvino" OUTPUT "preprocessing"
@@ -73,9 +73,9 @@ if (ENABLE_INTEL_GPU)
endif()
if(ENABLE_INTEL_GNA)
ie_coverage_extract(INPUT "openvino" OUTPUT "ov_intel_gna_plugin"
ie_coverage_extract(INPUT "openvino" OUTPUT "intel_gna_plugin"
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/src/plugins/intel_gna/*")
ie_coverage_genhtml(INFO_FILE "ov_intel_gna_plugin"
ie_coverage_genhtml(INFO_FILE "intel_gna_plugin"
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
endif()

View File

@@ -28,12 +28,12 @@ if(COMMAND get_linux_name)
endif()
if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
set(protoc_version "3.9.2")
set(protoc_version "3.18.2")
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64"
SHA256 "1d6da1d97d0cbfcd333558afe24533eb3cb48dc1e0ab5e971aa1e50ede8bcf45"
SHA256 "42fde2b6044c1f74c7e86d4e03b43aac87128ddf57ac6ed8c4eab7a1e21bbf21"
)
debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
@@ -269,7 +269,7 @@ include(${OpenVINO_SOURCE_DIR}/src/cmake/ie_parallel.cmake)
if(ENABLE_INTEL_GNA)
reset_deps_cache(
GNA
GNA_EXT_DIR
GNA_PLATFORM_DIR
GNA_KERNEL_LIB_NAME
GNA_LIBS_LIST
@@ -286,12 +286,26 @@ if(ENABLE_INTEL_GNA)
LIST(APPEND FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/linux)
endif()
RESOLVE_DEPENDENCY(GNA
RESOLVE_DEPENDENCY(GNA_EXT_DIR
ARCHIVE_UNIFIED "GNA/GNA_${GNA_VERSION}.zip"
TARGET_PATH "${TEMP}/gna_${GNA_VERSION}"
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
FILES_TO_EXTRACT FILES_TO_EXTRACT_LIST
SHA256 ${GNA_HASH})
update_deps_cache(GNA "${GNA}" "Path to GNA root folder")
debug_message(STATUS "gna=" ${GNA})
update_deps_cache(GNA_EXT_DIR "${GNA_EXT_DIR}" "Path to GNA root folder")
debug_message(STATUS "gna=" ${GNA_EXT_DIR})
if (WIN32)
set(GNA_PLATFORM_DIR win64 CACHE STRING "" FORCE)
elseif (UNIX)
set(GNA_PLATFORM_DIR linux CACHE STRING "" FORCE)
else ()
message(FATAL_ERROR "GNA not supported on this platform, only linux, and windows")
endif ()
set(GNA_LIB_DIR x64 CACHE STRING "" FORCE)
set(GNA_PATH ${GNA_EXT_DIR}/${GNA_PLATFORM_DIR}/${GNA_LIB_DIR} CACHE STRING "" FORCE)
if(NOT BUILD_SHARED_LIBS)
list(APPEND PATH_VARS "GNA_PATH")
endif()
endif()

View File

@@ -129,7 +129,7 @@ set(IE_DEBUG_POSTFIX_WIN "d")
set(IE_RELEASE_POSTFIX_WIN "")
set(IE_DEBUG_POSTFIX_LIN "")
set(IE_RELEASE_POSTFIX_LIN "")
set(IE_DEBUG_POSTFIX_MAC "")
set(IE_DEBUG_POSTFIX_MAC "d")
set(IE_RELEASE_POSTFIX_MAC "")
if(WIN32)
@@ -158,16 +158,22 @@ else ()
endif()
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
macro(ov_set_if_not_defined var value)
if(NOT DEFINED ${var})
set(${var} ${value})
endif()
endmacro()
if(NOT UNIX)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
endif()
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
set(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
@@ -206,6 +212,10 @@ endif()
macro(ov_install_static_lib target comp)
if(NOT BUILD_SHARED_LIBS)
get_target_property(target_type ${target} TYPE)
if(${target_type} STREQUAL "STATIC_LIBRARY")
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL FALSE)
endif()
install(TARGETS ${target} EXPORT OpenVINOTargets
ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ${comp} ${ARGN})
endif()

View File

@@ -28,9 +28,26 @@ if (ENABLE_UB_SANITIZER)
if (WIN32)
message(FATAL_ERROR "UndefinedBehavior sanitizer is not supported in Windows")
endif()
# TODO: Remove -fno-sanitize=null as thirdparty/ocl/clhpp_headers UBSAN compatibility resolved:
# https://github.com/KhronosGroup/OpenCL-CLHPP/issues/17
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=undefined -fno-sanitize=null")
# Mute -fsanitize=function Indirect call of a function through a function pointer of the wrong type.
# Sample cases:
# call to function GetAPIVersion through pointer to incorrect function type 'void *(*)()'
# Mute -fsanitize=alignment Use of a misaligned pointer or creation of a misaligned reference. Also sanitizes assume_aligned-like attributes.
# Sample cases:
# VPU_FixedMaxHeapTest.DefaultConstructor test case load of misaligned address 0x62000000187f for type 'const DataType', which requires 4 byte alignment
# Mute -fsanitize=bool Load of a bool value which is neither true nor false.
# Samples cases:
# ie_c_api_version.apiVersion test case load of value 32, which is not a valid value for type 'bool'
# Mute -fsanitize=enum Load of a value of an enumerated type which is not in the range of representable values for that enumerated type.
# Samples cases:
# load of value 4294967295, which is not a valid value for type 'const (anonymous namespace)::onnx::Field'
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=undefined -fno-sanitize=null -fno-sanitize=alignment -fno-sanitize=bool -fno-sanitize=enum")
if(OV_COMPILER_IS_CLANG)
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fno-sanitize=function")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# TODO: Remove -Wno-maybe-uninitialized after CVS-61143 fix
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -Wno-maybe-uninitialized")

View File

@@ -146,8 +146,6 @@ function (DownloadOrExtractInternal URL archive_path unpacked_path folder fattal
endfunction(DownloadOrExtractInternal)
file(REMOVE ${CMAKE_BINARY_DIR}/dependencies_64.txt)
function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked_path result_path folder fattal resultExt use_alternatives sha256 files_to_extract)
set (archive_path ${TEMP}/download/${archive_name})
set (status "ON")
@@ -164,7 +162,6 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked
if (${use_alternatives})
set(DEP_INFO "${component}=${URL}")
debug_message (STATUS "DEPENDENCY_URL: ${DEP_INFO}")
file(APPEND ${CMAKE_BINARY_DIR}/dependencies_64.txt "${DEP_INFO}\n")
endif()
debug_message ("checking that unpacked directory exist: ${unpacked_path}")

View File

@@ -3,7 +3,7 @@
#
set(FRONTEND_INSTALL_INCLUDE "runtime/include/")
set(FRONTEND_NAME_PREFIX "ov_")
set(FRONTEND_NAME_PREFIX "openvino_")
set(FRONTEND_NAME_SUFFIX "_frontend")
set(FRONTEND_NAMES "" CACHE INTERNAL "")
@@ -35,7 +35,7 @@ function(ov_generate_frontends_hpp)
endif()
# add frontends to libraries including ov_frontends.hpp
ov_target_link_frontends(ov_runtime)
ov_target_link_frontends(openvino)
set(ov_frontends_hpp "${CMAKE_BINARY_DIR}/src/frontends/common/src/ov_frontends.hpp")
set(frontends_hpp_in "${IEDevScripts_DIR}/frontends/ov_frontends.hpp.in")

View File

@@ -2,7 +2,7 @@
CppMethod: '^(operator\W+|[a-z_\d]+|signaling_NaN|quiet_NaN)$'
ClassName: '^([A-Z][\w]+|b?float16|numeric_limits|ngraph_error|stopwatch|unsupported_op)$'
StructName: '^([A-Z][\w]+|element_type_traits|hash|oi_pair)$'
FunctionName: '^(operator\W+|[a-z_\d]+)$'
FunctionName: '^(operator\W+|[a-z_\d]+)|PrintTo$'
Namespace: '^([a-z\d_]+|InferenceEngine)$'
NamespaceAlias: '^([a-z\d_]+|InferenceEngine)$'
UnionName: '[A-Z][\w]+$'
@@ -99,7 +99,7 @@ CxxCatchStatement: '^.*$'
CxxTryStatement: '^.*$'
CxxForRangeStatement: '^.*$'
MsAsmStatement: 'XXXX'
NullStatement: 'XXXX'
NullStatement: '^.*$'
DeclarationStatement: '^.*$'
TranslationUnit: 'XXXX'
UnexposedAttribute: '^.*$'

View File

@@ -15,6 +15,10 @@ function(ie_cpack_set_library_dir)
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH runtime/bin/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
elseif(APPLE)
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
else()
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)

View File

@@ -102,32 +102,33 @@ function(ie_add_plugin)
endif()
add_dependencies(ie_plugins ${IE_PLUGIN_NAME})
if(TARGET inference_engine_preproc)
if(TARGET openvino_gapi_preproc)
if(BUILD_SHARED_LIBS)
add_dependencies(${IE_PLUGIN_NAME} inference_engine_preproc)
add_dependencies(${IE_PLUGIN_NAME} openvino_gapi_preproc)
else()
target_link_libraries(${IE_PLUGIN_NAME} PRIVATE inference_engine_preproc)
target_link_libraries(${IE_PLUGIN_NAME} PRIVATE openvino_gapi_preproc)
endif()
endif()
# fake dependencies to build in the following order:
# IE -> IE readers -> IE inference plugins -> IE-based apps
if(BUILD_SHARED_LIBS)
if(TARGET ov_ir_frontend)
add_dependencies(${IE_PLUGIN_NAME} ov_ir_frontend)
if(TARGET openvino_ir_frontend)
add_dependencies(${IE_PLUGIN_NAME} openvino_ir_frontend)
endif()
if(TARGET openvino_onnx_frontend)
add_dependencies(${IE_PLUGIN_NAME} openvino_onnx_frontend)
endif()
if(TARGET openvino_paddle_frontend)
add_dependencies(${IE_PLUGIN_NAME} openvino_paddle_frontend)
endif()
if(TARGET openvino_tensorflow_frontend)
add_dependencies(${IE_PLUGIN_NAME} openvino_tensorflow_frontend)
endif()
# TODO: remove with legacy CNNNLayer API / IR v7
if(TARGET inference_engine_ir_v7_reader)
add_dependencies(${IE_PLUGIN_NAME} inference_engine_ir_v7_reader)
endif()
if(TARGET ov_onnx_frontend)
add_dependencies(${IE_PLUGIN_NAME} ov_onnx_frontend)
endif()
if(TARGET ov_paddle_frontend)
add_dependencies(${IE_PLUGIN_NAME} ov_paddle_frontend)
endif()
if(TARGET ov_tensorflow_frontend)
add_dependencies(${IE_PLUGIN_NAME} ov_tensorflow_frontend)
endif()
endif()
# install rules
@@ -319,7 +320,7 @@ function(ie_generate_plugins_hpp)
endforeach()
# add plugins to libraries including ie_plugins.hpp
ie_target_link_plugins(ov_runtime)
ie_target_link_plugins(openvino)
if(TARGET inference_engine_s)
ie_target_link_plugins(inference_engine_s)
endif()

View File

@@ -82,8 +82,8 @@ function(register_extra_modules)
endif()
endforeach()
if ("${NS}" STREQUAL "openvino")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime ALIAS ov_runtime)\n")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime::dev ALIAS ov_runtime_dev)\n")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime ALIAS openvino)\n")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime::dev ALIAS openvino_dev)\n")
endif()
endfunction()

View File

@@ -44,7 +44,7 @@ find_dependency(InferenceEngine
NO_DEFAULT_PATH)
find_dependency(ngraph
PATHS "${CMAKE_CURRENT_LIST_DIR}/src/core"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)

View File

@@ -168,7 +168,19 @@ endif()
_ov_find_dependency(Threads)
if(NOT TARGET ov_runtime)
set(ENABLE_INTEL_GNA "@ENABLE_INTEL_GNA@")
set(ENABLE_INTEL_GNA_SHARED "@BUILD_SHARED_LIBS@")
if(ENABLE_INTEL_GNA AND NOT ENABLE_INTEL_GNA_SHARED AND NOT libGNA_FOUND)
set_and_check(GNA_PATH "@PACKAGE_GNA_PATH@")
_ov_find_dependency(libGNA
COMPONENTS KERNEL
CONFIG
PATHS ${CMAKE_CURRENT_LIST_DIR}
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
endif()
if(NOT TARGET openvino)
set(_ov_as_external_package ON)
include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake")
@@ -224,6 +236,7 @@ if(_need_package_name_reset)
unset(_need_package_name_reset)
endif()
unset(${CMAKE_FIND_PACKAGE_NAME}_IR_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_Paddle_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND)

View File

@@ -26,11 +26,16 @@
#
# Frontends:
#
# ngraph_ov_onnx_frontend_FOUND - True if the system has ov_onnx_frontend library
# ngraph::ov_onnx_frontend - ONNX FrontEnd target (optional)
# ngraph_onnx_frontend_FOUND - True if the system has ngraph::onnx_frontend library
# ngraph::onnx_frontend - ONNX FrontEnd target (optional)
#
# ngraph_paddle_frontend_FOUND - True if the system has Paddle frontend
# ngraph::ov_paddle_frontend - nGraph Paddle frontend (optional)
# ngraph_paddle_frontend_FOUND - True if the system has Paddle frontend
# ngraph::paddle_frontend - nGraph Paddle frontend (optional)
#
# ngraph_ir_frontend_FOUND - True if the system has OpenVINO IR frontend
#
# ngraph_tensorflow_frontend_FOUND - True if the system has TensorFlow frontend
# ngraph::tensorflow_frontend - nGraph TensorFlow frontend (optional)
#
@PACKAGE_INIT@
@@ -50,43 +55,46 @@ if(TARGET openvino::runtime AND NOT TARGET ngraph::ngraph)
INTERFACE_LINK_LIBRARIES openvino::runtime)
endif()
if(TARGET openvino::frontend::onnx AND NOT TARGET ngraph::ov_onnx_frontend)
add_library(ngraph::ov_onnx_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::ov_onnx_frontend PROPERTIES
if(TARGET openvino::frontend::onnx AND NOT TARGET ngraph::onnx_frontend)
add_library(ngraph::onnx_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::onnx_frontend PROPERTIES
INTERFACE_LINK_LIBRARIES openvino::frontend::onnx)
endif()
if(TARGET openvino::frontend::paddle AND NOT TARGET ngraph::ov_paddle_frontend)
add_library(ngraph::ov_paddle_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::ov_paddle_frontend PROPERTIES
if(TARGET openvino::frontend::paddle AND NOT TARGET ngraph::paddle_frontend)
add_library(ngraph::paddle_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::paddle_frontend PROPERTIES
INTERFACE_LINK_LIBRARIES openvino::frontend::paddle)
endif()
if(TARGET openvino::frontend::tensorflow AND NOT TARGET ngraph::ov_tensorflow_frontend)
add_library(ngraph::ov_tensorflow_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::ov_tensorflow_frontend PROPERTIES
if(TARGET openvino::frontend::tensorflow AND NOT TARGET ngraph::tensorflow_frontend)
add_library(ngraph::tensorflow_frontend INTERFACE IMPORTED)
set_target_properties(ngraph::tensorflow_frontend PROPERTIES
INTERFACE_LINK_LIBRARIES openvino::frontend::tensorflow)
endif()
set(ngraph_ngraph_FOUND ON)
set(NGRAPH_LIBRARIES ngraph::ngraph)
set(ngraph_ov_onnx_frontend_FOUND ${OpenVINO_Frontend_ONNX_FOUND})
set(ngraph_onnx_frontend_FOUND ${OpenVINO_Frontend_ONNX_FOUND})
set(ngraph_tensorflow_frontend_FOUND ${OpenVINO_Frontend_TensorFlow_FOUND})
set(ngraph_paddle_frontend_FOUND ${OpenVINO_Frontend_Paddle_FOUND})
set(ngraph_onnx_importer_FOUND ${OpenVINO_Frontend_ONNX_FOUND})
if(ngraph_onnx_importer_FOUND)
set(ONNX_IMPORTER_LIBRARIES ngraph::ov_onnx_frontend)
set(ONNX_IMPORTER_LIBRARIES ngraph::onnx_frontend)
# ngraph::onnx_importer target and variables are deprecated
# but need to create a dummy target for BW compatibility
if(NOT TARGET ngraph::onnx_importer)
add_library(ngraph::onnx_importer INTERFACE IMPORTED)
set_target_properties(ngraph::onnx_importer PROPERTIES
INTERFACE_LINK_LIBRARIES ngraph::ov_onnx_frontend)
INTERFACE_LINK_LIBRARIES ngraph::onnx_frontend)
endif()
endif()
set(ngraph_paddle_frontend_FOUND ${OpenVINO_Frontend_Paddle_FOUND})
set(ngraph_tensorflow_frontend_FOUND ${OpenVINO_Frontend_TensorFlow_FOUND})
set(ngraph_onnx_frontend_FOUND ${OpenVINO_Frontend_ONNX_FOUND})
set(ngraph_ir_frontend_FOUND ${OpenVINO_Frontend_IR_FOUND})
check_required_components(ngraph)

View File

@@ -86,11 +86,6 @@ ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/onnx_import"
ie_onnx_import_out_files)
set(rel_path "docs/onnx_custom_op")
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/docs/models"
docs_onnx_out_files)
if(ENABLE_TESTS)
if(ENABLE_OV_ONNX_FRONTEND AND ENABLE_REQUIREMENTS_INSTALL)
find_package(PythonInterp 3 REQUIRED)

View File

@@ -25,7 +25,7 @@ endif()
if(use_static_runtime)
foreach(lang C CXX)
foreach(build_type "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO")
set(flag_var "CMAKE_${lang}_FLAGS${build_type}")
set(flag_var "CMAKE_${lang}_FLAGS${build_type}_INIT")
string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endforeach()
endforeach()

View File

@@ -1,41 +0,0 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
if(DEFINED OECORE_BASE_DIR)
# OECORE_BASE_DIR was passed via CMake command line, nothing to do
elseif(DEFINED ENV{OECORE_BASE_DIR})
# User sets OECORE_BASE_DIR environment variable
set(OECORE_BASE_DIR $ENV{OECORE_BASE_DIR})
elseif(DEFINED ENV{OECORE_NATIVE_SYSROOT})
# OECORE_NATIVE_SYSROOT is a default environment variable for the OECore toolchain
set(OECORE_BASE_DIR "$ENV{OECORE_NATIVE_SYSROOT}/../..")
else()
# Use default value
set(OECORE_BASE_DIR "/usr/local/oecore-x86_64")
endif()
set(OECORE_TARGET_NAME "aarch64-ese-linux")
set(OECORE_TARGET_SYSROOT "${OECORE_BASE_DIR}/sysroots/${OECORE_TARGET_NAME}")
set(OECORE_HOST_SYSROOT "${OECORE_BASE_DIR}/sysroots/x86_64-esesdk-linux")
set(OECORE_HOST_COMPILER_BIN_DIR "${OECORE_HOST_SYSROOT}/usr/bin/${OECORE_TARGET_NAME}")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
set(CMAKE_SYSROOT "${OECORE_TARGET_SYSROOT}")
set(CMAKE_C_COMPILER "${OECORE_HOST_COMPILER_BIN_DIR}/aarch64-ese-linux-gcc")
set(CMAKE_CXX_COMPILER "${OECORE_HOST_COMPILER_BIN_DIR}/aarch64-ese-linux-g++")
set(CMAKE_C_FLAGS_INIT "-mcpu=cortex-a53 -mtune=cortex-a53 --sysroot=${OECORE_TARGET_SYSROOT}")
set(CMAKE_CXX_FLAGS_INIT "-mcpu=cortex-a53 -mtune=cortex-a53 --sysroot=${OECORE_TARGET_SYSROOT}")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

View File

@@ -35,14 +35,14 @@ if(_onecoreuap_arch STREQUAL "x64")
# Forcefull make VS search for C++ libraries in these folders prior to other c++ standard libraries localizations.
add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x64_OneCore\)\"")
set(CMAKE_C_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
elseif(_onecoreuap_arch STREQUAL "X86")
add_link_options("/LIBPATH:\"\$\(VCInstallDir\)lib/onecore\"")
add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x86_OneCore\)\"")
set(CMAKE_C_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
else()
message(FATAL_ERROR "Unsupported architecture ${_onecoreuap_arch}. Only X86 or X86_64 are supported")
endif()
@@ -52,8 +52,8 @@ unset(_onecoreuap_arch)
# compile flags
set(includes "/I\"\$\(UniversalCRT_IncludePath\)\"")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${includes}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${includes}")
set(CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} ${includes}")
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} ${includes}")
unset(includes)
# linker flags
@@ -62,9 +62,9 @@ foreach(lib kernel32 user32 advapi32 ole32 mscoree combase)
set(linker_flags "/NODEFAULTLIB:${lib}.lib ${linker_flags}")
endforeach()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${linker_flags}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${linker_flags}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${linker_flags}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} ${linker_flags}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} ${linker_flags}")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} ${linker_flags}")
unset(linker_flags)
#

View File

@@ -17,14 +17,11 @@ if(NOT ENABLE_DOCKER)
set(OpenVINO_DIR ${CMAKE_BINARY_DIR})
endif()
if(ENABLE_OV_ONNX_FRONTEND)
add_subdirectory(onnx_custom_op)
endif()
add_subdirectory(template_extension)
set(all_docs_targets
ie_docs_snippets ov_template_func_tests
template_extension ov_template_extension ov_template_plugin)
template_extension openvino_template_extension openvino_template_plugin)
foreach(target_name IN LISTS all_docs_targets)
if(TARGET ${target_name})
set_target_properties(${target_name} PROPERTIES FOLDER docs)
@@ -36,7 +33,7 @@ if(NOT ENABLE_DOCKER)
# install
foreach(target ov_template_plugin template_extension ov_template_extension)
foreach(target openvino_template_plugin template_extension openvino_template_extension)
if(TARGET ${target})
install(TARGETS ${target}
LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH}
@@ -51,7 +48,6 @@ set(ENABLE_OPENVINO_NOTEBOOKS OFF CACHE BOOL "Build with openvino notebooks")
set(OMZ_DOCS_DIR "" CACHE PATH "Path to open_model_zoo documentation dir.")
set(WORKBENCH_DOCS_DIR "" CACHE PATH "Path to workbench documentation dir.")
set(OVMS_DOCS_DIR "" CACHE PATH "Path to model server documentation dir.")
set(GST_DOCS_DIR "" CACHE PATH "Path to gst-video-analytics documentation dir.")
set(GRAPH_CSV_DIR "" CACHE PATH "Path to the folder containing csv data for rendering graphs.")
function(build_docs)
@@ -89,6 +85,8 @@ function(build_docs)
# Sphinx folders, doxyrest templates and config
set(SPHINX_CONF_IN "${DOCS_SOURCE_DIR}/conf.py")
set(SPHINX_TEMPLATES_IN "${DOCS_SOURCE_DIR}/_templates")
set(SPHINX_TEMPLATES_OUT "${RST_OUTPUT}/_templates")
set(SPHINX_CONF_OUT "${RST_OUTPUT}/conf.py")
set(SPHINX_STATIC_IN "${DOCS_SOURCE_DIR}/_static")
set(SPHINX_STATIC_OUT "${RST_OUTPUT}/_static")
@@ -132,6 +130,16 @@ function(build_docs)
)
endif()
list(APPEND commands
COMMAND ${CMAKE_COMMAND} -E copy ${API_DOCS_IN}/api_reference.rst ${API_DOCS_OUT}/api_reference.rst
)
if(ENABLE_PYTHON)
list(APPEND commands
COMMAND ${CMAKE_COMMAND} -E copy_directory ${API_DOCS_IN}/ie_python_api ${API_DOCS_OUT}/ie_python_api
)
endif()
# omz doc files
if(EXISTS "${OMZ_DOCS_DIR}")
get_filename_component(OMZ_DOCS_DIR "${OMZ_DOCS_DIR}" ABSOLUTE)
@@ -160,14 +168,6 @@ function(build_docs)
--output_dir=${DOCS_BUILD_DIR}/ovms)
endif()
# gst doc files
if(EXISTS "${GST_DOCS_DIR}")
get_filename_component(GST_DOCS_DIR "${GST_DOCS_DIR}" ABSOLUTE)
list(APPEND commands COMMAND ${PYTHON_EXECUTABLE} ${DOXY_MD_FILTER}
--input_dir=${GST_DOCS_DIR}
--output_dir=${DOCS_BUILD_DIR}/gst)
endif()
add_custom_target(preprocess_docs
COMMENT "Preprocess documentation"
VERBATIM)
@@ -197,7 +197,7 @@ function(build_docs)
COMMAND ${PYTHON_EXECUTABLE} ${COPY_IMAGES_SCRIPT} ${XML_OUTPUT} ${RST_OUTPUT}
COMMAND ${PYTHON_EXECUTABLE} ${DOXYGEN_MAPPING_SCRIPT} ${XML_OUTPUT} ${DOCS_BUILD_DIR} ${OpenVINO_SOURCE_DIR}/../
COMMAND ${CMAKE_COMMAND} -E copy ${SPHINX_INDEX_IN} ${SPHINX_INDEX_OUT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${API_DOCS_IN} ${API_DOCS_OUT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SPHINX_TEMPLATES_IN} ${SPHINX_TEMPLATES_OUT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DOXYREST_IN} ${DOXYREST_OUT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DOXYREST_SPHINX_IN} ${DOXYREST_SPHINX_OUT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SPHINX_STATIC_IN} ${SPHINX_STATIC_OUT}

View File

@@ -843,16 +843,6 @@ INPUT = "@MARKDOWN_INPUT@" \
"@OpenVINO_SOURCE_DIR@/src/common/transformations/include/" \
"@OpenVINO_SOURCE_DIR@/src/common/util/include/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/descriptor" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/op/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/op/util" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/opsets/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pass/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pattern/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pattern/op/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/runtime/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/type/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/core/" \
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/core/descriptor/" \
@@ -917,7 +907,9 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
EXCLUDE = "@OpenVINO_SOURCE_DIR@/thirdparty" \
"@OpenVINO_SOURCE_DIR@/temp" \
"@OpenVINO_SOURCE_DIR@/bin"
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -936,7 +928,6 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */temp/* \
*/bin/* \
*/tests/* \
*/openvx/* \
*/thirdparty/* \
"@DOXYREST_OUT@" \
"@XML_OUTPUT@" \
@@ -1045,7 +1036,6 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \
EXAMPLE_PATH = "@OpenVINO_SOURCE_DIR@" \
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/" \
"@OpenVINO_SOURCE_DIR@/docs/" \
"@OpenVINO_SOURCE_DIR@/docs/onnx_custom_op/" \
"@OpenVINO_SOURCE_DIR@/docs/template_extension/" \
"@OpenVINO_SOURCE_DIR@/docs/template_extension/old/" \
"@OpenVINO_SOURCE_DIR@/docs/template_extension/new/" \

View File

@@ -0,0 +1,115 @@
# OpenVINO Extensibility Mechanism {#openvino_docs_Extensibility_UG_Intro}
@sphinxdirective
.. toctree::
:maxdepth: 1
:hidden:
openvino_docs_Extensibility_UG_add_openvino_ops
@endsphinxdirective
The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with multiple frameworks including
TensorFlow, Caffe, MXNet, Kaldi, PaddlePaddle, and ONNX. The list of supported operations (layers) is different for
each of the supported frameworks. To see the operations supported by your framework, refer to
[Supported Framework Operations](../MO_DG/prepare_model/Supported_Frameworks_Layers.md).
Custom operations, that is those not included in the list, are not recognized by OpenVINO™ out-of-the-box. Therefore, creating Intermediate Representation (IR) for a model using them requires additional steps. This guide illustrates the workflow for running inference on topologies featuring custom operations, allowing you to plug in your own implementation for existing or completely new operations.
If your model contains operations not normally supported by OpenVINO™, the OpenVINO™ Extensibility API lets you add support for those custom operations and use one implementation for Model Optimizer and OpenVINO™ Runtime.
There are two steps to support inference of a model with custom operation(s):
1. Add support for a [custom operation in the Model Optimizer](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) so
the Model Optimizer can generate the IR with the operation.
2. Create a custom operation in it as described in the [Custom Operation](add_openvino_ops.md).
## OpenVINO™ Extensions
An OpenVINO™ provides extensions for:
* [Custom OpenVINO™ Operation](add_openvino_ops.md):
- Enables the creation of unsupported operations
- Enables the use of `ov::Core::read_model` to read models with unsupported operations
- Provides a shape inference mechanism for custom operations
- Provides an evaluate method which allow to support the operation on CPU or perform constant folding
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details. You can review the complete code, which is fully compilable and up-to-date, to see how it works.
## Load extensions to OpenVINO™ Runtime
To load the extensions to the `ov::Core` object, use the `ov::Core::add_extension` method, this method allows to load library with extensions or extensions from the code.
### Load extensions to core
Extensions can be loaded from code with `ov::Core::add_extension` method:
@sphinxdirective
.. tab:: C++
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: add_extension
.. tab:: Python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: add_extension
@endsphinxdirective
### Create library with extensions
You need to create extension library in following cases:
- Load extensions to Model Optimizer
- Load extensions to Python application
If you want to create an extension library, for example in order to load these extensions to the Model Optimizer, you need to do next steps:
Create an entry point for extension library. OpenVINO™ provides an `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 can look as follows:
@snippet template_extension/new/ov_extension.cpp ov_extension:entry_point
To configure the build of your extension library, use the following CMake script:
@snippet template_extension/new/CMakeLists.txt cmake:extension
This CMake script finds the OpenVINO™ using the `find_package` CMake command.
To build the extension library, run the commands below:
```sh
$ cd docs/template_extension/new
$ mkdir build
$ cd build
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
$ cmake --build .
```
After the build you can use path to your extension library to load your extensions to OpenVINO™ Runtime:
@sphinxdirective
.. tab:: C++
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: add_extension_lib
.. tab:: Python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: add_extension_lib
@endsphinxdirective
## See Also
* [OpenVINO Transformations](./ov_transformations.md)
* [Using Inference Engine Samples](../OV_Runtime_UG/Samples_Overview.md)
* [Hello Shape Infer SSD sample](../../samples/cpp/hello_reshape_ssd/README.md)

View File

@@ -0,0 +1,62 @@
# Custom OpenVINO™ Operations {#openvino_docs_Extensibility_UG_add_openvino_ops}
OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box.
## Operation Class
To add your custom operation, create a new class that extends `ov::Op`, which is in turn derived from `ov::Node`, the base class for all graph operations in OpenVINO™. To add `ov::Op` please include next file:
@snippet template_extension/new/identity.hpp op:common_include
Follow the steps below to add a custom operation:
1. Add the `OPENVINO_OP` macro which defines a `NodeTypeInfo` object that identifies the type of the operation to the graph users and helps with dynamic type resolution. The type info of an operation currently consists of a string operation identifier and a string for operation version.
2. Implement default constructor and constructors that optionally take the operation inputs and attributes as parameters.
3. Override the shape inference method `validate_and_infer_types`. This method is called multiple times during graph manipulations to determine the shapes and element types of the operations outputs. To access the input shapes and input element types, use the `get_input_partial_shape()` and `get_input_element_type()` methods of `ov::Node`. Set the inferred shape and element type of the output using `set_output_type`.
4. Override the `clone_with_new_inputs` method, which enables graph manipulation routines to create copies of this operation and connect it to different nodes during optimization.
5. Override the `visit_attributes` method, which enables serialization and deserialization of operation attributes. An `AttributeVisitor` is passed to the method, and the implementation is expected to walk over all the attributes in the op using the type-aware `on_attribute` helper. Helpers are already implemented for standard C++ types like `int64_t`, `float`, `bool`, `vector`, and for existing OpenVINO defined types.
6. Override `evaluate`, which is an optional method that enables fallback of some devices to this implementation and the application of constant folding if there is a custom operation on the constant branch. If your operation contains `evaluate` method you also need to override the `has_evaluate` method, this method allow to get information about availability of `evaluate` method for the operation.
7. Add the `OPENVINO_FRAMEWORK_MAP` macro if you want to map custom operation to framework operation with the same name. It is an optional macro which can be used for one to one mapping. In order to use this macro please include frontend specific headers:
@snippet template_extension/new/identity.hpp op:frontend_include
Based on that, declaration of an operation class can look as follows:
@snippet template_extension/new/identity.hpp op:header
### Operation Constructors
OpenVINO™ operation contains two constructors:
* Default constructor, which enables you to create an operation without attributes
* Constructor that creates and validates an operation with specified inputs and attributes
@snippet template_extension/new/identity.cpp op:ctor
### `validate_and_infer_types()`
`ov::Node::validate_and_infer_types` method validates operation attributes and calculates output shapes using attributes of the operation.
@snippet template_extension/new/identity.cpp op:validate
### `clone_with_new_inputs()`
`ov::Node::clone_with_new_inputs` method creates a copy of the operation with new inputs.
@snippet template_extension/new/identity.cpp op:copy
### `visit_attributes()`
`ov::Node::visit_attributes` method enables you to visit all operation attributes.
@snippet template_extension/new/identity.cpp op:visit_attributes
### `evaluate()` and `has_evaluate()`
`ov::Node::evaluate` method enables you to apply constant folding to an operation.
@snippet template_extension/new/identity.cpp op:evaluate

View File

@@ -0,0 +1,28 @@
# OpenVINO Graph Rewrite Pass {#openvino_docs_Extensibility_UG_graph_rewrite_pass}
`ov::pass::GraphRewrite` serves for running multiple matcher passes on `ov::Model` in a single graph traversal.
Example:
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:graph_rewrite
In addition, GraphRewrite handles nodes that were registered by MatcherPasses during their execution. This nodes will be added to the beginning of the sequence with nodes for pattern matching.
> **NOTE**: when using `ov::pass::Manager` temporary GraphRewrite is used to execute single MatcherPass.
GraphRewrite has two algorithms for MatcherPasses execution. First algorithm is straightforward. It applies each MatcherPass in registration order to current node.
![graph_rewrite_execution]
But it is not really efficient when you have a lot of registered passes. So first of all GraphRewrite checks that all MatcherPass patterns has type-based root node (it means that type of this node is not hidden into predicate).
And then creates map from registered MatcherPasses. That helps to avoid additional cost of applying each MatcherPass for each node.
![graph_rewrite_efficient_search]
> **NOTE**: GraphRewrite execution algorithm cannot be set manually and depends only on root nodes registered inside MatcherPasses.
## See Also
* [OpenVINO™ Transformations](./ov_transformations.md)
[graph_rewrite_execution]: ./img/graph_rewrite_execution.png
[graph_rewrite_efficient_search]: ./img/graph_rewrite_efficient_search.png

View File

@@ -0,0 +1,101 @@
# OpenVINO Matcher Pass {#openvino_docs_Extensibility_UG_matcher_pass}
`ov::pass::MatcherPass` is used for pattern-based transformations.
Template for MatcherPass transformation class
@snippet src/transformations/template_pattern_transformation.hpp graph_rewrite:template_transformation_hpp
@snippet src/transformations/template_pattern_transformation.cpp graph_rewrite:template_transformation_cpp
To use `ov::pass::MatcherPass`, you need to complete these steps:
1. Create a pattern
2. Implement a callback
3. Register the pattern and Matcher
4. Execute MatcherPass
So let's go through each of these steps.
## Create a pattern
Pattern is a single root `ov::Model`. But the only difference is that you do not need to create a model object, you just need to create and connect opset or special pattern operations.
Then you need to take the last created operation and put it as a root of the pattern. This root node will be used as a root node in pattern matching.
> **NOTE**: Any nodes in a pattern that have no consumers and are not registered as root will not be used in pattern matching.
@snippet ov_model_snippets.cpp pattern:simple_example
The `Parameter` operation in the example above has type and shape specified. These attributes are needed only to create Parameter operation class and will not be used in pattern matching.
For more pattern examples, refer to the [pattern matching](#pattern_matching) section.
## Implement callback
Callback is an action applied to every pattern entrance. In general, callback is the lambda function that takes Matcher object with detected subgraph.
@snippet ov_model_snippets.cpp pattern:callback_example
The example above shows the callback structure and how Matcher can be used for accessing nodes detected by pattern.
Callback return value is `true` if root node was replaced and another pattern cannot be applied to the same root node; otherwise, it is `false`.
> **NOTE**: It is not recommended to manipulate with nodes that are under root node. This may affect GraphRewrite execution as it is expected that all nodes that come after root node in topological order are valid and can be used in pattern matching.
MatcherPass also provides functionality that allows reporting of the newly created nodes that can be used in additional pattern matching.
If MatcherPass was registered in `ov::pass::Manager` or `ov::pass::GraphRewrite`, these registered nodes will be added for additional pattern matching.
That means that matcher passes registered in `ov::pass::GraphRewrite` will be applied to these nodes.
The example below shows how single MatcherPass can fuse sequence of operations using the `register_new_node` method.
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:relu_fusion
> **NOTE**: If you register multiple nodes, please add them in topological order. We do not topologically sort these nodes as it is a time-consuming operation.
## Register pattern and Matcher
The last step is to register Matcher and callback inside the MatcherPass pass. To do this, call the `register_matcher` method.
> **NOTE**: Only one matcher can be registered for a single MatcherPass class.
```cpp
// Register matcher and callback
register_matcher(m, callback);
```
## Execute MatcherPass
MatcherPass has multiple ways to be executed:
* Run on a single node - it can be useful if you want to run MatcherPass inside another transformation.
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:run_on_node
* Run on `ov::Model` using GraphRewrite - this approach gives ability to run MatcherPass on whole `ov::Model`. Moreover, multiple MatcherPass transformation can be registered in a single GraphRewite to be executed in a single graph traversal.
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:graph_rewrite
* Run on `ov::Model` using `ov::pass::Manager` - this approach helps you to register MatcherPass for execution on `ov::Model` as another transformation types.
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager
## Pattern Matching <a name="pattern_matching"></a>
Sometimes patterns cannot be expressed via regular operations or it is too complicated.
For example, if you want to detect **Convolution->Add** sub-graph without specifying particular input type for Convolution operation or you want to create a pattern where some of operations can have different types.
And for these cases OpenVINO™ provides additional helpers to construct patterns for GraphRewrite transformations.
There are two main helpers:
1. `ov::pass::pattern::any_input` - helps to express inputs if their types are undefined.
2. `ov::pass::pattern::wrap_type<T>` - helps to express nodes of pattern without specifying node attributes.
Let's go through the example to have better understanding of how it works:
> **NOTE**: Node attributes do not participate in pattern matching and are needed only for operations creation. Only operation types participate in pattern matching.
The example below shows basic usage of `ov::passpattern::any_input`.
Here we construct Multiply pattern with arbitrary first input and Constant as a second input.
Also as Multiply is commutative operation, it does not matter in which order we set inputs (any_input/Constant or Constant/any_input) because both cases will be matched.
@snippet ov_model_snippets.cpp pattern:label_example
This example shows how we can construct a pattern when operation has arbitrary number of inputs.
@snippet ov_model_snippets.cpp pattern:concat_example
This example shows how to use predicate to construct a pattern. Also it shows how to match pattern manually on given node.
@snippet ov_model_snippets.cpp pattern:predicate_example
> **NOTE**: Be careful with manual matching because Matcher object holds matched nodes. To clear a match, use the m->clear_state() method.
## See Also
* [OpenVINO™ Transformations](./ov_transformations.md)

View File

@@ -0,0 +1,17 @@
# OpenVINO Model Pass {#openvino_docs_Extensibility_UG_model_pass}
`ov::pass::ModelPass` is used for transformations that take entire `ov::Model` as an input and process it.
Template for ModelPass transformation class
@snippet src/transformations/template_model_transformation.hpp model_pass:template_transformation_hpp
@snippet src/transformations/template_model_transformation.cpp model_pass:template_transformation_cpp
Using `ov::pass::ModelPass`, you need to override the `run_on_model` method where you will write the transformation code.
Return value is `true` if the original model has changed during transformation (new operation was added, or operations replacement was made, or node attributes were changed); otherwise, it is `false`.
Also `ov::pass::ModelPass` based transformations can be executed via `ov::pass::Manager`.
## See Also
* [OpenVINO™ Transformations](./ov_transformations.md)

View File

@@ -0,0 +1,172 @@
# Overview of Transformations API {#openvino_docs_transformations}
@sphinxdirective
.. toctree::
:maxdepth: 1
:hidden:
openvino_docs_Extensibility_UG_model_pass
openvino_docs_Extensibility_UG_matcher_pass
openvino_docs_Extensibility_UG_graph_rewrite_pass
@endsphinxdirective
This guide contains all necessary information that you need to start implementing OpenVINO™ transformations.
## Working with Model
Before the moving to transformation part it is needed to say several words about functions which allow to modify `ov::Model`.
This chapter extends the [model representation guide](../OV_Runtime_UG/model_representation.md) and shows an API that allows us to manipulate with `ov::Model`.
### Working with node input and output ports
First of all let's talk about `ov::Node` input/output ports. Each OpenVINO™ operation has input and output ports except cases when operation has `Parameter` or `Constant` type.
Every port belongs to its node, so using a port we can access parent node, get shape and type for particular input/output, get all consumers in case of output port, and get producer node in case of input port.
With output port we can set inputs for newly created operations.
Lets look at the code example.
@snippet ov_model_snippets.cpp ov:ports_example
### Node replacement
OpenVINO™ provides two ways for node replacement: via OpenVINO™ helper function and directly via port methods. We are going to review both of them.
Let's start with OpenVINO™ helper functions. The most popular function is `ov::replace_node(old_node, new_node)`.
We will review real replacement case where Negative operation is replaced with Multiply.
![ngraph_replace_node]
@snippet ov_model_snippets.cpp ov:replace_node
`ov::replace_node` has a constraint that number of output ports for both of ops must be the same; otherwise, it raises an exception.
The alternative way to do the same replacement is the following:
@snippet ov_model_snippets.cpp ov:manual_replace
Another transformation example is insertion.
![ngraph_insert_node]
@snippet ov_model_snippets.cpp ov:insert_node
The alternative way to the insert operation is to make a node copy and use `ov::replace_node()`:
@snippet ov_model_snippets.cpp ov:insert_node_with_copy
### Node elimination
Another type of node replacement is its elimination.
To eliminate operation, OpenVINO™ has special method that considers all limitations related to OpenVINO™ Runtime.
@snippet ov_model_snippets.cpp ov:eliminate_node
`ov::replace_output_update_name()` in case of successful replacement it automatically preserves friendly name and runtime info.
## Transformations types <a name="transformations_types"></a>
OpenVINO™ Runtime has three main transformation types:
* [Model pass](./model_pass.md) - straightforward way to work with `ov::Model` directly
* [Matcher pass](./matcher_pass.md) - pattern-based transformation approach
* [Graph rewrite pass](./graph_rewrite_pass.md) - container for matcher passes needed for efficient execution
![transformations_structure]
## Transformation conditional compilation
Transformation library has two internal macros to support conditional compilation feature.
* `MATCHER_SCOPE(region)` - allows to disable the MatcherPass if matcher isn't used. The region name should be unique. This macro creates a local variable `matcher_name` which you should use as a matcher name.
* `RUN_ON_MODEL_SCOPE(region)` - allows to disable run_on_model pass if it isn't used. The region name should be unique.
## Transformation writing essentials <a name="transformation_writing_essentials"></a>
When developing a transformation, you need to follow these transformation rules:
###1. Friendly Names
Each `ov::Node` has an unique name and a friendly name. In transformations we care only about friendly name because it represents the name from the model.
To avoid losing friendly name when replacing node with other node or subgraph, set the original friendly name to the latest node in replacing subgraph. See the example below.
@snippet ov_model_snippets.cpp ov:replace_friendly_name
In more advanced cases, when replaced operation has several outputs and we add additional consumers to its outputs, we make a decision how to set friendly name by arrangement.
###2. Runtime Info
Runtime info is a map `std::map<std::string, ov::Any>` located inside `ov::Node` class. It represents additional attributes in `ov::Node`.
These attributes can be set by users or by plugins and when executing transformation that changes `ov::Model` we need to preserve these attributes as they will not be automatically propagated.
In most cases, transformations have the following types: 1:1 (replace node with another node), 1:N (replace node with a sub-graph), N:1 (fuse sub-graph into a single node), N:M (any other transformation).
Currently, there is no mechanism that automatically detects transformation types, so we need to propagate this runtime information manually. See the examples below.
@snippet ov_model_snippets.cpp ov:copy_runtime_info
When transformation has multiple fusions or decompositions, `ov::copy_runtime_info` must be called multiple times for each case.
**Note**: copy_runtime_info removes rt_info from destination nodes. If you want to keep it, you need to specify them in source nodes like this: copy_runtime_info({a, b, c}, {a, b})
###3. Constant Folding
If your transformation inserts constant sub-graphs that need to be folded, do not forget to use `ov::pass::ConstantFolding()` after your transformation or call constant folding directly for operation.
The example below shows how constant subgraph can be constructed.
@snippet ov_model_snippets.cpp ov:constant_subgraph
Manual constant folding is more preferable than `ov::pass::ConstantFolding()` because it is much faster.
Below you can find an example of manual constant folding:
@snippet src/transformations/template_pattern_transformation.cpp manual_constant_folding
## Common mistakes in transformations <a name="common_mistakes"></a>
In transformation development process:
* Do not use deprecated OpenVINO™ API. Deprecated methods has the `OPENVINO_DEPRECATED` macros in its definition.
* Do not pass `shared_ptr<Node>` as an input for other node if type of node is unknown or it has multiple outputs. Use explicit output port.
* If you replace node with another node that produces different shape, remember that new shape will not be propagated until the first `validate_nodes_and_infer_types` call for `ov::Model`. If you are using `ov::pass::Manager`, it will automatically call this method after each transformation execution.
* Do not forget to call the `ov::pass::ConstantFolding` pass if your transformation creates constant subgraphs.
* Use latest OpSet if you are not developing downgrade transformation pass.
* When developing a callback for `ov::pass::MatcherPass`, do not change nodes that come after the root node in topological order.
## Using pass manager <a name="using_pass_manager"></a>
`ov::pass::Manager` is a container class that can store the list of transformations and execute them. The main idea of this class is to have high-level representation for grouped list of transformations.
It can register and apply any [transformation pass](#transformations_types) on model.
In addition, `ov::pass::Manager` has extended debug capabilities (find more information in the [how to debug transformations](#how_to_debug_transformations) section).
The example below shows basic usage of `ov::pass::Manager`
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager3
Another example shows how multiple matcher passes can be united into single GraphRewrite.
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager2
## How to debug transformations <a name="how_to_debug_transformations"></a>
If you are using `ngraph::pass::Manager` to run sequence of transformations, you can get additional debug capabilities by using the following environment variables:
```
OV_PROFILE_PASS_ENABLE=1 - enables performance measurement for each transformation and prints execution status
OV_ENABLE_VISUALIZE_TRACING=1 - enables visualization after each transformation. By default, it saves dot and svg files.
```
> **Note**: Make sure that you have dot installed on your machine; otherwise, it will silently save only dot file without svg file.
## See Also
* [OpenVINO™ Model Representation](../OV_Runtime_UG/model_representation.md)
* [OpenVINO™ Extensions](./Intro.md)
[ngraph_replace_node]: ./img/ngraph_replace_node.png
[ngraph_insert_node]: ./img/ngraph_insert_node.png
[transformations_structure]: ./img/transformations_structure.png
[register_new_node]: ./img/register_new_node.png

View File

@@ -1,349 +0,0 @@
# Custom Operations Guide {#openvino_docs_HOWTO_Custom_Layers_Guide}
The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with multiple frameworks including
TensorFlow*, Caffe*, MXNet*, Kaldi* and ONNX* file format. The list of supported operations (layers) is different for
each of the supported frameworks. To see the operations supported by your framework, refer to
[Supported Framework Layers](../MO_DG/prepare_model/Supported_Frameworks_Layers.md).
Custom operations, that is those not included in the list, are not recognized by Model Optimizer out-of-the-box. Therefore, creating Intermediate Representation (IR) for a model using them requires additional steps. This guide illustrates the workflow for running inference on topologies featuring custom operations, allowing you to plug in your own implementation for existing or completely new operations.
> **NOTE**: *Layer* is a legacy term for *operation* which came from Caffe\* framework. Currently it is not used.
> Refer to the [Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™](../MO_DG/IR_and_opsets.md)
> for more information on the topic.
## Terms Used in This Guide
- *Intermediate Representation (IR)* — OpenVINO's Neural Network format used by Inference Engine. It abstracts different frameworks and describs model topology, operations parameters, and weights.
- *Operation* — an abstract concept of a math function selected for a specific purpose. Operations supported by
OpenVINO™ are listed in the supported operation set provided in the [Available Operations Sets](../ops/opset.md).
Examples of the operations are: [ReLU](../ops/activation/ReLU_1.md), [Convolution](../ops/convolution/Convolution_1.md),
[Add](../ops/arithmetic/Add_1.md), etc.
- *Kernel* — The implementation of an operation function in the OpenVINO™ plugin, in this case, the math programmed (in
C++ and OpenCL) to perform the operation for a target hardware (CPU or GPU).
- *Inference Engine Extension* — Device-specific module implementing custom operations (a set of kernels).
## Custom Operation Support Overview
There are three steps to support inference of a model with custom operation(s):
1. Add support for a custom operation in the [Model Optimizer](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md) so
the Model Optimizer can generate the IR with the operation.
2. Create an operation set and implement a custom nGraph operation in it as described in the
[Custom nGraph Operation](../IE_DG/Extensibility_DG/AddingNGraphOps.md).
3. Implement a customer operation in one of the [Inference Engine](../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md)
plugins to support inference of this operation using a particular target hardware (CPU, GPU or VPU).
To see the operations that are supported by each device plugin for the Inference Engine, refer to the
[Supported Devices](../IE_DG/supported_plugins/Supported_Devices.md).
> **NOTE**: If a device doesn't support a particular operation, an alternative to creating a new operation is to target
> an additional device using the HETERO plugin. The [Heterogeneous Plugin](../IE_DG/supported_plugins/HETERO.md) may be
> used to run an inference model on multiple devices allowing the unsupported operations on one device to "fallback" to
> run on another device (e.g., CPU) that does support those operations.
### Custom Operation Support for the Model Optimizer
Model Optimizer model conversion pipeline is described in detail in "Model Conversion Pipeline" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md). It is best to read that article first for a better understanding of the following material.
Model Optimizer provides an extensions mechanism to support new operations and implement custom model transformations to generate optimized IR. This mechanism is described in the "Model Optimizer Extensions" section of
[Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md).
Two types of Model Optimizer extensions should be implemented to support custom operations, at a minimum:
1. Operation class for a new operation. This class stores information about the operation, its attributes, shape inference function, attributes to be saved to an IR and some others internally used attributes. Refer to the "Model Optimizer Operation" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement it.
2. Operation attributes extractor. The extractor is responsible for parsing framework-specific representation of the
operation and uses corresponding operation class to update graph node attributes with necessary attributes of the
operation. Refer to the "Operation Extractor" section of
[Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement it.
> **NOTE**: In some cases you may need to implement some transformation to support the operation. This topic is covered in the "Graph Transformation Extensions" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md).
## Custom Operations Extensions for the Inference Engine
Inference Engine provides an extension mechanism to support new operations. This mechanism is described in [Inference Engine Extensibility Mechanism](../IE_DG/Extensibility_DG/Intro.md).
Each device plugin includes a library of optimized implementations to execute known operations which must be extended to execute a custom operation. The custom operation extension is implemented according to the target device:
- Custom Operation CPU Extension
- A compiled shared library (`.so` or `.dll`) needed by the CPU Plugin for executing the custom operation
on a CPU. Refer to the [How to Implement Custom CPU Operations](../IE_DG/Extensibility_DG/CPU_Kernel.md) for more
details.
- Custom Operation GPU Extension
- OpenCL source code (.cl) for the custom operation kernel that will be compiled to execute on the GPU along with an operation description file (.xml) needed by the GPU Plugin for the custom operation kernel. Refer to the [How to Implement Custom GPU Operations](../IE_DG/Extensibility_DG/GPU_Kernel.md) for more details.
- Custom Operation VPU Extension
- OpenCL source code (.cl) for the custom operation kernel that will be compiled to execute on the VPU along with an operation description file (.xml) needed by the VPU Plugin for the custom operation kernel. Refer to [How to Implement Custom Operations for VPU](../IE_DG/Extensibility_DG/VPU_Kernel.md) for more details.
Also, it is necessary to implement nGraph custom operation according to [Custom nGraph Operation](../IE_DG/Extensibility_DG/AddingNGraphOps.md) so the Inference Engine can read an IR with this
operation and correctly infer output tensor shape and type.
## Enabling Magnetic Resonance Image Reconstruction Model
This chapter provides step-by-step instructions on how to enable the magnetic resonance image reconstruction model implemented in the [repository](https://github.com/rmsouza01/Hybrid-CS-Model-MRI/) using a custom operation on CPU. The example is prepared for a model generated from the repository with hash `2ede2f96161ce70dcdc922371fe6b6b254aafcc8`.
### Download and Convert the Model to a Frozen TensorFlow\* Model Format
The original pre-trained model is provided in the hdf5 format which is not supported by OpenVINO directly and needs to be converted to TensorFlow\* frozen model format first.
1. Download repository `https://github.com/rmsouza01/Hybrid-CS-Model-MRI`:<br>
```bash
git clone https://github.com/rmsouza01/Hybrid-CS-Model-MRI
git checkout 2ede2f96161ce70dcdc922371fe6b6b254aafcc8
```
2. Convert pre-trained `.hdf5` to a frozen `.pb` graph using the following script (tested with TensorFlow==1.15.0 and
Keras==2.2.4) which should be executed from the root of the cloned repository:<br>
```py
import keras as K
import numpy as np
import Modules.frequency_spatial_network as fsnet
import tensorflow as tf
under_rate = '20'
stats = np.load("Data/stats_fs_unet_norm_" + under_rate + ".npy")
var_sampling_mask = np.load("Data/sampling_mask_" + under_rate + "perc.npy")
model = fsnet.wnet(stats[0], stats[1], stats[2], stats[3], kshape = (5,5), kshape2=(3,3))
model_name = "Models/wnet_" + under_rate + ".hdf5"
model.load_weights(model_name)
inp = np.random.standard_normal([1, 256, 256, 2]).astype(np.float32)
np.save('inp', inp)
sess = K.backend.get_session()
sess.as_default()
graph_def = sess.graph.as_graph_def()
graph_def = tf.graph_util.convert_variables_to_constants(sess, graph_def, ['conv2d_44/BiasAdd'])
with tf.gfile.FastGFile('wnet_20.pb', 'wb') as f:
f.write(graph_def.SerializeToString())
```
As a result the TensorFlow\* frozen model file "wnet_20.pb" is generated.
### Convert the Frozen TensorFlow\* Model to Intermediate Representation
Firstly, open the model in TensorBoard or other TensorFlow* model visualization tool. The model supports dynamic
batch dimension because the value for the batch dimension is not hardcoded in the model. Model Optimizer need to set all
dynamic dimensions to some specific value to create the IR, therefore specify the command line parameter `-b 1` to set
the batch dimension equal to 1. The actual batch size dimension can be changed at runtime using the Inference Engine API
described in the [Using Shape Inference](../IE_DG/ShapeInference.md). Also refer to the General Conversion Parameters section in [Converting a Model to Intermediate Representation (IR)](../MO_DG/prepare_model/convert_model/Converting_Model.md) and [Convert Your TensorFlow* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md)
for more details and command line parameters used for the model conversion.
```sh
mo --input_model <PATH_TO_MODEL>/wnet_20.pb -b 1
```
> **NOTE**: This conversion guide is applicable for the 2021.3 release of OpenVINO and that starting from 2021.4
> the OpenVINO supports this model out of the box.
Model Optimizer produces the following error:
```bash
[ ERROR ] List of operations that cannot be converted to Inference Engine IR:
[ ERROR ] Complex (1)
[ ERROR ] lambda_2/Complex
[ ERROR ] IFFT2D (1)
[ ERROR ] lambda_2/IFFT2D
[ ERROR ] ComplexAbs (1)
[ ERROR ] lambda_2/Abs
[ ERROR ] Part of the nodes was not converted to IR. Stopped.
```
The error means that the Model Optimizer doesn't know how to handle 3 types of TensorFlow\* operations: "Complex",
"IFFT2D" and "ComplexAbs". In order to see more details about the conversion process run the model conversion with
additional parameter `--log_level DEBUG`. It is worth to mention the following lines from the detailed output:
```bash
[ INFO ] Called "tf_native_tf_node_infer" for node "lambda_2/Complex"
[ <TIMESTAMP> ] [ DEBUG ] [ tf:228 ] Added placeholder with name 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:228 ] Added placeholder with name 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:241 ] update_input_in_pbs: replace input 'lambda_2/lambda_3/strided_slice' with input 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:249 ] Replacing input '0' of the node 'lambda_2/Complex' with placeholder 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:241 ] update_input_in_pbs: replace input 'lambda_2/lambda_4/strided_slice' with input 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:249 ] Replacing input '1' of the node 'lambda_2/Complex' with placeholder 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
[ <TIMESTAMP> ] [ DEBUG ] [ tf:148 ] Inferred shape of the output tensor with index '0' of the node 'lambda_2/Complex': '[ 1 256 256]'
[ <TIMESTAMP> ] [ DEBUG ] [ infer:145 ] Outputs:
[ <TIMESTAMP> ] [ DEBUG ] [ infer:32 ] output[0]: shape = [ 1 256 256], value = <UNKNOWN>
[ <TIMESTAMP> ] [ DEBUG ] [ infer:129 ] --------------------
[ <TIMESTAMP> ] [ DEBUG ] [ infer:130 ] Partial infer for lambda_2/IFFT2D
[ <TIMESTAMP> ] [ DEBUG ] [ infer:131 ] Op: IFFT2D
[ <TIMESTAMP> ] [ DEBUG ] [ infer:132 ] Inputs:
[ <TIMESTAMP> ] [ DEBUG ] [ infer:32 ] input[0]: shape = [ 1 256 256], value = <UNKNOWN>
```
This is a part of the log of the partial inference phase of the model conversion. See the "Partial Inference" section on
the [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for
more information about this phase. Model Optimizer inferred output shape for the unknown operation of type "Complex"
using a "fallback" to TensorFlow\*. However, it is not enough to generate the IR because Model Optimizer doesn't know
which attributes of the operation should be saved to IR. So it is necessary to implement Model Optimizer extensions to
support these operations.
Before going into the extension development it is necessary to understand what these unsupported operations do according
to the TensorFlow\* framework specification.
* "Complex" - returns a tensor of complex type constructed from two real input tensors specifying real and imaginary
part of a complex number.
* "IFFT2D" - returns a tensor with inverse 2-dimensional discrete Fourier transform over the inner-most 2 dimensions of
an input.
* "ComplexAbs" - returns a tensor with absolute values of input tensor with complex numbers.
The part of the model with all three unsupported operations is depicted below:
![Unsupported sub-graph](img/unsupported_subgraph.png)
This model uses complex numbers during the inference but Inference Engine does not support tensors of this data type. So
it is necessary to find a way how to avoid using tensors of such a type in the model. Fortunately, the complex tensor
appear as a result of "Complex" operation, is used as input in the "IFFT2D" operation then is passed to "ComplexAbs"
which produces real value tensor as output. So there are just 3 operations consuming/producing complex tensors in the
model.
Let's design an OpenVINO operation "FFT" which get a single real number tensor describing the complex number and
produces a single real number tensor describing output complex tensor. This way the fact that the model uses complex
numbers is hidden inside the "FFT" operation implementation. The operation gets a tensor of shape `[N, H, W, 2]` and
produces the output tensor with the same shape, where the innermost dimension contains pairs of real numbers describing
the complex number (its real and imaginary part). As we will see further this operation will allow us to support the
model. The implementation of the Model Optimizer operation should be saved to `mo_extensions/ops/FFT.py` file:
@snippet FFT.py fft:operation
The attribute `inverse` is a flag specifying type of the FFT to apply: forward or inverse.
See the "Model Optimizer Operation" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement the operation.
Now it is necessary to implement extractor for the "IFFT2D" operation according to the
"Operation Extractor" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md). The
following snippet provides two extractors: one for "IFFT2D", another one for "FFT2D", however only on of them is used in this example. The implementation should be saved to the file `mo_extensions/front/tf/FFT_ext.py`.
@snippet FFT_ext.py fft_ext:extractor
> **NOTE**: The graph is in inconsistent state after extracting node attributes because according to original operation
> "IFFT2D" semantic it should have an input consuming a tensor of complex numbers, but the extractor instantiated an
> operation "FFT" which expects a real tensor with specific layout. But the inconsistency will be resolved during
> applying front phase transformations discussed below.
The output shape of the operation "AddV2" from the picture above is `[N, H, W, 2]`. Where the innermost dimension
contains pairs of real numbers describing the complex number (its real and imaginary part). The following "StridedSlice"
operations split the input tensor into 2 parts to get a tensor of real and a tensor of imaginary parts which are then
consumed with the "Complex" operation to produce a tensor of complex numbers. These "StridedSlice" and "Complex"
operations can be removed so the "FFT" operation will get a real value tensor encoding complex numbers. To achieve this
we implement the front phase transformation which searches for a pattern of two "StridedSlice" operations with specific
attributes producing data to "Complex" operation and removes it from the graph. Refer to the
"Pattern-Defined Front Phase Transformations" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for more
information on how this type of transformation works. The code snippet should be saved to the file
`mo_extensions/front/tf/Complex.py`.
@snippet Complex.py complex:transformation
> **NOTE**: The graph is in inconsistent state because the "ComplexAbs" operation consumes complex value tensor but
> "FFT" produces real value tensor.
Now lets implement a transformation which replace a "ComplexAbs" operation with a sub-graph of primitive operations
which calculate the result using the following formulae: \f$module(z) = \sqrt{real(z) \cdot real(z) + imag(z) \cdot imag(z)}\f$.
Original "IFFT2D" operation produces tensor of complex values, but the "FFT" operation produces a real value tensor with
the same format and shape as the input for the operation. So the input shape for the "ComplexAbs" will be `[N, H, W, 2]`
with the innermost dimension containing tuple with real and imaginary part of a complex number. In order to calculate
absolute values for the complex tensor we do the following:
1. Raise all elements in the power of 2.
2. Calculate a reduced sum over the innermost dimension.
3. Calculate a square root.
The implementation should be saved to the file `mo_extensions/front/tf/ComplexAbs.py` and provided below:
@snippet ComplexAbs.py complex_abs:transformation
Now it is possible to convert the model using the following command line:
```sh
mo --input_model <PATH_TO_MODEL>/wnet_20.pb -b 1 --extensions mo_extensions/
```
The sub-graph corresponding to the originally non-supported one is depicted in the image below:
![Converted sub-graph](img/converted_subgraph.png)
> **NOTE**: Model Optimizer performed conversion of the model from NHWC to NCHW layout that is why the dimension with
> the value 2 moved to another position.
### Inference Engine Extension Implementation
Now it is necessary to implement the extension for the CPU plugin with operation "FFT" introduced previously. The code
below is based on the template extension described in [Inference Engine Extensibility Mechanism](../IE_DG/Extensibility_DG/Intro.md).
#### CMake Build File
The first step is to create a CMake configuration file which builds the extension. The content of the "CMakeLists.txt"
file is the following:
@snippet template_extension/old/CMakeLists.txt cmake:extension
The CPU FFT kernel implementation uses OpenCV to perform the FFT that is why the extension library is linked with
`opencv_core` which comes with the OpenVINO.
#### Custom nGraph Operation "FFT" Implementation
The next step is to create the nGraph operation FFT. The header file "fft_op.hpp" has the following content:
@snippet template_extension/old/fft_op.hpp fft_op:header
The operation has just one boolean attribute `inverse`. Implementation of the necessary nGraph operation functions are
in the `fft_op.cpp` file with the following content:
@snippet template_extension/old/fft_op.cpp fft_op:implementation
Refer to the [Custom nGraph Operation](../IE_DG/Extensibility_DG/AddingNGraphOps.md) for more details.
#### CPU FFT Kernel Implementation
The operation implementation for CPU plugin uses OpenCV to perform the FFT. The header file "fft_kernel.hpp" has the
following content:
@snippet template_extension/old/fft_kernel.hpp fft_kernel:header
The "fft_kernel.cpp" with the implementation of the CPU has the following content:
@snippet template_extension/old/fft_kernel.cpp fft_kernel:implementation
Refer to the [How to Implement Custom CPU Operations](../IE_DG/Extensibility_DG/CPU_Kernel.md) for more details.
#### Extension Library Implementation
The last step is to create an extension library "extension.cpp" and "extension.hpp" which will include the FFT
operation for the CPU plugin. The code of the library is described in the [Extension Library](../IE_DG/Extensibility_DG/Extension.md).
### Building and Running the Custom Extension
To build the extension, run the following:<br>
```bash
mkdir build && cd build
source /opt/intel/openvino_2022/setupvars.sh
cmake .. -DCMAKE_BUILD_TYPE=Release
make --jobs=$(nproc)
```
The result of this command is a compiled shared library (`.so` or `.dll`). It should be loaded in the
application using `Core` class instance method `AddExtension` like this
`core.AddExtension(std::make_shared<Extension>(compiled_library_file_name), "CPU");`.
To test that the extension is implemented correctly we can run the "mri_reconstruction_demo" with the following content:
@snippet mri_reconstruction_demo.py mri_demo:demo
The script can be executed using the following command line:
```bash
python3 mri_reconstruction_demo.py \
-m <PATH_TO_IR>/wnet_20.xml \
-i <PATH_TO_SAMPLE_MRI_IMAGE>.npy \
-p <Hybrid-CS-Model-MRI_repo>/Data/sampling_mask_20perc.npy \
-l <PATH_TO_BUILD_DIR>/libtemplate_extension.so \
-d CPU
```
## Additional Resources
- Intel® Distribution of OpenVINO™ toolkit home page: [https://software.intel.com/en-us/openvino-toolkit](https://software.intel.com/en-us/openvino-toolkit)
- OpenVINO™ toolkit online documentation: [https://docs.openvino.ai](https://docs.openvino.ai)
- [Model Optimizer Developer Guide](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md)
- [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md)
- [Inference Engine Extensibility Mechanism](../IE_DG/Extensibility_DG/Intro.md)
- [Inference Engine Samples Overview](../IE_DG/Samples_Overview.md)
- [Overview of OpenVINO™ Toolkit Pre-Trained Models](@ref omz_models_group_intel)
- For IoT Libraries and Code Samples see the [Intel® IoT Developer Kit](https://github.com/intel-iot-devkit).
## Converting Models:
- [Convert Your Caffe* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Caffe.md)
- [Convert Your TensorFlow* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md)
- [Convert Your MXNet* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_MxNet.md)
- [Convert Your Kaldi* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Kaldi.md)
- [Convert Your ONNX* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_ONNX.md)

View File

@@ -1,756 +0,0 @@
# Inference Engine API Changes History {#openvino_docs_IE_DG_API_Changes}
The sections below contain detailed list of changes made to the Inference Engine API in recent releases.
## 2021.4
### New API
* InferenceEngine::Core::LoadNetwork(modelPath, deviceName, config) simplified API to read and load network in one call
### Deprecated API
**InferenceEngine::Parameter**
* InferenceEngine::Parameter(const std::shared_ptr<ngraph::Variant>&)
* InferenceEngine::Parameter(std::shared_ptr<ngraph::Variant>& var)
* std::shared_ptr<ngraph::Variant> InferenceEngine::Parameter::asVariant() const
* InferenceEngine::Parameter::operator std::shared_ptr<ngraph::Variant>() const
**GPU plugin configuration keys**
* KEY_CLDNN_NV12_TWO_INPUTS GPU plugin option. Use KEY_GPU_NV12_TWO_INPUTS instead
* KEY_CLDNN_PLUGIN_PRIORITY GPU plugin option. Use KEY_GPU_PLUGIN_PRIORITY instead
* KEY_CLDNN_PLUGIN_THROTTLE GPU plugin option. Use KEY_GPU_PLUGIN_THROTTLE instead
* KEY_CLDNN_MEM_POOL GPU plugin option
* KEY_CLDNN_GRAPH_DUMPS_DIR GPU plugin option
* KEY_CLDNN_SOURCES_DUMPS_DIR GPU plugin option
* KEY_DUMP_KERNELS GPU plugin option
* KEY_TUNING_MODE GPU plugin option
* KEY_TUNING_FILE GPU plugin option
**InferenceEngine::IInferRequest**
* IInferRequest interface is deprecated, use InferRequest wrapper:
* Constructor for InferRequest from IInferRequest:: Ptr is deprecated
* Cast operator for InferRequest to IInferRequest shared pointer is deprecated
**InferenceEngine::ICNNNetwork**
* ICNNNetwork interface is deprecated by means of deprecation of all its methods, use CNNNetwork wrapper
* CNNNetwork methods working with ICNNNetwork are deprecated:
* Cast to ICNNNetwork shared pointer
* Cast to reference to ICNNNetwork interface
* Constructor from ICNNNetwork shared pointer
**InferenceEngine::IExecutableNetwork**
* IExecutableNetwork is deprecated, use ExecutableNetwork wrappers:
* Constructor of ExecutableNetwork from IExecutableNetwork shared pointer is deprecated
* The following ExecutableNetwork methods are deprecated:
* ExecutableNetwork::reset
* Cast operator to IExecutableNetwork shared pointer
* ExecutableNetwork::CreateInferRequestPtr - use ExecutableNetwork::CreateInferRequest instead
**Extensions API**
* InferenceEngine::make_so_pointer which is used to create Extensions library is replaced by std::make_shared<Extension>(..)
* InferenceEngine::IExtension::Release is deprecated with no replacement
* Use IE_DEFINE_EXTENSION_CREATE_FUNCTION helper macro instead of explicit declaration of CreateExtension function, which create extension.
**Other changes**
* Version::ApiVersion structure is deprecated, Inference Engine does not have API version anymore
* LowLatency - use lowLatency2 instead
* CONFIG_KEY(DUMP_EXEC_GRAPH_AS_DOT) - use InferenceEngine::ExecutableNetwork::GetExecGraphInfo::serialize() instead
* Core::ImportNetwork with no device - pass device name explicitly.
* details::InferenceEngineException - use InferenceEngine::Exception and its derivatives instead.
## 2021.3
### New API
* InferenceEngine::InferRequest::Cancel to cancel inference request execution
* InferenceEngine::Layout::HWC to support HWC layout for input or output blobs
* InferenceEngine::Precision::F64 data precision for f64 data type
* InferenceEngine::CNNNetwork::getOVNameForTensor to map frameworks tensor names to OpenVINO internal tensor names
### Deprecated API
* InferenceEngine::IVariableState interface is deprecated, use InferenceEngine::VariableState wrapper
## 2021.2
### New API
**State API**
* InferenceEngine::InferRequest::QueryState query state value of network on current infer request
* InferenceEngine::IVariableState class instead of IMemoryState (rename)
* InferenceEngine::IVariableState::GetState instead of IMemoryState::GetLastState (rename)
**BatchedBlob** - represents a InferenceEngine::BatchedBlob containing other blobs - one per batch.
**Transformations API** - added a new header `ie_transformations.hpp` which contains transformations for InferenceEngine::CNNNetwork object. Such transformations can be called prior to loading network for compilation for particular device:
* InferenceEngine::LowLatency
### Deprecated API
**State API**
* InferenceEngine::ExecutableNetwork::QueryState - use InferenceEngine::InferRequest::QueryState
* InferenceEngine::IVariableState::GetLastState - use InferenceEngine::IVariableState::GetState
## 2021.1
### Deprecated API
**Utility functions to convert Unicode paths**
* InferenceEngine::stringToFileName - use OS-specific native conversion functions
* InferenceEngine::fileNameToString - use OS-specific native conversion functions
### Removed API
**Plugin API:**
* InferenceEngine::InferencePlugin C++ plugin wrapper class
* InferenceEngine::IInferencePlugin plugin interface
* InferenceEngine::PluginDispatcher class
* InferenceEngine::InferenceEnginePluginPtr typedef
* InferenceEngine::ICNNNetReader reader interface
* InferenceEngine::CNNNetReader class
**Extensibility API:**
* InferenceEngine::ILayerImplFactory class
* InferenceEngine::IShapeInferImpl class
* InferenceEngine::IShapeInferExtension class
* InferenceEngine::IExtension::getFactoryFor(ILayerImplFactory\*& factory, const CNNLayer\* cnnLayer, ResponseDesc\* resp) noexcept method
* InferenceEngine::IExtension::getPrimitiveTypes(char\*\*& types, unsigned int& size, ResponseDesc\* resp) noexcept method
* InferenceEngine::ShapeInferImpl class
* InferenceEngine::Extension::getFactoryFor(ILayerImplFactory\*& factory, const CNNLayer\* cnnLayer, ResponseDesc\* resp) noexcept method
* InferenceEngine::Extension::getPrimitiveTypes(char\*\*& types, unsigned int& size, ResponseDesc\* resp) noexcept method
**Network API:**
* InferenceEngine::details::CNNNetworkIterator class
* InferenceEngine::CNNNetwork::getPrecision() const method
* InferenceEngine::CNNNetwork::getLayerByName(const char\* layerName) const method
* InferenceEngine::CNNNetwork::size() const method
* InferenceEngine::CNNNetwork::begin() const method
* InferenceEngine::CNNNetwork::end() const method
* InferenceEngine::CNNNetwork::AddExtension(const IShapeInferExtensionPtr& extension) method
* InferenceEngine::ICNNNetwork::getPrecision() const noexcept method
* InferenceEngine::ICNNNetwork::getName(char\* pName, size_t len) const noexcept method
* InferenceEngine::ICNNNetwork::getData(const char\* dname) noexcept method
* InferenceEngine::ICNNNetwork::addLayer(const CNNLayerPtr& layer) noexcept method
* InferenceEngine::ICNNNetwork::getLayerByName(const char\* layerName, CNNLayerPtr& out, ResponseDesc\* resp) const noexcept method
* InferenceEngine::ICNNNetwork::AddExtension(const IShapeInferExtensionPtr& extension, ResponseDesc\* resp) noexcept method
* InferenceEngine::ICNNNetwork::getStats(ICNNNetworkStats\*\* stats, ResponseDesc\* resp) const noexcept method
* InferenceEngine::ICNNNetworkStats class
* InferenceEngine::NetworkNodeStats class
* InferenceEngine::Data::getCreatorLayer() method
* InferenceEngine::Data::getInputTo() method
* InferenceEngine::LayerParams class
**Layer API:**
* InferenceEngine::CNNLayer class
* InferenceEngine::WeightableLayer class
* InferenceEngine::BatchNormalizationLayer class
* InferenceEngine::BatchToSpaceLayer class
* InferenceEngine::BinaryConvolutionLayer class
* InferenceEngine::BroadcastLayer class
* InferenceEngine::BucketizeLayer class
* InferenceEngine::ClampLayer class
* InferenceEngine::ConcatLayer class
* InferenceEngine::ConvolutionLayer class
* InferenceEngine::CropLayer class
* InferenceEngine::DeconvolutionLayer class
* InferenceEngine::DeformableConvolutionLayer class
* InferenceEngine::DepthToSpaceLayer class
* InferenceEngine::EltwiseLayer class
* InferenceEngine::ExperimentalDetectronPriorGridGenerator class
* InferenceEngine::ExperimentalDetectronPriorGridGeneratorLayer class
* InferenceEngine::ExperimentalSparseWeightedReduceLayer class
* InferenceEngine::FillLayer class
* InferenceEngine::FullyConnectedLayer class
* InferenceEngine::GRNLayer class
* InferenceEngine::GRUCell class
* InferenceEngine::GatherLayer class
* InferenceEngine::GemmLayer class
* InferenceEngine::LSTMCell class
* InferenceEngine::MVNLayer class
* InferenceEngine::MathLayer class
* InferenceEngine::NonMaxSuppression class
* InferenceEngine::NormLayer class
* InferenceEngine::OneHotLayer class
* InferenceEngine::PReLULayer class
* InferenceEngine::PadLayer class
* InferenceEngine::PoolingLayer class
* InferenceEngine::PowerLayer class
* InferenceEngine::QuantizeLayer class
* InferenceEngine::RNNCell class
* InferenceEngine::RNNCellBase class
* InferenceEngine::RNNSequenceLayer class
* InferenceEngine::RangeLayer class
* InferenceEngine::ReLU6Layer class
* InferenceEngine::ReLULayer class
* InferenceEngine::ReduceLayer class
* InferenceEngine::ReshapeLayer class
* InferenceEngine::ReverseSequenceLayer class
* InferenceEngine::ScaleShiftLayer class
* InferenceEngine::ScatterLayer class
* InferenceEngine::SelectLayer class
* InferenceEngine::ShuffleChannelsLayer class
* InferenceEngine::SoftMaxLayer class
* InferenceEngine::SpaceToBatchLayer class
* InferenceEngine::SpaceToDepthLayer class
* InferenceEngine::SparseFillEmptyRowsLayer class
* InferenceEngine::SparseSegmentReduceLayer class
* InferenceEngine::SparseToDenseLayer class
* InferenceEngine::SplitLayer class
* InferenceEngine::StridedSliceLayer class
* InferenceEngine::TensorIterator class
* InferenceEngine::TileLayer class
* InferenceEngine::TopKLayer class
* InferenceEngine::UniqueLayer class
## 2020.4
### New API
**CPU Plugin API:**
* InferenceEngine::PluginConfigParams::KEY_ENFORCE_BF16 config key
**Metrics and values for Query API:**
* METRIC_KEY(OPTIMIZATION_CAPABILITIES)
* METRIC_VALUE(BF16)
### Deprecated API
**MYRIAD Plugin API:**
* VPU_CONFIG_KEY(IGNORE_IR_STATISTIC)
### Removed API
**Inference Engine NN Builder API:**
* InferenceEngine::Builder::EltwiseLayer
* InferenceEngine::Builder::MemoryLayer
* InferenceEngine::Builder::ROIPoolingLayer
* InferenceEngine::Builder::DeconvolutionLayer
* InferenceEngine::Builder::ReLULayer
* InferenceEngine::Builder::TanHLayer
* InferenceEngine::Builder::InputLayer
* InferenceEngine::Builder::PoolingLayer
* InferenceEngine::Builder::CropLayer
* InferenceEngine::Builder::GRUSequenceLayer
* InferenceEngine::Builder::NormLayer
* InferenceEngine::Builder::LSTMSequenceLayer
* InferenceEngine::Builder::ClampLayer
* InferenceEngine::Builder::PSROIPoolingLayer
* InferenceEngine::Builder::Layer
* InferenceEngine::Builder::RNNSequenceLayer
* InferenceEngine::Builder::ReorgYoloLayer
* InferenceEngine::Builder::NormalizeLayer
* InferenceEngine::Builder::PriorBoxClusteredLayer
* InferenceEngine::Builder::MVNLayer
* InferenceEngine::Builder::PermuteLayer
* InferenceEngine::Builder::SimplerNMSLayer
* InferenceEngine::Builder::ConstLayer
* InferenceEngine::Builder::DeformableConvolutionLayer
* InferenceEngine::Builder::FullyConnectedLayer
* InferenceEngine::Builder::PriorBoxLayer
* InferenceEngine::Builder::SoftMaxLayer
* InferenceEngine::Builder::OutputLayer
* InferenceEngine::Builder::TileLayer
* InferenceEngine::Builder::SplitLayer
* InferenceEngine::Builder::PReLULayer
* InferenceEngine::Builder::RegionYoloLayer
* InferenceEngine::Builder::ReshapeLayer
* InferenceEngine::Builder::ConvolutionLayer
* InferenceEngine::Builder::DetectionOutputLayer
* InferenceEngine::Builder::ConcatLayer
* InferenceEngine::Builder::ELULayer
* InferenceEngine::Builder::GRNLayer
* InferenceEngine::Builder::LRNLayer
* InferenceEngine::Builder::ArgMaxLayer
* InferenceEngine::Builder::ReLU6Layer
* InferenceEngine::Builder::ScaleShiftLayer
* InferenceEngine::Builder::ProposalLayer
* InferenceEngine::Builder::SigmoidLayer
* InferenceEngine::Builder::ResampleLayer
* InferenceEngine::Builder::CTCGreedyDecoderLayer
* InferenceEngine::Builder::BatchNormalizationLayer
* InferenceEngine::Builder::LayerDecorator
* InferenceEngine::Builder::PowerLayer
* InferenceEngine::Builder::Network
* InferenceEngine::Builder::PortInfo
* InferenceEngine::Builder::Connection
* InferenceEngine::Builder::PortData
* InferenceEngine::Builder::Port
* InferenceEngine::Builder::ILayer
* InferenceEngine::Builder::INetworkIterator
* InferenceEngine::Builder::INetwork
* InferenceEngine::Builder::ILayer
## 2020.2
### New API
**Extensibility API:**
* InferenceEngine::IExtension::getImplTypes(const std::shared_ptr<ngraph::Node>& node) method
* InferenceEngine::IExtension::getImplementation(const std::shared_ptr<ngraph::Node>& node, const std::string& implType) method
### Deprecated API
**Extensibility API:**
* InferenceEngine::ILayerImplFactory class
* InferenceEngine::IShapeInferImpl class
* InferenceEngine::IShapeInferImpl class
* InferenceEngine::IShapeInferExtension class
* InferenceEngine::IExtension::getFactoryFor(ILayerImplFactory\*& factory, const CNNLayer\* cnnLayer, ResponseDesc\* resp) noexcept method
* InferenceEngine::IExtension::getPrimitiveTypes(char\*\*& types, unsigned int& size, ResponseDesc\* resp) noexcept method
* InferenceEngine::ShapeInferImpl class
* InferenceEngine::Extension::getFactoryFor(ILayerImplFactory\*& factory, const CNNLayer\* cnnLayer, ResponseDesc\* resp) noexcept method
* InferenceEngine::Extension::getPrimitiveTypes(char\*\*& types, unsigned int& size, ResponseDesc\* resp) noexcept method
**Network API:**
* InferenceEngine::details::CNNNetworkIterator class
* InferenceEngine::CNNNetwork::getPrecision() const method
* InferenceEngine::CNNNetwork::getLayerByName(const char\* layerName) const method
* InferenceEngine::CNNNetwork::size() const method
* InferenceEngine::CNNNetwork::begin() const method
* InferenceEngine::CNNNetwork::end() const method
* InferenceEngine::CNNNetwork::AddExtension(const IShapeInferExtensionPtr& extension) method
* InferenceEngine::ICNNNetwork::getPrecision() const noexcept method
* InferenceEngine::ICNNNetwork::getName(char\* pName, size_t len) const noexcept method
* InferenceEngine::ICNNNetwork::getData(const char\* dname) noexcept method
* InferenceEngine::ICNNNetwork::addLayer(const CNNLayerPtr& layer) noexcept method
* InferenceEngine::ICNNNetwork::getLayerByName(const char\* layerName, CNNLayerPtr& out, ResponseDesc\* resp) const noexcept method
* InferenceEngine::ICNNNetwork::AddExtension(const IShapeInferExtensionPtr& extension, ResponseDesc\* resp) noexcept method
* InferenceEngine::ICNNNetwork::getStats(ICNNNetworkStats\*\* stats, ResponseDesc\* resp) const noexcept method
* InferenceEngine::ICNNNetworkStats class
* InferenceEngine::NetworkNodeStats class
* InferenceEngine::Data::getCreatorLayer() method
* InferenceEngine::Data::getInputTo() method
* InferenceEngine::LayerParams class
**Layer API:**
* InferenceEngine::CNNLayer class
* InferenceEngine::WeightableLayer class
* InferenceEngine::BatchNormalizationLayer class
* InferenceEngine::BatchToSpaceLayer class
* InferenceEngine::BinaryConvolutionLayer class
* InferenceEngine::BroadcastLayer class
* InferenceEngine::BucketizeLayer class
* InferenceEngine::ClampLayer class
* InferenceEngine::ConcatLayer class
* InferenceEngine::ConvolutionLayer class
* InferenceEngine::CropLayer class
* InferenceEngine::DeconvolutionLayer class
* InferenceEngine::DeformableConvolutionLayer class
* InferenceEngine::DepthToSpaceLayer class
* InferenceEngine::EltwiseLayer class
* InferenceEngine::ExperimentalDetectronPriorGridGenerator class
* InferenceEngine::ExperimentalDetectronPriorGridGeneratorLayer class
* InferenceEngine::ExperimentalSparseWeightedReduceLayer class
* InferenceEngine::FillLayer class
* InferenceEngine::FullyConnectedLayer class
* InferenceEngine::GRNLayer class
* InferenceEngine::GRUCell class
* InferenceEngine::GatherLayer class
* InferenceEngine::GemmLayer class
* InferenceEngine::LSTMCell class
* InferenceEngine::MVNLayer class
* InferenceEngine::MathLayer class
* InferenceEngine::NonMaxSuppression class
* InferenceEngine::NormLayer class
* InferenceEngine::OneHotLayer class
* InferenceEngine::PReLULayer class
* InferenceEngine::PadLayer class
* InferenceEngine::PoolingLayer class
* InferenceEngine::PowerLayer class
* InferenceEngine::QuantizeLayer class
* InferenceEngine::RNNCell class
* InferenceEngine::RNNCellBase class
* InferenceEngine::RNNSequenceLayer class
* InferenceEngine::RangeLayer class
* InferenceEngine::ReLU6Layer class
* InferenceEngine::ReLULayer class
* InferenceEngine::ReduceLayer class
* InferenceEngine::ReshapeLayer class
* InferenceEngine::ReverseSequenceLayer class
* InferenceEngine::ScaleShiftLayer class
* InferenceEngine::ScatterLayer class
* InferenceEngine::SelectLayer class
* InferenceEngine::ShuffleChannelsLayer class
* InferenceEngine::SoftMaxLayer class
* InferenceEngine::SpaceToBatchLayer class
* InferenceEngine::SpaceToDepthLayer class
* InferenceEngine::SparseFillEmptyRowsLayer class
* InferenceEngine::SparseSegmentReduceLayer class
* InferenceEngine::SparseToDenseLayer class
* InferenceEngine::SplitLayer class
* InferenceEngine::StridedSliceLayer class
* InferenceEngine::TensorIterator class
* InferenceEngine::TileLayer class
* InferenceEngine::TopKLayer class
* InferenceEngine::UniqueLayer class
## 2020.1
### New API
**Integration with ngraph API:**
* InferenceEngine::CNNNetwork(const std::shared_ptr<ngraph::Function>& network) ctor from ngraph::Function
* InferenceEngine::CNNNetwork::getFunction() const noexcept method
* InferenceEngine::ICNNNetwork::getFunction() const noexcept method
* InferenceEngine::Parameter(const std::shared_ptr<ngraph::Variant>& var) ctor
* InferenceEngine::Parameter::asVariant() const method
* InferenceEngine::Parameter::operator std::shared_ptr<ngraph::Variant>() const operator
* InferenceEngine::Core::ReadNetwork(const std::wstring& modelPath, const std::wstring& binPath) method
* InferenceEngine::Core::ReadNetwork(const std::string& modelPath, const std::string& binPath = "") method
* InferenceEngine::Core::ReadNetwork(const std::string& model, const Blob::CPtr& weights) method
* InferenceEngine::Code::AddExtension(const IExtensionPtr& extension) method
* InferenceEngine::IExtension::getOpSets() method
**Offline compilation: import / export to std::stream:**
* InferenceEngine::ExecutableNetwork::Export(std::ostream& networkModel) method
* InferenceEngine::Core::ImportNetwork(std::istream& networkModel, const std::string& deviceName = {}, const std::map<std::string, std::string>& config = {}) method
* InferenceEngine::IExecutableNetwork::Export(std::ostream& networkModel, ResponseDesc \*resp) noexcept method
**RemoteBlob accelerator memory sharing API:**
* InferenceEngine::RemoteContext class
* InferenceEngine::RemoteBlob class
* InferenceEngine::Core::CreateContext(const std::string& deviceName, const ParamMap& params) method
* InferenceEngine::Core::GetDefaultContext(const std::string& deviceName) method
* InferenceEngine::Core::LoadNetwork(CNNNetwork network, RemoteContext::Ptr context, const std::map<std::string, std::string>& config = std::map<std::string, std::string>()) method
**GNA firmware model image generation:**
* GNA_CONFIG_KEY(FIRMWARE_MODEL_IMAGE_GENERATION) config key
* GNA_CONFIG_VALUE(GEN) value
* GNA_CONFIG_VALUE(GEN_EXACT) value
* GNA_CONFIG_VALUE(SSE) value
* GNA_CONFIG_VALUE(SSE_EXACT) value
* GNA_CONFIG_VALUE(AVX1) value
* GNA_CONFIG_VALUE(AVX1_EXACT) value
* GNA_CONFIG_VALUE(AVX2) value
* GNA_CONFIG_VALUE(AVX2_EXACT) value
**MemoryBlob mapping of memory to the user space:**
* InferenceEngine::MemoryBlob::rwmap() noexcept method
* InferenceEngine::MemoryBlob::rmap() noexcept method
* InferenceEngine::MemoryBlob::wmap() noexcept method
**Memory interoperability on acceleration devices. General classes and GPU helper functions**
* InferenceEngine::RemoteBlob class
* InferenceEngine::RemoteContext class
* InferenceEngine::Core::CreateContext(const std::string& deviceName, const ParamMap& params) method
* InferenceEngine::Core::GetDefaultContext(const std::string& deviceName) method
* InferenceEngine::make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx) function
* InferenceEngine::gpu::make_shared_blob_nv12(size_t height, size_t width, RemoteContext::Ptr ctx, VASurfaceID nv12_surf) function
* InferenceEngine::gpu::make_shared_context(Core& core, std::string deviceName, VADisplay device) function
* InferenceEngine::gpu::make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, VASurfaceID surface, uint32_t plane = 0) function
* InferenceEngine::gpu::make_shared_blob_nv12(RemoteContext::Ptr ctx, cl::Image2D& nv12_image_plane_y, cl::Image2D& nv12_image_plane_uv) function
* InferenceEngine::gpu::make_shared_context(Core& core, std::string deviceName, cl_context ctx) function
* InferenceEngine::gpu::make_shared_blob(const TensorDesc& desc, ClContext::Ptr ctx) function
* InferenceEngine::gpu::make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Buffer& buffer) function
* InferenceEngine::gpu::make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl_mem buffer) function
* InferenceEngine::gpu::make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Image2D& image) function
### Deprecated API
**Inference Engine NN Builder API:**
* InferenceEngine::Builder::EltwiseLayer
* InferenceEngine::Builder::MemoryLayer
* InferenceEngine::Builder::ROIPoolingLayer
* InferenceEngine::Builder::DeconvolutionLayer
* InferenceEngine::Builder::ReLULayer
* InferenceEngine::Builder::TanHLayer
* InferenceEngine::Builder::InputLayer
* InferenceEngine::Builder::PoolingLayer
* InferenceEngine::Builder::CropLayer
* InferenceEngine::Builder::GRUSequenceLayer
* InferenceEngine::Builder::NormLayer
* InferenceEngine::Builder::LSTMSequenceLayer
* InferenceEngine::Builder::ClampLayer
* InferenceEngine::Builder::PSROIPoolingLayer
* InferenceEngine::Builder::Layer
* InferenceEngine::Builder::RNNSequenceLayer
* InferenceEngine::Builder::ReorgYoloLayer
* InferenceEngine::Builder::NormalizeLayer
* InferenceEngine::Builder::PriorBoxClusteredLayer
* InferenceEngine::Builder::MVNLayer
* InferenceEngine::Builder::PermuteLayer
* InferenceEngine::Builder::SimplerNMSLayer
* InferenceEngine::Builder::ConstLayer
* InferenceEngine::Builder::DeformableConvolutionLayer
* InferenceEngine::Builder::FullyConnectedLayer
* InferenceEngine::Builder::PriorBoxLayer
* InferenceEngine::Builder::SoftMaxLayer
* InferenceEngine::Builder::OutputLayer
* InferenceEngine::Builder::TileLayer
* InferenceEngine::Builder::SplitLayer
* InferenceEngine::Builder::PReLULayer
* InferenceEngine::Builder::RegionYoloLayer
* InferenceEngine::Builder::ReshapeLayer
* InferenceEngine::Builder::ConvolutionLayer
* InferenceEngine::Builder::DetectionOutputLayer
* InferenceEngine::Builder::ConcatLayer
* InferenceEngine::Builder::ELULayer
* InferenceEngine::Builder::GRNLayer
* InferenceEngine::Builder::LRNLayer
* InferenceEngine::Builder::ArgMaxLayer
* InferenceEngine::Builder::ReLU6Layer
* InferenceEngine::Builder::ScaleShiftLayer
* InferenceEngine::Builder::ProposalLayer
* InferenceEngine::Builder::SigmoidLayer
* InferenceEngine::Builder::ResampleLayer
* InferenceEngine::Builder::CTCGreedyDecoderLayer
* InferenceEngine::Builder::BatchNormalizationLayer
* InferenceEngine::Builder::LayerDecorator
* InferenceEngine::Builder::PowerLayer
* InferenceEngine::Builder::Network
* InferenceEngine::Builder::PortInfo
* InferenceEngine::Builder::Connection
* InferenceEngine::Builder::PortData
* InferenceEngine::Builder::Port
* InferenceEngine::Builder::ILayer
* InferenceEngine::Builder::INetworkIterator
* InferenceEngine::Builder::INetwork
* InferenceEngine::Builder::ILayer
**Plugin API:**
* InferenceEngine::InferencePlugin C++ plugin wrapper class
* InferenceEngine::IInferencePlugin plugin interface
* InferenceEngine::PluginDispatcher class
* InferenceEngine::InferenceEnginePluginPtr typedef
* InferenceEngine::ICNNNetReader reader interface
* InferenceEngine::CNNNetReader class
**Blob API:**
* Blob::element_size() const noexcept method
* Blob::buffer() noexcept method
* Blob::cbuffer() noexcept method
* MemoryBlob::buffer() noexcept method
* MemoryBlob::cbuffer() noexcept method
### Removed API
Removed all [Inference Engine API which deprecated in 2019'R2](https://docs.openvino.ai/2019_R3/_docs_IE_DG_API_Changes.html#deprecated_api)
## 2019 R3
### New API
**New supported layers:**
* InferenceEngine::SparseFillEmptyRowsLayer new class
* InferenceEngine::UniqueLayer new class
* InferenceEngine::NonMaxSuppressionLayer new class
* InferenceEngine::ScatterLayer new class
**FPGA plugin streaming support:**
* DLIA_METRIC_VALUE(INPUT_STREAMING) value to METRIC_KEY(OPTIMIZATION_CAPABILITIES)
* DLIA_CONFIG_KEY(ENABLE_STREAMING) config key
### Removed API
* InferenceEngine::EltwiseLayer::Select from InferenceEngine::EltwiseLayer::eOperation enumeration
## 2019 R2
### New API
**Inference Engine Core API:**
* Introduced InferenceEngine::Core high level class to manage devices
**Query API extensions to InferenceEngine::ExecutableNetwork and InferenceEngine::IExecutableNetwork:**
* InferenceEngine::ExecutableNetwork::SetConfig method
* InferenceEngine::ExecutableNetwork::GetConfig method
* InferenceEngine::ExecutableNetwork::GetMetric method
* InferenceEngine::IExecutableNetwork::SetConfig method
* InferenceEngine::IExecutableNetwork::GetConfig method
* InferenceEngine::IExecutableNetwork::GetMetric method
**Metrics and values for Query API:**
* METRIC_KEY(AVAILABLE_DEVICES)
* METRIC_KEY(SUPPORTED_METRICS)
* METRIC_KEY(SUPPORTED_CONFIG_KEYS)
* METRIC_KEY(FULL_DEVICE_NAME)
* METRIC_KEY(OPTIMIZATION_CAPABILITIES)
* METRIC_VALUE(FP32)
* METRIC_VALUE(FP16)
* METRIC_VALUE(INT8)
* METRIC_VALUE(BIN)
* METRIC_VALUE(WINOGRAD)
* DLIA_METRIC_VALUE(FP11)
* METRIC_KEY(RANGE_FOR_STREAMS)
* METRIC_KEY(NUMBER_OF_WAITING_INFER_REQUESTS)
* METRIC_KEY(NUMBER_OF_EXEC_INFER_REQUESTS)
* METRIC_KEY(DEVICE_THERMAL)
* METRIC_KEY(RANGE_FOR_ASYNC_INFER_REQUESTS)
* EXEC_NETWORK_METRIC_KEY(NETWORK_NAME)
* EXEC_NETWORK_METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)
**Common API:**
* CLDNN_CONFIG_KEY(INT8_ENABLED) config key
* CONFIG_KEY(GPU_THROUGHPUT_AUTO)
* CONFIG_KEY(GPU_THROUGHPUT_STREAMS)
* DLIA_CONFIG_KEY(IO_TRANSFORMATIONS_NATIVE) config key
* DLIA_CONFIG_KEY(DUMP_SUPPORTED_LAYERS_INFORMATION) config key
* GNA_CONFIG_VALUE(SW_FP32) config value for GNA_CONFIG_KEY(DEVICE_MODE) key
* MULTI_CONFIG_KEY(DEVICE_PRIORITIES) config key for `MULTI` device
* InferenceEngine::CNNNetReader::ReadNetwork(const std::wstring &filepath) new method
* InferenceEngine::CNNNetReader::ReadWeights(const std::wstring &filepath) new method
* InferenceEngine::ExecutableNetwork::ExecutableNetwork(IExecutableNetwork::Ptr actual, InferenceEnginePluginPtr plg) constructor with additional `plg` parameter
* InferenceEngine::InferRequest::InferRequest(IInferRequest::Ptr request, InferenceEnginePluginPtr plg) constructor with additional `plg` parameter
* InferenceEngine::Data::setName method
* InferenceEngine::QueryNetworkResult::supportedLayersMap
* InferenceEngine::Precision::I64 extension to InferenceEngine::Precision::ePrecision enumeration
**New supported primitives:**
* InferenceEngine::Builder::DeformableConvolutionLayer new class
* InferenceEngine::DeformableConvolutionLayer new class
* InferenceEngine::EltwiseLayer::Logical_NOT, InferenceEngine::EltwiseLayer::Mean, InferenceEngine::EltwiseLayer::Select extensions to InferenceEngine::EltwiseLayer::eOperation enumeration
* InferenceEngine::OneHotLayer new class
* InferenceEngine::SelectLayer new class
* InferenceEngine::BroadcastLayer new class
* InferenceEngine::MathLayer new class
* InferenceEngine::ReduceLayer new class
* InferenceEngine::TopKLayer new class
**Extensions to Blob creation API:**
* InferenceEngine::Blob::is method
* InferenceEngine::Blob::is const method
* InferenceEngine::Blob::as method
* InferenceEngine::Blob::as const method
* InferenceEngine::Blob::getAllocator abstract method
* InferenceEngine::Blob::getHandle abstract method
* InferenceEngine::MemoryBlob class
* InferenceEngine::ColorFormat enumeration
* InferenceEngine::PreProcessInfo::setColorFormat method
* InferenceEngine::PreProcessInfo::getColorFormat method
* InferenceEngine::CompoundBlob class to work with blobs consisting of several planes
* InferenceEngine::NV12Blob class representing NV12 blob with two planes
### Deprecated API
The methods listed below are deprecated and will be removed in 2019 R4 release:
**Common API:**
* InferenceEngine::InputInfo::getInputPrecision method
* InferenceEngine::InputInfo::setInputPrecision method
* InferenceEngine::InputInfo::getDims method
* InferenceEngine::CNNLayer::GetParamsAsBool method
* InferenceEngine::CNNNetwork::CNNNetwork(ICNNNetwork* actual) constructor
* InferenceEngine::CNNNetwork::setTargetDevice method
* HETERO_CONFIG_KEY(DUMP_DLA_MESSAGES) config key
* InferenceEngine::ILayerImplFactory::getShapes method
* InferenceEngine::IShapeInferImpl::inferShapes(const std::vector<SizeVector>&, const std::map<std::string, std::string>& , const std::map<std::string, Blob::Ptr>&, std::vector<SizeVector>&, ResponseDesc\*) method
* InferenceEngine::Data::setBatchSize method
* InferenceEngine::QueryNetworkResult::supportedLayers field
* InferenceEngine::ICNNNetwork::setBatchSize(const size_t size) method
* InferenceEngine::Blob::Resize method
* InferenceEngine::Blob::Reshape method
* InferenceEngine::TBlob::set method
**InferenceEngine::IInferencePlugin and InferenceEngine:InferencePlugin obsolete methods:**
* InferenceEngine::InferencePlugin::LoadNetwork(ICNNNetwork &network) method
* InferenceEngine::InferencePlugin::Infer method
* InferenceEngine::InferencePlugin::GetPerformanceCounts method
* InferenceEngine::InferencePlugin::QueryNetwork(const ICNNNetwork &network, QueryNetworkResult &res) const method
* InferenceEngine::IInferencePlugin::LoadNetwork(ICNNNetwork &network, ResponseDesc \*resp) method
* InferenceEngine::IInferencePlugin::Infer(const Blob &input, Blob &result, ResponseDesc \*resp) method
* InferenceEngine::IInferencePlugin::Infer(const BlobMap &input, BlobMap &result, ResponseDesc \*resp) method
* InferenceEngine::IInferencePlugin::GetPerformanceCounts method
* InferenceEngine::IInferencePlugin::QueryNetwork(const ICNNNetwork& network, QueryNetworkResult& res) const method
**Fields in InferenceEngine::Data class are replaced with appropriate methods:**
* InferenceEngine::Data::precision field
* InferenceEngine::Data::layout field
* InferenceEngine::Data::dims field
* InferenceEngine::Data::creatorLayer field
* InferenceEngine::Data::name field
* InferenceEngine::Data::inputTo field
* InferenceEngine::Data::userObject field
**Heterogeneous plugin:**
* InferenceEngine::IHeteroDeviceLoader class
* InferenceEngine::IHeteroInferencePlugin class
* InferenceEngine::HeteroPluginPtr class
* operator InferenceEngine::InferencePlugin::HeteroPluginPtr operator
**Blob creation API with dimensions in reverse order:**
* InferenceEngine::Blob::Blob(Precision p) constructor
* InferenceEngine::Blob::Blob(Precision p, Layout l) constructor
* InferenceEngine::Blob::Blob(Precision p, const SizeVector &dims) constructor
* InferenceEngine::Blob::Blob(Precision p, Layout l, const SizeVector &dims) constructor
* InferenceEngine::TBlob::TBlob(Precision p, Layout l) constructor
* InferenceEngine::TBlob::TBlob(Precision p, Layout l, const SizeVector& dims) constructor
* InferenceEngine::TBlob::TBlob(Precision p, Layout l, const SizeVector& dims, T* ptr, size_t data_size) constructor
* InferenceEngine::TBlob::TBlob(Precision p, Layout l, const SizeVector &dims, std::shared_ptr<IAllocator> alloc) constructor
* InferenceEngine::Blob::type() method
* InferenceEngine::Blob::precision() method
* InferenceEngine::Blob::layout() method
* InferenceEngine::Blob::dims() method
* InferenceEngine::make_shared_blob(Precision p, Layout l, const SizeVector &dims) function
* InferenceEngine::make_shared_blob(Precision p, const SizeVector &dims) function
* InferenceEngine::make_shared_blob(Precision p, Layout l, const TArg &arg) function
* InferenceEngine::make_shared_blob(Precision p, const TArg &arg) function
* InferenceEngine::make_shared_blob(TBlob<TypeTo> &&arg) function
* InferenceEngine::make_shared_blob(Precision p, Layout l) function
* InferenceEngine::make_shared_blob(Precision p, Layout l, SizeVector dims, const std::vector<TypeTo> &arg) function
* InferenceEngine::make_shared_blob(Precision p, Layout l, const std::vector<TypeTo> &arg) function
* InferenceEngine::make_shared_blob(Precision p, const std::vector<TypeTo> &arg) function
* InferenceEngine::make_shared_blob(Precision p, Layout l, const SizeVector &dims, TypeTo * ptr, size_t size) function
* InferenceEngine::make_shared_blob(Precision p, const SizeVector &dims, TypeTo * ptr, size_t size) function
* InferenceEngine::I_N variable
* InferenceEngine::I_C variable
* InferenceEngine::I_H variable
* InferenceEngine::I_W variable
* InferenceEngine::LayoutOffsetCounter class
* InferenceEngine::ConvertLayout function
**API working with device enumeration:**
* InferenceEngine::TargetDevice enumeration
* InferenceEngine::TargetDeviceInfo class
* InferenceEngine::getDeviceName function
* InferenceEngine::FindPluginRequest class
* InferenceEngine::FindPluginResponse class
* InferenceEngine::findPlugin(const FindPluginRequest &req, FindPluginResponse &result, ResponseDesc *resp) function
* InferenceEngine::ICNNNetwork::setTargetDevice method
* InferenceEngine::ICNNNetwork::getTargetDevice method
* InferenceEngine::PluginDispatcher::getPluginByDevice method
* InferenceEngine::PluginDispatcher::getSuitablePlugin method

View File

@@ -1,54 +0,0 @@
# Inference Engine Developer Guide {#openvino_docs_IE_DG_Deep_Learning_Inference_Engine_DevGuide}
@sphinxdirective
.. toctree::
:maxdepth: 1
:hidden:
openvino_2_0_transition_guide
openvino_docs_IE_DG_Integrate_with_customer_application_new_API
openvino_docs_deployment_optimization_guide_dldt_optimization_guide
openvino_docs_IE_DG_Device_Plugins
Direct ONNX Format Support <openvino_docs_IE_DG_ONNX_Support>
openvino_docs_IE_DG_Paddle_Support
openvino_docs_IE_DG_Int8Inference
openvino_docs_IE_DG_Bfloat16Inference
openvino_docs_IE_DG_DynamicBatching
openvino_docs_IE_DG_ShapeInference
openvino_docs_IE_DG_Model_caching_overview
openvino_docs_IE_DG_Extensibility_DG_Intro
openvino_docs_IE_DG_Memory_primitives
openvino_docs_IE_DG_network_state_intro
openvino_docs_IE_DG_API_Changes
openvino_docs_IE_DG_Known_Issues_Limitations
openvino_docs_IE_DG_Glossary
@endsphinxdirective
## Introduction
Inference Engine is a set of C++ libraries with C and Python bindings providing a common API to deliver inference solutions on the platform of your choice. Use the Inference Engine API to read the Intermediate Representation (IR), ONNX and execute the model on devices.
Inference Engine uses a plugin architecture. Inference Engine plugin is a software component that contains complete implementation for inference on a certain Intel® hardware device: CPU, GPU, VPU, etc. Each plugin implements the unified API and provides additional hardware-specific APIs.
The scheme below illustrates the typical workflow for deploying a trained deep learning model:
![](img/BASIC_FLOW_IE_C.svg)
\\* _nGraph_ is the internal graph representation in the OpenVINO™ toolkit. Use it to [build a model from source code](https://docs.openvino.ai/latest/openvino_docs_nGraph_DG_build_function.html).
## Video
@sphinxdirective
.. list-table::
* - .. raw:: html
<iframe allowfullscreen mozallowfullscreen msallowfullscreen oallowfullscreen webkitallowfullscreen height="315" width="100%"
src="https://www.youtube.com/embed/e6R13V8nbak">
</iframe>
* - **Inference Engine Concept**. Duration: 3:43
@endsphinxdirective

View File

@@ -1,82 +0,0 @@
# Custom nGraph Operations {#openvino_docs_IE_DG_Extensibility_DG_AddingNGraphOps}
Inference Engine Extension API allows you to register operation sets (opsets) with custom nGraph operations to support models with operations which OpenVINO™ does not support out-of-the-box.
Besides creating custom nGraph operations, to [support custom operations](../../HOWTO/Custom_Layers_Guide.md) in your model you must also create a Model Optimizer extension for the custom operations and an Inference Engine device plugin extension for the device you will use for inference.
## Operation Class
To add your custom nGraph operation, create a new class that extends `ngraph::Op`, which is in turn derived from `ngraph::Node`, the base class for all graph operations in nGraph. Follow the steps below to add a custom nGraph operation:
1. Add the `NGRAPH_RTTI_DECLARATION` and `NGRAPH_RTTI_DEFINITION` macros which define a `NodeTypeInfo` object that identifies the type of the operation to the graph users and helps with dynamic type resolution. The type info of an nGraph operation currently consists of a string identifier and a version number, but this may change in the future.
2. Implement constructors that optionally take the operation inputs and attributes as parameters.
3. Override the shape inference method `validate_and_infer_types`. This method is called multiple times during graph manipulations to determine the shapes and element types of the operations outputs. To access the input shapes and input element types, use the `get_input_partial_shape()` and `get_input_element_type()` methods of `ngraph::Node`. Set the inferred shape and element type of the output using `set_output_type`.
4. Override the `clone_with_new_inputs` method, which enables graph manipulation routines to create copies of this operation and connect it to different nodes during optimization.
5. Override the `visit_attributes` method, which enables serialization and deserialization of operation attributes. An `AttributeVisitor` is passed to the method, and the implementation is expected to walk over all the attributes in the op using the type-aware `on_attribute` helper. Helpers are already implemented for standard C++ types like `int64_t`, `float`, `bool`, `vector`, and for existing nGraph defined types.
6. Override `evaluate`, which is an optional method that enables the application of constant folding if there is a custom operation on the constant branch. If your operation contains `evaluate` method you also need to override the `has_evaluate` method, this method allow to get information about availability of `evaluate` method for the operation.
Based on that, declaration of an operation class can look as follows:
@snippet template_extension/old/op.hpp op:header
### Class Fields
The provided implementation has several fields:
* `add` of type `int64_t` is an attribute of a custom operation
* `type_info` of type `ngraph::NodeTypeInfo` defines type and version of an operation
### Operation Constructors
nGraph operation contains two constructors:
* Default constructor, which enables you to create an operation without attributes
* Constructor that creates and validates an operation with specified inputs and attributes
@snippet template_extension/old/op.cpp op:ctor
### `validate_and_infer_types()`
`ngraph::Node::validate_and_infer_types` method validates operation attributes and calculates output shapes using attributes of the operation.
@snippet template_extension/old/op.cpp op:validate
### `clone_with_new_inputs()`
`ngraph::Node::clone_with_new_inputs` method creates a copy of the nGraph operation with new inputs.
@snippet template_extension/old/op.cpp op:copy
### `visit_attributes()`
`ngraph::Node::visit_attributes` method enables you to visit all operation attributes.
@snippet template_extension/old/op.cpp op:visit_attributes
### `evaluate()` and `has_evaluate()`
`ngraph::Node::evaluate` method enables you to apply constant folding to an operation.
@snippet template_extension/old/op.cpp op:evaluate
## Register Custom Operations in Extension Class
To add custom operations to the [Extension](Extension.md) class, create an operation set with custom operations and implement the `InferenceEngine::IExtension::getOpSets` method:
@snippet template_extension/old/extension.cpp extension:getOpSets
This method returns a map of opsets that exist in the [extension library](Extension.md).
nGraph provides an opset mechanism to group operations into clusters. Different opsets distinguish between different versions of one operation.
When specifying opset names, follow the rules below:
* Use unique opset names.
* Do not use the following built-in opset names: `extension`, `experimental`, `opset1`, `opset2`, `opset3`, ... , `opsetN`.
* [Make sure that the Model Optimizer](../../HOWTO/Custom_Layers_Guide.md) and your extension use the same opset names.
* IR v10 operations have the mandatory `version` attribute specifying the opset.
Operations from the default opset cannot be redefined.
Use a custom opset to create a new operation or extend functionality of an existing operation from another opset.

View File

@@ -1,19 +0,0 @@
# Build Extension Library Using CMake* {#openvino_docs_IE_DG_Extensibility_DG_Building}
Inference Engine build infrastructure provides the Inference Engine Package for application development.
To configure the build of your extension library, use the following CMake script:
@snippet template_extension/old/CMakeLists.txt cmake:extension
This CMake script finds the Inference Engine and nGraph using the `find_package` CMake command.
To build the extension library, run the commands below:
```sh
$ cd template_extension/old
$ mkdir build
$ cd build
$ cmake -DOpenVINO_DIR=[OpenVINO_DIR] ../
$ cmake --build .
```

View File

@@ -1,71 +0,0 @@
# CPU Kernel Custom Operations {#openvino_docs_IE_DG_Extensibility_DG_CPU_Kernel}
To enable operations not supported by OpenVINO™ out of the box, you need a custom extension for Model Optimizer, a custom nGraph operation set, and a custom kernel for the device you will target. This page describes custom kernel support for the CPU device.
The primary means of the performance of the CPU codepath in the Inference Engine is the Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN), and new CPU kernels extend the Inference Engine plugin for the Intel MKL-DNN. Implementing the InferenceEngine::ILayerExecImpl API call defines a general CPU-side extension. There are no Intel MKL-DNN specifics in the way you need to implement a kernel.
## Implementation Class
All custom kernels for the CPU plugin should be inherited from the InferenceEngine::ILayerExecImpl interface.
Based on that, declaration of a kernel implementation class can look as follows:
@snippet template_extension/old/cpu_kernel.hpp cpu_implementation:header
### Class Fields
The provided implementation has several fields:
* `add` of the type `int64_t` is an attribute of a custom operation.
* `inShape` of the type `ngraph::Shape` is an input shape.
* `outShape` of the type `ngraph::Shape` is an output shape.
* `error` of the type `std::string` is a field to handle errors from a constructor.
### Constructor of Implementation
An implementation constructor checks parameters of an nGraph operation, stores required attributes, and stores an error message in case of an error.
@snippet template_extension/old/cpu_kernel.cpp cpu_implementation:ctor
### `getSupportedConfigurations`
The InferenceEngine::ILayerExecImpl::getSupportedConfigurations method returns all supported configuration formats (input/output tensor layouts) for your implementation. To specify formats of data, use InferenceEngine::TensorDesc. Refer to the [Memory Primitives](../Memory_primitives.md) section for instructions.
@snippet template_extension/old/cpu_kernel.cpp cpu_implementation:getSupportedConfigurations
### `init`
The InferenceEngine::ILayerExecImpl::init method gets a runtime-selected configuration from a vector that is populated from the `getSupportedConfigurations` method and checks the parameters:
@snippet template_extension/old/cpu_kernel.cpp cpu_implementation:init
### `execute`
The InferenceEngine::ILayerExecImpl::execute method accepts and processes the actual tensors as input/output blobs:
@snippet template_extension/old/cpu_kernel.cpp cpu_implementation:execute
## Register Implementation in `Extension` Class
To register custom kernel implementation in the [Extension](Extension.md) class, implement the following methods:
* <a href="#getImpTypes">getImplTypes</a>
* <a href="#getImplementation">getImplementation</a>
### <a name="getImpTypes"><code>getImplTypes</code></a>
InferenceEngine::IExtension::getImplTypes returns a vector of implementation types for an operation.
@snippet template_extension/old/extension.cpp extension:getImplTypes
### <a name="getImplementation"><code>getImplementation</code></a>
InferenceEngine::IExtension::getImplementation returns the kernel implementation with a specified type for an operation.
@snippet template_extension/old/extension.cpp extension:getImplementation
## Load Extension with Executable Kernels to Plugin
Use the `AddExtension` method of the general plugin interface to load your primitives:
@snippet snippets/CPU_Kernel.cpp part0

View File

@@ -1,78 +0,0 @@
# Custom ONNX* Operators {#openvino_docs_IE_DG_Extensibility_DG_Custom_ONNX_Ops}
The ONNX\* importer provides a mechanism to register custom ONNX operators based on predefined or custom nGraph operations.
The function responsible for registering a new operator is called `ngraph::onnx_import::register_operator` and defined in the `onnx_import/onnx_utils.hpp` file.
## Register Custom ONNX Operator Based on Predefined nGraph Operations
The steps below explain how to register a custom ONNX operator, for example, CustomRelu, in a domain called `com.example`.
CustomRelu is defined as follows:
```
x >= 0 => f(x) = x * alpha
x < 0 => f(x) = x * beta
```
where `alpha` and `beta` are float constants.
1. Include headers:
@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:headers
2. Register the CustomRelu operator in the ONNX importer:
@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:register_operator
The `register_operator` function takes four arguments: op_type, opset version, domain, and a function object.
The function object is a user-defined function that takes `ngraph::onnx_import::Node` as an input and based on that, returns a graph with nGraph operations.
The `ngraph::onnx_import::Node` class represents a node in an ONNX model. It provides functions to fetch input node(s) using `get_ng_inputs`, attribute value using `get_attribute_value`, and many more. See the `onnx_import/core/node.hpp` file for the full class declaration.
New operator registration must happen before an ONNX model is read. For example, if an model uses the `CustomRelu` operator, call `register_operator("CustomRelu", ...)` before InferenceEngine::Core::ReadNetwork.
Reregistering ONNX operators within the same process is supported. If you register an existing operator, you get a warning.
The example below demonstrates an exemplary model that requires a previously created `CustomRelu` operator:
```
@include onnx_custom_op/custom_relu_model.prototxt
```
This model is in text format, so before it can be passed to Inference Engine, it has to be converted to binary using:
```py
from google.protobuf import text_format
import onnx
with open("custom_relu_model.prototxt") as in_file:
proto = onnx.ModelProto()
text_format.Parse(in_file.read(), proto, allow_field_number=True)
s = onnx._serialize(proto)
onnx._save_bytes(s, "custom_relu_model.onnx")
```
To create a graph with nGraph operations, visit [Custom nGraph Operations](AddingNGraphOps.md).
For a complete list of predefined nGraph operators, visit [Available Operations Sets](../../ops/opset.md).
If you do not need an operator anymore, unregister it by calling `unregister_operator`. The function takes three arguments: `op_type`, `version`, and `domain`.
@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:unregister_operator
## Register Custom ONNX Operator Based on Custom nGraph Operations
The same principles apply when registering a custom ONNX operator based on custom nGraph operations.
This example shows how to register a custom ONNX operator based on `Operation` presented in [this tutorial](AddingNGraphOps.md), which is used in [TemplateExtension](Extension.md):
@snippet template_extension/old/extension.cpp extension:ctor
Here, the `register_operator` function is called in the constructor of Extension. The constructor makes sure that the function is called before InferenceEngine::Core::ReadNetwork, because InferenceEngine::Core::AddExtension must be called before a model with a custom operator is read.
The example below demonstrates how to unregister an operator from the destructor of Extension:
@snippet template_extension/old/extension.cpp extension:dtor
> **REQUIRED**: It is mandatory to unregister a custom ONNX operator if it is defined in a dynamic shared library.
## Requirements for Building with CMake
A program that uses the `register_operator` functionality requires `openvino::core` and `openvino::frontend::onnx` libraries in addition to the OpenVINO Inference Runtime.
The `ov_onnx_frontend` is a component of the `OpenVINO` package , so `find_package(OpenVINO REQUIRED COMPONENTS ONNX)` can find both.
Those libraries need to be passed to the `target_link_libraries` command in the CMakeLists.txt file.
See CMakeLists.txt below for reference:
@snippet onnx_custom_op/CMakeLists.txt cmake:onnx_custom_op

View File

@@ -1,29 +0,0 @@
# Extension Library {#openvino_docs_IE_DG_Extensibility_DG_Extension}
Inference Engine provides an InferenceEngine::IExtension interface, which defines the interface for Inference Engine Extension libraries.
Inherit all extension libraries from this interface. The example below contains an implementation of two operations: `Template`
used as an example in this document and `FFT` used as a more complex example from the [Custom Operations Guide](../../HOWTO/Custom_Layers_Guide.md).
> **NOTE**: `FFT` operation is implemented using the OpenCV library functions `cv::dft` and `cv::idft`.
Based on that, the declaration of an extension class can look as follows:
@snippet template_extension/old/extension.hpp extension:header
The extension library should use `IE_DEFINE_EXTENSION_CREATE_FUNCTION` macro to export a function, which creates an `Extension` class:
@snippet template_extension/old/extension.cpp extension:CreateExtension
Also, an `Extension` object should implement the following methods:
* InferenceEngine::IExtension::Release deletes an extension object.
* InferenceEngine::IExtension::GetVersion returns information about the version of the library.
@snippet template_extension/old/extension.cpp extension:GetVersion
Implement the InferenceEngine::IExtension::getOpSets method if the extension contains custom layers.
Read [Custom nGraph Operation](AddingNGraphOps.md) for more information.
To integrate execution kernels to the extension library, read [How to Implement Custom CPU Operations](CPU_Kernel.md).
To register a custom ONNX\* operator to the extension library, read [Custom ONNX Operators](Custom_ONNX_Ops.md).

View File

@@ -1,233 +0,0 @@
# How to Implement Custom GPU Operations {#openvino_docs_IE_DG_Extensibility_DG_GPU_Kernel}
To enable operations not supported by OpenVINO™ out of the box, you need a custom extension for Model Optimizer, a custom nGraph operation set, and a custom kernel for the device you will target. This page describes custom kernel support for the GPU device.
The GPU codepath abstracts many details about OpenCL\*. You need to provide the kernel code in OpenCL C and an XML configuration file that connects the kernel and its parameters to the parameters of the operation.
There are two options for using the custom operation configuration file:
* Include a section with your kernels into the global automatically-loaded `cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml` file, which is hosted in the `<INSTALL_DIR>/runtime/bin` folder
* Call the `InferenceEngine::Core::SetConfig()` method from your application with the `InferenceEngine::PluginConfigParams::KEY_CONFIG_FILE` key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
@snippet snippets/GPU_Kernel.cpp part0
All Inference Engine samples, except the trivial `hello_classification`, and most Open Model Zoo demos
feature a dedicated command-line option `-c` to load custom kernels. For example, to load custom operations for the classification sample, run the command below:
```sh
$ ./classification_sample -m <path_to_model>/bvlc_alexnet_fp16.xml -i ./validation_set/daily/227x227/apron.bmp -d GPU
-c <absolute_path_to_config>/custom_layer_example.xml
```
## Configuration File Format <a name="config-file-format"></a>
The configuration file is expected to follow the `.xml` file structure
with a node of the type `CustomLayer` for every custom operation you provide.
The definitions described in the sections below use the following notations:
Notation | Description
---|---
(0/1) | Can have zero or one instance of this node or attribute
(1) | Must have only one instance of this node or attribute
(0+) | Can have any number of instances of this node or attribute
(1+) | Can have one or more instances of this node or attribute
### CustomLayer Node and Sub-Node Structure
`CustomLayer` node contains the entire configuration for a single custom operation.
| Attribute Name |\# | Description |
|-----|-----|-----|
| `name` | (1) | The name of the operation type to be used. This name should be identical to the type used in the IR.|
| `type` | (1) | Must be `SimpleGPU`. |
| `version` | (1) | Must be `1`. |
**Sub-nodes**: `Kernel` (1), `Buffers` (1), `CompilerOptions` (0+),
`WorkSizes` (0/1)
### Kernel Node and Sub-Node Structure
`Kernel` node contains all kernel source code configuration. No kernel
node structure exists.
**Sub-nodes**: `Source` (1+), `Define` (0+)
### Source Node and Sub-Node Structure
`Source` node points to a single OpenCL source file.
| Attribute Name | \# |Description|
|-----|-----|-----|
| `filename` | (1) | Name of the file containing OpenCL source code. Note that the path is relative to your executable. Multiple source nodes will have their sources concatenated in order. |
**Sub-nodes**: None
### Define Node and Sub-Node Structure
`Define` node configures a single `#&zwj;define` instruction to be added to
the sources during compilation (JIT).
| Attribute Name | \# | Description |
|------|-------|------|
| `name` | (1) | The name of the defined JIT. For static constants, this can include the value as well, which is taken as a string. |
| `param` | (0/1) | This parameter value is used as the value of this JIT definition. |
| `type` | (0/1) | The parameter type. Accepted values: `int`, `float`, and `int[]`, `float[]` for arrays. |
| `default` | (0/1) | The default value to be used if the specified parameters are missing from the operation in the IR. |
**Sub-nodes:** None
The resulting JIT has the following form:
`#&zwj;define [name] [type] [value/default]`.
### Buffers Node and Sub-Node Structure
`Buffers` node configures all input/output buffers for the OpenCL entry
function. No buffers node structure exists.
**Sub-nodes:** `Data` (0+), `Tensor` (1+)
### Data Node and Sub-Node Structure
`Data` node configures a single input with static data, for example,
weights or biases.
| Attribute Name | \# | Description |
|----|-----|------|
| `name` | (1) | Name of a blob attached to an operation in the IR |
| `arg-index` | (1) | 0-based index in the entry function arguments to be bound to |
**Sub-nodes**: None
### Tensor Node and Sub-Node Structure
`Tensor` node configures a single input or output tensor.
| Attribute Name | \# | Description |
|------|-------|-------|
| `arg-index` | (1) | 0-based index in the entry function arguments to be bound to. |
| `type` | (1) | `input` or `output` |
| `port-index` | (1) | 0-based index in the operation input/output ports in the IR |
| `format` | (0/1) | Data layout declaration for the tensor. Accepted values: `BFYX`, `BYXF`, `YXFB`, `FYXB`, and same values in all lowercase. Default value: `BFYX` |
### CompilerOptions Node and Sub-Node Structure
`CompilerOptions` node configures the compilation flags for the OpenCL
sources.
| Attribute Name | \# | Description |
|--------|-----|------|
| `options` | (1) | Options string to be passed to the OpenCL compiler |
**Sub-nodes**: None
### WorkSizes Node and Sub-Node Structure
`WorkSizes` node configures the global/local work sizes to be used when
queuing an OpenCL program for execution.
| Attribute Name | \# | Description |
|-----|------|-----|
| `global`<br>`local` | (0/1)<br>(0/1) | An array of up to three integers or formulas for defining OpenCL work-sizes to be used during execution.<br> The formulas can use the values of the B,F,Y,X dimensions and contain the operators: +,-,/,\*,%. All operators are evaluated in integer arithmetic. <br>Default value: `global=”B*F*Y*X” local=””` |
| `dim` | (0/1) | A tensor to take the work-size from. Accepted values: `input N`, `output`, where `N` is an index of input tensor starting with 0. Default value: `output` |
**Sub-nodes**: None
## Example Configuration File
The following code sample provides an example configuration file in XML
format. For information on the configuration file structure, see
[Configuration File Format](#config-file-format).
```xml
<CustomLayer name="ReLU" type="SimpleGPU" version="1">
<Kernel entry="example_relu_kernel">
<Source filename="custom_layer_kernel.cl"/>
<Define name="neg_slope" type="float" param="negative_slope" default="0.0"/>
</Kernel>
<Buffers>
<Tensor arg-index="0" type="input" port-index="0" format="BFYX"/>
<Tensor arg-index="1" type="output" port-index="0" format="BFYX"/>
</Buffers>
<CompilerOptions options="-cl-mad-enable"/>
<WorkSizes global="X,Y,B*F"/>
</CustomLayer>
```
## Built-In Definitions for Custom Layers
The following table includes definitions that are attached before
user sources, where `<TENSOR>` is the actual input and output, for
example, `INPUT0` or `OUTPUT0`.
For an example, see [Example Kernel](#example-kernel).
| Name | Value |
|---|---|
| `NUM_INPUTS` | Number of the input tensors bound to this kernel |
| `GLOBAL_WORKSIZE` | An array of global work sizes used to execute this kernel |
| `GLOBAL_WORKSIZE_SIZE` | The size of the `GLOBAL_WORKSIZE` array |
| `LOCAL_WORKSIZE` | An array of local work sizes used to execute this kernel |
| `LOCAL_WORKSIZE_SIZE` | The size of the `LOCAL_WORKSIZE` array |
| `<TENSOR>_DIMS`| An array of the tensor dimension sizes. Always ordered as `BFYX` |
| `<TENSOR>_DIMS_SIZE`| The size of the `<TENSOR>_DIMS` array.|
| `<TENSOR>_TYPE`| The datatype of the tensor: `float`, `half`, or `char`|
| `<TENSOR>_FORMAT_` | The format of the tensor, BFYX, BYXF, YXFB , FYXB, or ANY. The format is concatenated to the defined name. You can use the tensor format to define codepaths in your code with `#&zwj;ifdef/#&zwj;endif`. |
| `<TENSOR>_LOWER_PADDING` | An array of padding elements used for the tensor dimensions before they start. Always ordered as BFYX.|
| `<TENSOR>_ LOWER_PADDING_SIZE` | The size of the `<TENSOR>_LOWER_PADDING` array |
| `<TENSOR>_UPPER_PADDING` | An array of padding elements used for the tensor dimensions after they end. Always ordered as BFYX. |
| `<TENSOR>_UPPER_PADDING_SIZE` | The size of the `<TENSOR>_UPPER_PADDING` array |
| `<TENSOR>_PITCHES` | The number of elements between adjacent elements in each dimension. Always ordered as BFYX.|
| `<TENSOR>_PITCHES_SIZE`| The size of the `<TENSOR>_PITCHES` array |
| `<TENSOR>_OFFSET`| The number of elements from the start of the tensor to the first valid element, bypassing the lower padding. |
All `<TENSOR>` values are automatically defined for every tensor
bound to this operation, such as `INPUT0`, `INPUT1`, and `OUTPUT0`, as shown
in the following example:
```sh
#define INPUT0_DIMS_SIZE 4
#define INPUT0_DIMS (int []){ 1,96,55,55, }
```
## Example Kernel<a name="example-kernel"></a>
```c
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
__kernel void example_relu_kernel(
const __global INPUT0_TYPE* input0,
__global OUTPUT0_TYPE* output)
{
const uint idx = get_global_id(0);
const uint idy = get_global_id(1);
const uint idbf = get_global_id(2);//batches*features, as OpenCL supports 3D nd-ranges only
const uint feature = idbf%OUTPUT0_DIMS[1];
const uint batch = idbf/OUTPUT0_DIMS[1];
//notice that pitches are in elements, not in bytes!
const uint in_id = batch*INPUT0_PITCHES[0] + feature*INPUT0_PITCHES[1] + idy*INPUT0_PITCHES[2] + idx*INPUT0_PITCHES[3] + INPUT0_OFFSET;
const uint out_id = batch*OUTPUT0_PITCHES[0] + feature*OUTPUT0_PITCHES[1] + idy*OUTPUT0_PITCHES[2] + idx*OUTPUT0_PITCHES[3] + OUTPUT0_OFFSET;
INPUT0_TYPE value = input0[in_id];
//neg_slope (which is non-zero for leaky ReLU) is put automatically as #define, refer to the config xml
output[out_id] = value < 0 ? value * neg_slope : value;
}
```
> **NOTE**: As described in the previous section, all items like
> `INPUT0_TYPE` are actually defined as OpenCL (pre-)compiler inputs by
> the Inference Engine for efficiency reasons. See [Debugging
> Tips](#debugging-tips) for information on debugging the results.
> **NOTE**: Several GPU-targeted kernels are also added to the binaries upon compilation of samples
> so that the sample application can easy load them.
> Refer to the `cldnn_global_custom_kernels` folder in the GPU plugin installation directory.
## Debugging Tips<a name="debugging-tips"></a>
* **Using `printf` in the OpenCL™ Kernels**.
To debug the specific values, you can use `printf` in your kernels.
However, be careful not to output excessively, which
could generate too much data. The `printf` output is typical, so
your output can be truncated to fit the buffer. Also, because of
buffering, you actually get an entire buffer of output when the
execution ends.<br>
For more information, refer to the [printf
Function](https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/printfFunction.html).

View File

@@ -1,60 +0,0 @@
# Inference Engine Extensibility Mechanism {#openvino_docs_IE_DG_Extensibility_DG_Intro}
@sphinxdirective
.. toctree::
:maxdepth: 1
:hidden:
openvino_docs_IE_DG_Extensibility_DG_AddingNGraphOps
openvino_docs_IE_DG_Extensibility_DG_Custom_ONNX_Ops
CPU Kernels Extensibility <openvino_docs_IE_DG_Extensibility_DG_CPU_Kernel>
GPU Kernels Extensibility <openvino_docs_IE_DG_Extensibility_DG_GPU_Kernel>
VPU Kernels Extensibility <openvino_docs_IE_DG_Extensibility_DG_VPU_Kernel>
openvino_docs_IE_DG_Extensibility_DG_Extension
openvino_docs_IE_DG_Extensibility_DG_Building
@endsphinxdirective
If your model contains operations not normally supported by OpenVINO, the Inference Engine Extensibility API lets you add support for those custom operations in a library containing custom nGraph operation sets, corresponding extensions to the Model Optimizer, and a device plugin extension. See the overview in the [Custom Operations Guide](../../HOWTO/Custom_Layers_Guide.md) to learn how these work together.
To load the Extensibility library to the `InferenceEngine::Core` object, use the `InferenceEngine::Core::AddExtension` method.
## Inference Engine Extension Library
An Inference Engine Extension dynamic library contains the following components:
* [Extension Library](Extension.md):
- Contains custom operation sets
- Provides CPU implementations for custom operations
* [Custom nGraph Operation](AddingNGraphOps.md):
- Enables the use of `InferenceEngine::Core::ReadNetwork` to read Intermediate Representation (IR) with unsupported
operations
- Enables the creation of `ngraph::Function` with unsupported operations
- Provides a shape inference mechanism for custom operations
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension), which demonstrates extension development details. You can review the complete code, which is fully compilable and up-to-date, to see how it works.
## Execution Kernels
The Inference Engine workflow involves the creation of custom kernels and either custom or existing operations.
An _operation_ is a network building block implemented in the training framework, for example, `Convolution` in Caffe*.
A _kernel_ is defined as the corresponding implementation in the Inference Engine.
Refer to the [Model Optimizer Extensibility](../../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md)
for details on how a mapping between framework operations and Inference Engine kernels is registered.
In short, you can plug your own kernel implementations into the Inference Engine and map them to the operations in the original framework.
The following pages describe how to integrate custom _kernels_ into the Inference Engine:
* [Introduction to development of custom CPU kernels](CPU_Kernel.md)
* [Introduction to development of custom GPU kernels](GPU_Kernel.md)
* [Introduction to development of custom VPU kernels](VPU_Kernel.md)
## See Also
* [Build an extension library using CMake*](Building.md)
* [Using Inference Engine Samples](../Samples_Overview.md)
* [Hello Shape Infer SSD sample](../../../samples/cpp/hello_reshape_ssd/README.md)

View File

@@ -1,682 +0,0 @@
# How to Implement Custom Layers for VPU (Intel® Neural Compute Stick 2) {#openvino_docs_IE_DG_Extensibility_DG_VPU_Kernel}
To enable operations not supported by OpenVINO™ out of the box, you need a custom extension for Model Optimizer, a custom nGraph operation set, and a custom kernel for the device you will target. This page describes custom kernel support for one the VPU, the Intel® Neural Compute Stick 2 device, which uses the MYRIAD device plugin.
> **NOTES:**
> * OpenCL\* custom layer support is available in the preview mode.
> * This section assumes you are familiar with developing kernels using OpenCL.
To customize your topology with an OpenCL layer, carry out the tasks described on this page:
1. Write and compile your OpenCL code with the standalone offline OpenCL compiler (`clc`).
2. Write a configuration file to bind the OpenCL kernel to the topology file (`.xml`) of the model IR.
3. Pass the configuration file to the Inference Engine with the model IR.
## Compile OpenCL code for VPU (Intel® Neural Compute Stick 2)
> **NOTE**: OpenCL compiler, targeting Intel® Neural Compute Stick 2 for the SHAVE* processor only, is redistributed with OpenVINO.
OpenCL support is provided by ComputeAorta* and is distributed under a license agreement between Intel® and Codeplay* Software Ltd.
The OpenCL toolchain for the Intel® Neural Compute Stick 2 supports offline compilation only, so first compile OpenCL C code using the standalone `clc` compiler. You can find the compiler binary at `<INSTALL_DIR>/tools/cl_compiler`.
> **NOTE**: By design, custom OpenCL layers support any OpenCL kernels written assuming OpenCL version 1.2. It also supports half float extension and is optimized for this type, because it is a native type for Intel® Movidius™ VPUs.
1. Prior to running a compilation, make sure that the following variables are set:
* `SHAVE_MA2X8XLIBS_DIR=<INSTALL_DIR>/tools/cl_compiler/lib/`
* `SHAVE_LDSCRIPT_DIR=<INSTALL_DIR>/tools/cl_compiler/ldscripts/`
* `SHAVE_MYRIAD_LD_DIR=<INSTALL_DIR>/tools/cl_compiler/bin/`
* `SHAVE_MOVIASM_DIR=<INSTALL_DIR>/tools/cl_compiler/bin/`
2. Run the compilation with the command below. You should use `--strip-binary-header` to make an OpenCL runtime-agnostic binary runnable with the Inference Engine.
```bash
cd <INSTALL_DIR>/tools/cl_compiler/bin
./clc --strip-binary-header custom_layer.cl -o custom_layer.bin
```
## Write a Configuration File
To tie the topology IR for a layer you customize, prepare a configuration file, so that the Inference Engine can find parameters for your kernel and the execution work grid is described.
For example, consider the following OpenCL kernel signature:
```cpp
__kernel void reorg_nhwc(__global const half *src, __global half *out, int w, int h, int c, int stride);
```
A configuration file for this kernel might be the following:
```xml
<CustomLayer name="ReorgYolo" type="MVCL" version="1">
<Kernel entry="reorg_nhwc">
<Source filename="reorg.bin"/>
</Kernel>
<Parameters>
<Tensor arg-name="src" type="input" port-index="0" format="BYXF"/>
<Tensor arg-name="out" type="output" port-index="0" format="BYXF"/>
<Scalar arg-name="w" type="int" port-index="0" source="I.X" />
<Scalar arg-name="h" type="int" port-index="0" source="I.Y" />
<Scalar arg-name="c" type="int" port-index="0" source="I.F" />
<Scalar arg-name="stride" type="int" source="stride" />
</Parameters>
<WorkSizes dim="input,0" global="(Y+7)/8*8,1,1" local="8,1,1"/>
</CustomLayer>
```
Each custom layer is described with the `CustomLayer` node. It has the following nodes and attributes:
- Root node `CustomLayer` contains the following attributes:
- `name` (Required) The name of the Inference Engine layer to bind the kernel with.
- `type` and `version` (Required) Reserved for future use. Set them to `MVCL` and `1` respectively.
- `max-shaves` (Optional) The maximum number of SHAVE cores that should be dedicated for the layer. It is useful for debugging concurrency issues or for resource saving that memory bound kernel does not scale well with the number of cores, so more resources can be left for the rest of a topology.
- Sub-node `Kernel` must contain the following attributes:
- `entry` The name of your kernel function as you defined it in a source file. In the example above, it is `reorg_nhwc`.
- Node `Source` must contain the following attributes:
- `filename` The path to a compiled binary relative to the XML configuration file.
- Sub-node `Parameters` Describes parameters bindings. For more information, see the description below.
- Sub-node `WorkSizes` Describes local and global work group sizes and the source for dimension deduction as a pair `direction,port`. In the example above, the work group is described relatively to the dimension of the input tensor that comes through port 0 in the IR. `global` and `local` work group configurations support any simple math expressions with +,-,\*,/, and () from `B`(batch), `Y`(height), `X`(width) and `F`(channels).
- Sub-node `Where` Allows to customize bindings with the `key="value"` attribute. For example, to substitute only 3x3 convolutions, write `<Where kernel="3,3"/>` in the binding xml.
Parameter description supports `Tensor` of one of tensor types such as `input`, `output`, `input_buffer`, `output_buffer` or `data`, `Scalar`, or `Data` nodes and has the following format:
- Each `Tensor` node of `input` or `output` type must contain the following attributes:
- `arg-name` The name of a kernel parameter in the kernel signature.
- `type` Node type: `input` or `output` as specified in the IR.
- `port-index` A number of input/output ports as specified in the IR.
- `format` The channel order in the tensor. Optional conversion layers are generated if the custom layer format is not compatible with formats of neighboring layers. `BFXY`, `BYXF`, and `ANY` formats are supported currently.
- Each `Tensor` node of `input_buffer` or `output_buffer` type must contain the following attributes:
- `arg-name` The name of a kernel parameter in the kernel signature.
- `type` Node type: `input_buffer` or `output_buffer`. Use the appropriate type to bind multiple kernels that correspond to different stages of the same layer.
- `port-index` The unique identifier to bind by.
- `dim` The dim source with the same `direction,port` format used for `WorkSizes` bindings.
- `size` Amount of bytes needed. Current expression syntax supports only expression over dimensions of over selected input/output tensor or constants and might be expended in the future.
Here is an example of multi-stage MVN layer binding:
```xml
<CustomLayer name="MVN" stage="0" type="MVCL" version="1">
<Kernel entry="reduction_mean">
<Source filename="mvn.bin"/>
</Kernel>
<Parameters>
<Tensor arg-name="src" type="input" port-index="0" format="BFYX"/>
<Tensor arg-name="mean" type="output_buffer" port-index="0" dim="output,0" size="Y*F*4"/>
<Tensor arg-name="variance" type="output_buffer" port-index="1" dim="output,0" size="Y*F*4"/>
<!--other parameters -->
</Parameters>
<WorkSizes dim="output,0" global="((Y+7)/8)*8,F,1" local="8,1,1"/>
</CustomLayer>
<CustomLayer name="MVN" stage="1" type="MVCL" version="1">
<Kernel entry="mvn_scale">
<Source filename="mvn_scale_changed_orded.bin"/>
</Kernel>
<Parameters>
<Tensor arg-name="src_data" type="input" port-index="0" format="BFYX"/>
<Tensor arg-name="dst_data" type="output" port-index="0" format="BFYX"/>
<Tensor arg-name="mean_part" type="input_buffer" port-index="0" dim="output,0" size="Y*F*4"/>
<Tensor arg-name="power_mean" type="input_buffer" port-index="1" dim="output,0" size="Y*F*4"/>
<!--other parameters -->
</Parameters>
<WorkSizes dim="output,0" global="((Y+7)/8)*8,F,1" local="8,1,1"/>
</CustomLayer>
```
- Each `Tensor` node that has the type `data` must contain the following attributes:
- `source` A name of the blob as it is in the IR. Typical example is `weights` for convolution.
- `format` Specifies the channel order in the tensor. Optional conversion layers are generated if the custom layer format is not.
```xml
<CustomLayer name="BinaryConvolution" type="MVCL" version="1">
<Kernel entry="binary_convolution">
<Source filename="binary_layers.bin"/>
</Kernel>
<Parameters>
<Tensor arg-name="src_data" type="input" port-index="0" format="BFYX"/>
<Data arg-name="weights_data" type="data" source="weights" format="ANY"/>
<Tensor arg-name="dst_data" type="output" port-index="0" format="BFYX"/>
<!--other parameters -->
</Parameters>
<WorkSizes dim="output,0" global="X,Y,F" local="1,1,1"/>
</CustomLayer>
```
- Each `Scalar` node must contain the following attributes:
- `arg-name` The name of a kernel parameter in the kernel signature.
- `type` `int` or `float` value. It is used for correct argument extraction from IR parameters.
- `source` Contains the name of the parameter in the IR file or input/output (`I`/`O`, `In`/`On`, where `n` is a port number)
followed by dimension `B`(batch), `Y`(height), `X`(width), or `F`(channels).
- Each `Data` node must contain the following attributes:
- `arg-name` The name of a kernel parameter in the kernel signature.
- `type` Node type. Currently, `local_data` is the only supported value, which defines buffer allocated in fast local on-chip memory. It is limited to 100KB for all `__local` and
`__private` arrays defined inside the kernel as well as all `__local` parameters passed to the kernel. Note that a manual-DMA extension requires double buffering.
If the custom layer is detected to run out of local memory, the inference fails.
- `dim` The dim source with the same `direction,port` format used for `WorkSizes` bindings.
- `size` Amount of bytes needed. The current expression syntax supports only expression over dimensions of over selected input/output tensor or constants and may be extended in the future.
The example binding below illustrates a kernel with two local buffers passed to the kernel.
```xml
<CustomLayer name="GRN" type="MVCL" version="1">
<Kernel entry="grn_NCHW">
<Source filename="grn.bin"/>
</Kernel>
<Parameters>
<Tensor arg-name="src_data" type="input" port-index="0" format="BFYX"/>
<Tensor arg-name="dst_data" type="output" port-index="0" format="BFYX"/>
<Data arg-name="src" type="local_data" dim="input,0" size="X*F*2" />
<Data arg-name="dst" type="local_data" dim="input,0" size="X*F*2" />
<Scalar arg-name="C" type="int" port-index="0" source="I.F" />
<Scalar arg-name="bias" type="float" source="bias" />
</Parameters>
<WorkSizes dim="input,0" global="X,Y,1" local="X,1,1"/>
</CustomLayer>
```
## Pass Configuration File to Inference Runtime
> **NOTE**: If both native and custom layer implementations are present, the custom kernel has a priority over the native one.
Before loading the network that features the custom layers, provide a separate configuration file and load it using the InferenceEngine::Core::SetConfig() method with the PluginConfigParams::KEY_CONFIG_FILE key and the configuration file name as a value:
```cpp
InferenceEngine::Core core;
// Load custom layers
core.SetConfig({ { InferenceEngine::PluginConfigParams::KEY_CONFIG_FILE, "<path to the xml file>" } }, "MYRIAD");
```
Optionally, set a path to a custom layers description with a pair of `VPU_CUSTOM_LAYERS` and `/path/to/your/customLayers.xml`
as a network configuration:
```cpp
InferenceEngine::Core core;
std::map<std::string, std::string> networkConfig;
config["VPU_CUSTOM_LAYERS"] = "/path/to/your/customLayers.xml";
// Load custom layers in network config
auto exeNetwork = core.LoadNetwork(cnnNetwork, "MYRIAD", networkConfig);
```
## Optimizing Kernels with OpenCL for VPU (Intel® Neural Compute Stick 2)
This section provides optimization guidelines on writing custom layers with OpenCL for VPU devices. Knowledge about general OpenCL
programming model and OpenCL kernel language is assumed and not a subject of this section. The OpenCL model mapping to VPU is described in the table below.
| OpenCL Model | VPU Mapping|
|-----|----|
| Device code | Executed on SHAVE cores |
| Private memory | Mapped to CMX internal memory, limited to 100KB per work group, valid only while the work group is executed |
| Local memory | Mapped to CMX internal memory, limited to 100KB per work group, valid only while the work group is executed |
| Global memory | Mapped to DDR, used to pass execution preserved parameters for inputs, outputs, and blobs |
| Work group | Executed on a single SHAVE core iterating over multiple work items |
Note that by the OpenCL specification, the work group execution order is not specified. This means that it is your
responsibility to ensure that race conditions among work groups are not introduced. Custom layer runtime spits evenly
work grid among available compute resources and executes them in an arbitrary order. This static scheduling approach works best if the load is evenly spread out across work groups, which is a typical case for Deep Learning kernels. The following guidelines are recommended to use for work group partitioning:
1. Split work evenly across work groups.
2. Adjust work group granularity to maintain equal workload for all compute codes.
3. Set the maximum number of cores using the `max-shaves` attribute for the `CustomLayer` node. This keeps more resources for the rest of topology. It is also useful if the kernel scalability reached its limits, which may happen while optimizing memory bound kernels or kernels with poor parallelization.
4. Try an alternate data layout (`BFXY`/`BYXF`) for the kernel if it improves work group partitioning or data access patterns.
Consider not just specific layer boost, but full topology performance because data conversion layers would be automatically inserted
as appropriate.
Offline OpenCL compiler (`clc`) features automatic vectorization over `get_global_id(0)` usage, if uniform access is detected.
For example, the kernel below could be automatically vectorized:
```cpp
__kernel void cvtf32f16(__global float* restrict inImage, __global half* restrict outImage,
float scale, float bais)
{
int idx = get_global_id(0) + get_global_id(1) * get_global_size(0) + get_global_id(2) * get_global_size(0) * get_global_size(1);
outImage[idx] = convert_half(inImage[idx]*scale+bais);
}
```
However, this work-group based vectorizer (WGV) conflicts with the default LLVM vectorizer based on superword level parallelism
(SLP) for the current compiler version. Manual vectorization is recommended to provide the best performance for non-uniform code
patterns. WGV works if and only if vector types are not used in the code.
Here is a short list of optimization tips:
1. Help auto-vectorizer ensure non-aliasing pointers for kernel parameters by putting `restrict` where possible.
- This can give a performance boost, especially for kernels with unrolling, like `ocl_grn` from the example below.
- Place `restrict` markers for kernels with manually vectorized codes. In the `ocl_grn` kernel below, the unrolled version without `restrict` is up to 20% slower than the most optimal one, which combines unrolling and `restrict`.
2. Put `#&zwj;pragma unroll N` to your loop header. The compiler does not trigger unrolling by default, so it is your responsibility to
annotate the code with pragmas as appropriate. The `ocl_grn` version with `#&zwj;pragma unroll 4` is up to 50% faster, most of which comes from unrolling the first loop, because LLVM, in general, is better in scheduling 3-stage loops (load-compute-store), while the fist loop
`variance += (float)(src_data[c*H*W + y*W + x] * src_data[c*H*W + y*W + x]);` is only 2-stage (load-compute). Pay
attention to unrolling such cases first. Unrolling factor is loop-dependent. Choose the smallest number that
still improves performance as an optimum between the kernel size and execution speed. For this specific kernel, changing the unroll factor from `4` to `6` results in the same performance, so unrolling factor equal to 4 is an optimum. For Intel® Neural Compute Stick 2, unrolling is conjugated with the automatic software pipelining for load, store, and compute stages:
```cpp
__kernel void ocl_grn(__global const half* restrict src_data, __global half* restrict dst_data, int C, float bias)
{
int x = get_global_id(0);
int W = get_global_size(0);
int y = get_global_id(1);
int H = get_global_size(1);
float variance = bias + 1e-9f;
#pragma unroll 4
for (int c = 0; c < C; c++)
variance += (float)(src_data[c*H*W + y*W + x] * src_data[c*H*W + y*W + x]);
variance = 1.f / native_sqrt(variance);
#pragma unroll 4
for (int c = 0; c < C; c++)
dst_data[c*H*W + y*W + x] = (half)((float)src_data[c*H*W + y*W + x] * variance);
}
```
To check the efficiency of WGV, you can compare performance of the kernel above with the kernel below, which is manually vectorized over width:
```cpp
__kernel void ocl_grn_line(__global const half* restrict src_data, __global half* restrict dst_data, int C, int W, float bias)
{
int y = get_global_id(1);
int H = get_global_size(1);
for (int x = 0; x < W/8; x++)
{
float8 variance = (float8)(bias+1e-9f);
#pragma unroll 4
for (int c = 0; c < C; c++)
{
__global const half8* restrict src_line = ((__global const half8 * restrict)(src_data + c*H*W + y*W));
half8 sh = src_line[x];
variance += convert_float8(sh*sh);
}
variance = 1.f/native_sqrt(variance);
#pragma unroll 4
for (int c = 0; c < C; c++)
{
__global const half8* restrict src_line = ((__global const half8 * restrict)(src_data + c*H*W + y*W));
__global half8* restrict dst_line = ((__global half8 * restrict)(dst_data + c*H*W + y*W));
dst_line[x] = convert_half8(convert_float8(src_line[x])*variance);
}
}
for (int x = W/8*8; x < W; x++)
{
float variance = bias+1e-9f;
#pragma unroll 4
for (int c = 0; c < C; c++)
variance += (float)(src_data[c*H*W + y*W + x]*src_data[c*H*W + y*W + x]);
variance = 1.f/native_sqrt(variance);
#pragma unroll 4
for (int c = 0; c < C; c++)
dst_data[c*H*W + y*W + x] = (float)src_data[c*H*W + y*W + x]*variance;
}
}
```
Both versions perform the same, but the second one has more complex code.
3. If it is easy to predict the work group size, you can also use the `reqd_work_group_size` kernel attribute to ask the compiler
to unroll the code up to the local size of the work group. Note that if the kernel is actually executed with the
different work group configuration, the result is undefined.
4. Prefer to use the `half` compute if it keeps reasonable accuracy. 16-bit float is a native type for Intel® Neural Compute Stick 2, most of the functions `half_*` are mapped to a single hardware instruction.
Use the standard `native_*` function for the rest of types.
5. Prefer to use the `convert_half` function over `vstore_half` if conversion to 32-bit float is required. `convert_half` is mapped to a single hardware instruction. For the `cvtf32f16` kernel above, the line `outImage[idx] = convert_half(inImage[idx]*scale+bais);` is eight times slower than the code with `vstore_half`.
6. Mind early exits. Early exit can be extremely costly for the current version of the `clc` compiler due to conflicts with the
auto-vectorizer. The generic advice would be to setup local size by `x` dimension equal to inputs or/and outputs width.
If it is impossible to define the work grid that exactly matches inputs or/and outputs to eliminate checks, for example,
`if (get_global_id(0) >= width) return`, use line-wise kernel variant with manual vectorization.
The kernel example below demonstrates the impact of early exits on kernel performance.
```cpp
// Initial version
__kernel void reorg(const __global half* restrict src, __global half* restrict out, int stride)
{
int w = get_global_id(0);
int W = get_global_size(0);
int h = get_global_id(1);
int H = get_global_size(1);
int c = get_global_id(2);
int C = get_global_size(2);
int C2 = C/(stride*stride);
int offset = c / C2;
int c2 = c - C2 * offset;
int H2 = H*stride;
int W2 = W*stride;
int h2 = h*stride + offset / stride;
int w2 = w*stride + offset - stride * (offset / stride);
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
}
```
This `reorg` kernel is auto-vectorizable, but an input for YOLO v2 topology is `NCHW=<1,64,26,26>` and it is not multiple of vector width, which is `8` for `half` data type. As a result, the Inference Engine does not select the auto-vectorized kernel.
To compare performance of auto-vectorized and scalar version of the kernel, change the input size to`NCHW=<1,64,26,32>`. This enables the auto-vectorized version to be selected by the Inference Engine and can give you about 30% uplift.
Since the auto-vectorized version is faster, it makes sense to enable it for the YOLO v2 topology input size by setting the local size multiple of vector, for example, 32, and adjust global sizes accordingly. As a result, the execution work grid exceeds actual input dimension, so out-of-bound checks should be inserted. See the updated kernel version below:
```cpp
// Version with out-of-bound checks added
__kernel void reorg(const __global half* restrict src, __global half* restrict out, int W, int stride)
{
int w = get_global_id(0);
w = min(w, W-1);
int h = get_global_id(1);
int H = get_global_size(1);
int c = get_global_id(2);
int C = get_global_size(2);
int C2 = C/(stride*stride);
int offset = c / C2;
int c2 = c - C2 * offset;
int H2 = H*stride;
int W2 = W*stride;
int h2 = h*stride + offset / stride;
int w2 = w*stride + offset - stride * (offset / stride);
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
}
```
This code performs the same as the initial kernel above (scalar) due to branching overhead. If you replace min/max expression `w = min(w, W-1);` with `if (w >= W) return;`, runtime increases up to 2x against to code without branching (initial version).<br>
If branching is inevitable for your element-based kernel, it is recommended to change the scheme to line-based. See the kernel variant below:
```cpp
// Line-wise version
__kernel void reorg(const __global half* restrict src, __global half* restrict out, int H, int W, int stride)
{
int h = min((int)get_global_id(0), H-1);
int c = get_global_id(1);
int C = get_global_size(1);
int C2 = C/(stride*stride);
int offset = c / C2;
int c2 = c - C2 * offset;
int H2 = H*stride;
int W2 = W*stride;
for (int w = 0; w < W; ++w)
{
int h2 = h*stride + offset / stride;
int w2 = w*stride + offset - stride * (offset / stride);
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
}
}
```
This decreases the execution time up to 40% against the best performing vectorized kernel without early exits (initial version).
7. Reuse computations among work items by using line-based kernels or sharing values though `__local` memory.
8. Improve data access locality. Most of custom kernels are memory bound while convolution and fully connected layers are hardware-implemented. The code below demonstrates a further optimized version of the `reorg` kernel unrolled by `stride`:
```cpp
// Unrolled line-wise version
__kernel void reorg_unrolled_by_stride(const __global half* restrict src, __global half* restrict dst,
int H, int W, int stride)
{
int h = min((int)get_global_id(0), H-1);
int c2 = get_global_id(1);
int C2 = get_global_size(1);
int C = C2*stride*stride;
int H2 = H*stride;
int W2 = W*stride;
for (int stride_y = 0; stride_y < stride; stride_y++)
for (int stride_x = 0; stride_x < stride; stride_x++)
for (int w2 = 0, w = 0; w < W; w2 += stride, w++)
dst[W*H*C2*(stride_y*stride+stride_x) + W*H*c2 + W*h + w] = src[W2*H2*c2 + W2*h*stride + W2*stride_y + w2 + stride_x];
}
```
`scr` data in this case loaded only once. As the result, the cycle count drops up to 45% against the line-wise version.
9. Copy data from `__dlobal` to `__local` or `__private` memory if the data is accessed more than once. Access to
`__dlobal` memory is orders of magnitude slower than access to `__local`/`__private` due to statically scheduled pipeline, which
stalls completely on memory access without any prefetch. The same recommendation is applicable for scalar load/store
from/to a `__blobal` pointer since work-group copying could be done in a vector fashion.
10. Use a manual DMA extension. Local (on-chip) memory throughput is up to 24x higher than DDR throughput. Starting from OpenVINO™ 2020.1, VPU OpenCL features manual-DMA kernel extension to copy sub-tensor used by work group into local memory and performing compute without DDR evolved. Here is the simple GRN kernel implementation that runs over DDR. Local size is in the form (width of the input tensor, 1, 1) to define a large enough work group to get code automatically vectorized and unrolled, while global size is (width of the input tensor, height of the input tensor, 1):
```cpp
__kernel void grn_NCHW(
__global const half* restrict src_data,
__global half* restrict dst_data,
int C,
float bias)
{
float variance = bias + 1e-9f;
#pragma unroll 4
for (int c = 0; c < C; c++)
{
float val = (float) src_data[c*get_global_size(1)*get_global_size(0) + get_global_id(1)*get_global_size(0) + get_global_id(0)];
variance += val*val;
}
half hvariance = (half)(native_rsqrt((half)(variance/16.f))*0.25f);
#pragma unroll 4
for (int c = 0; c < C; c++)
{
dst_data[c*get_global_size(1)*get_global_size(0) + get_global_id(1)*get_global_size(0) + get_global_id(0)]
= src_data[c*get_global_size(1)*get_global_size(0) + get_global_id(1)*get_global_size(0) + get_global_id(0)] * hvariance;
}
}
```
This kernel can be rewritten to introduce special data binding `__dma_preload` and `__dma_postwrite intrinsics`. This means that instead of one kernel, a group of three kernels should be implemented: `kernelName`, `__dma_preload_kernelName`, and `__dma_postwrite_kernelName`. `__dma_preload_kernelName` for a particular work group `n` is guaranteed to be executed before the `n`-th work group itself, while `__dma_postwrite_kernelName` is guaranteed to be executed after a corresponding work group. You can define one of those functions that are intended to be used to copy data from-to `__global` and `__local` memory. The syntactics requires exact functional signature match. The example below illustrates how to prepare your kernel for manual-DMA.
```cpp
__kernel void __dma_preload_grn_NCHW(
__global const half* restrict src,
__global half* restrict dst,
__local half* restrict local_src,
__local half* restrict local_dst,
int C,
float bias)
{
// ToDO: copy required piece of src tensor into local_src
}
__kernel void __dma_postwrite_grn_NCHW(
__global const half* restrict src,
__global half* restrict dst,
__local const half* restrict local_src,
__local half* restrict local_dst,
int C,
float bias)
{
// ToDO: copy back computed piece of local_dst into dst
}
__kernel void grn_NCHW(
__global const half* restrict src_data,
__global half* restrict dst_data,
__local half* restrict src,
__local half* restrict dst,
int C,
float bias)
{
// same as the example above
}
```
The GRN kernel operates on channel-major tensors to compute average over full channel range and then normalizes input elements to produce the output.
As a part of the manual DMA extension, a group of work group copy functions are introduced in addition to `async_work_group_copy`, which is also mapped to a DMA call.
Here is the list of supported functions:
```cpp
// 2D sub-tensor copy
event_t WorkGroupDmaCreateStrideTransaction(
const local T *src,
global T *dst,
size_t src_width, // width of the line of source in bytes
size_t dst_width, // width of the line of destination in bytes
size_t src_stride, // stride between corresponding 2 consecutive lines of source in bytes
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
size_t size, // total number of bytes loaded for all lines from source to destination
event_t event) __OVERLOAD;
event_t WorkGroupDmaCreateStrideTransaction(
const global T *src,
local T *dst,
size_t src_width, // width of the line of source in bytes
size_t dst_width, // width of the line of destination in bytes
size_t src_stride, // stride between corresponding 2 consecutive lines of source in bytes
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
size_t size, // total number of bytes loaded for all lines from source to destination
event_t event) __OVERLOAD;
// 3D sub-tensor copy
event_t WorkGroupDmaCreate3DTransaction(
const local T *src,
global T *dst,
size_t src_width, // width of the line of source in bytes
size_t dst_width, // width of the line of destination in bytes
size_t src_stride, // stride between corresponding 2 consecutive lines of source in bytes
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
size_t num_planes, // number of planes to be copied
size_t src_plane_stride, // stride between corresponding 2 consecutive planes of source in bytes
size_t dst_plane_stride, // stride between corresponding 2 consecutive planes of destination in bytes
size_t size, // size of the loaded plane in bytes, analogues to the size in 2D case
event_t event) __OVERLOAD;
event_t WorkGroupDmaCreate3DTransaction(
const global T *src,
local T *dst,
size_t src_width, // width of the line of source in bytes
size_t dst_width, // width of the line of destination in bytes
size_t src_stride, // stride between corresponding 2 consecutive lines of source in bytes
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
size_t num_planes, // number of planes to be copied
size_t src_plane_stride, // stride between corresponding 2 consecutive planes of source in bytes
size_t dst_plane_stride, // stride between corresponding 2 consecutive planes of destination in bytes
size_t size, // size of the loaded plane in bytes, analogues to the size in 2D case
event_t event) __OVERLOAD;
```
where `T` can be `uchar`, `char`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `half` or `float`.
Modified version of the GRN kernel could be the following:
```cpp
__kernel void __dma_preload_grn_NCHW(
__global const half* restrict src,
__global half* restrict dst,
__local half* restrict local_src,
__local half* restrict local_dst,
int C,
float bias)
{
WorkGroupDmaCreate3DTransaction(
src + get_group_id(0)*get_local_size(0)
+ get_group_id(1)*get_local_size(1)*get_global_size(0), // src
local_src, // dst
get_local_size(0) * sizeof(half), // src width
get_local_size(0) * sizeof(half), // dst width
get_global_size(0) * sizeof(half), // src stride
get_local_size(0) * sizeof(half), // dst stride
C, // num planes
get_global_size(0) * get_global_size(1) * sizeof(half), // src plane stride
get_local_size(0) * get_local_size(1) * sizeof(half), // dst plane stride
get_local_size(0) * get_local_size(1) * sizeof(half), // plane size
0);
}
__kernel void __dma_postwrite_grn_NCHW(
__global const half* restrict src,
__global half* restrict dst,
__local const half* restrict local_src,
__local half* restrict local_dst,
int C,
float bias)
{
WorkGroupDmaCreate3DTransaction(
local_dst, // src
dst + get_group_id(0)*get_local_size(0)
+ get_group_id(1)*get_local_size(1)*get_global_size(0), // dst
get_local_size(0) * sizeof(half), // src width
get_local_size(0) * sizeof(half), // dst width
get_local_size(0) * sizeof(half), // src stride
get_global_size(0) * sizeof(half), // dst stride
C, // num planes
get_local_size(0) * get_local_size(1) * sizeof(half), // src plane stride
get_global_size(0) * get_global_size(1) * sizeof(half), // dst plane stride
get_local_size(0) * get_local_size(1) * sizeof(half), // plane size
0);
}
__kernel void grn_NCHW(
__global const half* restrict src_data,
__global half* restrict dst_data,
__local half* restrict src,
__local half* restrict dst,
int C,
float bias)
{
float variance = bias + 1e-9f;
#pragma unroll 8
for (int c = 0; c < C; c++)
{
float val = (float) src[c*get_local_size(1)*get_local_size(0) + get_local_id(1)*get_local_size(0) + get_local_id(0)];
variance += val*val;
}
half hvariance = (half)(native_rsqrt((half)(variance/16.f))*0.25f);
#pragma unroll 8
for (int c = 0; c < C; c++)
{
dst[c*get_local_size(1)*get_local_size(0) + get_local_id(1)*get_local_size(0) + get_local_id(0)]
= src[c*get_local_size(1)*get_local_size(0) + get_local_id(1)*get_local_size(0) + get_local_id(0)] * hvariance;
}
}
```
Note the `get_local_size` and `get_local_id` usage inside the kernel. 21x speedup is expected for a kernel on enet-curbs setup because it was completely limited by memory usage.
An alternative method to using DMA is to use work item copy extension. Those functions are executed inside a kernel and requires work groups equal to single work item.
Here is the list of supported work item functions:
```cpp
item_dma_event_t WorkItemDmaCreateTransaction(
const global T *src,
private T *dst,
size_t size,
item_dma_event_t event) __OVERLOAD;
item_dma_event_t WorkItemDmaCreateTransaction(
const private T *src,
global T *dst,
size_t size,
item_dma_event_t event) __OVERLOAD;
item_dma_event_t WorkItemDmaCreateStrideTransaction(
const global T *src,
private T *dst,
size_t src_width,
size_t dst_width,
size_t src_stride,
size_t dst_stride,
size_t size,
item_dma_event_t event) __OVERLOAD;
item_dma_event_t WorkItemDmaCreateStrideTransaction(
const private T *src,
global T *dst,
size_t src_width,
size_t dst_width,
size_t src_stride,
size_t dst_stride,
size_t size,
item_dma_event_t event) __OVERLOAD;
item_dma_event_t WorkItemDmaCreate3DTransaction(
const global T *src,
private T *dst,
size_t src_width,
size_t dst_width,
size_t src_stride,
size_t dst_stride,
size_t num_planes,
size_t src_plane_stride,
size_t dst_plane_stride,
size_t size,
item_dma_event_t event) __OVERLOAD;
item_dma_event_t WorkItemDmaCreate3DTransaction(
const private T *src,
global T *dst,
size_t src_width,
size_t dst_width,
size_t src_stride,
size_t dst_stride,
size_t num_planes,
size_t src_plane_stride,
size_t dst_plane_stride,
size_t size,
item_dma_event_t event) __OVERLOAD;
```
where `T` can be `uchar`, `char`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `half` or `float`.

View File

@@ -1,85 +0,0 @@
# Glossary {#openvino_docs_IE_DG_Glossary}
## Acronyms and Abbreviations
| Abbreviation | Description |
| :--- | :--- |
| API | Application Programming Interface |
| AVX | Advanced Vector Extensions |
| clDNN | Compute Library for Deep Neural Networks |
| CLI | Command Line Interface |
| CNN | Convolutional Neural Network |
| CPU | Central Processing Unit |
| CV | Computer Vision |
| DL | Deep Learning |
| DLDT | Intel(R) Deep Learning Deployment Toolkit |
| DLL | Dynamic Link Library |
| DNN | Deep Neural Networks |
| ELU | Exponential Linear rectification Unit |
| FCN | Fully Convolutional Network |
| FP | Floating Point |
| GCC | GNU Compiler Collection |
| GPU | Graphics Processing Unit |
| HD | High Definition |
| IE | Inference Engine |
| IR | Intermediate Representation |
| JIT | Just In Time |
| JTAG | Joint Test Action Group |
| LPR | License-Plate Recognition |
| LRN | Local Response Normalization |
| mAP | Mean Average Precision |
| Intel(R) MKL-DNN | Intel(R) Math Kernel Library Deep Neural Networks |
| MO | Model Optimizer |
| MVN | Mean Variance Normalization |
| NCDHW | Number of images, Channels, Depth, Height, Width |
| NCHW | Number of images, Channels, Height, Width |
| NHWC | Number of images, Height, Width, Channels |
| NMS | Non-Maximum Suppression |
| NN | Neural Network |
| NST | Neural Style Transfer |
| OD | Object Detection |
| OS | Operating System |
| PCI | Peripheral Component Interconnect |
| PReLU | Parametric Rectified Linear Unit |
| PSROI | Position Sensitive Region Of Interest |
| RCNN, R-CNN | Region-based Convolutional Neural Network |
| ReLU | Rectified Linear Unit |
| ROI | Region Of Interest |
| SDK | Software Development Kit |
| SSD | Single Shot multibox Detector |
| SSE | Streaming SIMD Extensions |
| USB | Universal Serial Bus |
| VGG | Visual Geometry Group |
| VOC | Visual Object Classes |
| WINAPI | Windows Application Programming Interface |
## Terms
Glossary of terms used in the Inference Engine
| Term | Description |
| :--- | :--- |
| Batch | Number of images to analyze during one call of infer. Maximum batch size is a property of the network and it is set before loading of the network to the plugin. In NHWC, NCHW and NCDHW image data layout representation, the N refers to the number of images in the batch |
| Blob | Memory container used for storing inputs, outputs of the network, weights and biases of the layers |
| Device (Affinitity) | A preferred Intel(R) hardware device to run the inference (CPU, GPU, etc.) |
| Extensibility mechanism, Custom layers | The mechanism that provides you with capabilities to extend the Inference Engine and Model Optimizer so that they can work with topologies containing layers that are not yet supported |
| <code>CNNNetwork</code> | A class of the Convolutional Neural Network that Inference Engine reads from IR. Consists of topology, weights and biases |
| <code>ExecutableNetwork</code> | An instance of the loaded network which allows the Inference Engine to request (several) infer requests and perform inference synchronously or asynchronously |
| <code>InferRequest</code> | A class that represents the end point of inference on the model loaded to the plugin and represented by executable network. Inputs are set here, outputs should be requested from this interface as well |
| <code>InferenceEngineProfileInfo</code> | Represents basic inference profiling information per layer |
| Inference Engine | A C++ library with a set of classes that you can use in your application to infer input data (images) and get the result |
| Inference Engine API | The basic default API for all supported devices, which allows you to load a model from Intermediate Representation, set input and output formats and execute the model on various devices |
| Inference Engine <code>Core</code> | Inference Engine Core is a software component that manages inference on certain Intel(R) hardware devices: CPU, GPU, MYRIAD, GNA, etc. |
| Layer catalog or Operations specification | A list of supported layers or operations and its parameters. Sets of supported layers are different for different plugins, please check the documentation on plugins to verify if the Inference Engine supports certain layer on the dedicated hardware |
| <code>Layout</code> | Image data layout refers to the representation of images batch. Layout shows a sequence of 4D or 5D tensor data in memory. A typical NCHW format represents pixel in horizontal direction, rows by vertical dimension, planes by channel and images into batch |
| <code>OutputsDataMap</code> | Structure which contains information about output precisions and layouts |
| Precision | Represents data precision. For example, FP32 is 32-bit floating point, FP16 is 16-bit floating point. Precision can be changed before loading the network to the plugin |
| <code>PreProcessInfo</code> | Class that represents input data for the network. It contains information about input precision, its layout, and pre-processing |
| <code>ResponseDesc</code> | Represents debug information for an error |
## See Also
* [Deep Learning Model Optimizer IR Operations Catalog](../ops/opset.md)
* [Inference Engine Memory primitives](Memory_primitives.md)
* [Terminology](supported_plugins/Supported_Devices.md)

View File

@@ -1,235 +0,0 @@
# Introduction to Inference Engine Device Query API {#openvino_docs_IE_DG_InferenceEngine_QueryAPI}
## Inference Engine Query API (C++)
@sphinxdirective
.. raw:: html
<div id="switcher-cpp" class="switcher-anchor">C++</div>
@endsphinxdirective
The OpenVINO™ toolkit supports inferencing with several types of devices (processors or accelerators).
This section provides a high-level description of the process of querying of different device properties and configuration values at runtime. Refer to the [Hello Query Device С++ Sample](../../samples/cpp/hello_query_device/README.md) sources and the [Multi-Device Plugin documentation](supported_plugins/MULTI.md) for examples of using the Inference Engine Query API in user applications.
### Using the Inference Engine Query API in Your Code
The `InferenceEngine::Core` class provides the following API to query device information, set or get different device configuration properties:
* `InferenceEngine::Core::GetAvailableDevices` - Provides a list of available devices. If there are more than one instance of a specific device, the devices are enumerated with `.suffix` where `suffix` is a unique string identifier. The device name can be passed to all methods of the `InferenceEngine::Core` class that work with devices, for example `InferenceEngine::Core::LoadNetwork`.
* `InferenceEngine::Core::GetMetric` - Provides information about specific device.
`InferenceEngine::Core::GetConfig` - Gets the current value of a specific configuration key.
* `InferenceEngine::Core::SetConfig` - Sets a new value for the configuration key.
The `InferenceEngine::ExecutableNetwork` class is also extended to support the Query API:
* `InferenceEngine::ExecutableNetwork::GetMetric`
* `InferenceEngine::ExecutableNetwork::GetConfig`
* `InferenceEngine::ExecutableNetwork::SetConfig`
### Query API in the Core Class
#### GetAvailableDevices
@snippet snippets/InferenceEngine_QueryAPI0.cpp part0
The function returns a list of available devices, for example:
```
MYRIAD.1.2-ma2480
MYRIAD.1.4-ma2480
CPU
GPU.0
GPU.1
```
Each device name can then be passed to:
* `InferenceEngine::Core::LoadNetwork` to load the network to a specific device.
* `InferenceEngine::Core::GetMetric` to get common or device specific metrics.
* All other methods of the `InferenceEngine::Core` class that accept `deviceName`.
#### GetConfig()
The code below demonstrates how to understand whether the `HETERO` device dumps GraphViz `.dot` files with split graphs during the split stage:
@snippet snippets/InferenceEngine_QueryAPI1.cpp part1
For documentation about common configuration keys, refer to `ie_plugin_config.hpp`. Device specific configuration keys can be found in corresponding plugin folders.
#### GetMetric()
* To extract device properties such as available device, device name, supported configuration keys, and others, use the `InferenceEngine::Core::GetMetric` method:
@snippet snippets/InferenceEngine_QueryAPI2.cpp part2
A returned value appears as follows: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz`.
> **NOTE**: All metrics have a type, which is specified during metric instantiation. The list of common device-agnostic metrics can be found in `ie_plugin_config.hpp`. Device specific metrics (for example, for HDDL or MYRIAD devices) can be found in corresponding plugin folders.
### Query API in the ExecutableNetwork Class
#### GetMetric()
The method is used to get an executable network specific metric such as `METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)`:
@snippet snippets/InferenceEngine_QueryAPI3.cpp part3
Or the current temperature of the `MYRIAD` device:
@snippet snippets/InferenceEngine_QueryAPI4.cpp part4
#### GetConfig()
The method is used to get information about configuration values the executable network has been created with:
@snippet snippets/InferenceEngine_QueryAPI5.cpp part5
#### SetConfig()
The only device that supports this method is [Multi-Device](supported_plugins/MULTI.md).
## Inference Engine Query API (Python)
@sphinxdirective
.. raw:: html
<div id="switcher-python" class="switcher-anchor">Python</div>
@endsphinxdirective
This section provides a high-level description of the process of querying of different device properties and configuration values. Refer to the [Hello Query Device Python Sample](../../samples/python/hello_query_device/README.md) sources and the [Multi-Device Plugin documentation](supported_plugins/MULTI.md) for examples of using the Inference Engine Query API in user applications.
### Using the Inference Engine Query API in Your Code
The Inference Engine [Core](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino-inference-engine-iecore) class provides the following API to query device information, set or get different device configuration properties:
* [ie_api.IECore.available_devices](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.available_devices) - Provides a list of available devices. If there are more than one instance of a specific device, the devices are enumerated with .suffix where suffix is a unique string identifier. The device name can be passed to all methods of the IECore class that work with devices, for example [ie_api.IECore.load_network](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.load_network).
* [ie_api.ieCore.get_metric](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.get_metric) - Provides information about specific device.
* [ie_api.IECore.get_config](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.get_config) - Gets the current value of a specific configuration key.
* [ie_api.IECore.set_config](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.set_config) - Sets a new value for the configuration key.
The [ie_api.ExecutableNetwork](api/ie_python_api/_autosummary/openvino.inference_engine.ExecutableNetwork.html) class is also extended to support the Query API:
* [ie_api.ExecutableNetwork.get_metric](api/ie_python_api/_autosummary/openvino.inference_engine.ExecutableNetwork.html#openvino.inference_engine.ExecutableNetwork.get_metric)
* [ie_api.ExecutableNetwork.get_config](latest/api/ie_python_api/_autosummary/openvino.inference_engine.ExecutableNetwork.html#openvino.inference_engine.ExecutableNetwork.get_config)
* There is no method to call for set_config, but the equivalent action is described below.
### Query API in the IECore Class
#### Get Available Devices
```python
from openvino.inference_engine import IECore
ie = IECore()
print(ie.available_devices)
```
This code prints a list of available devices, for example:
```
MYRIAD.1.2-ma2480
MYRIAD.1.4-ma2480
FPGA.0
FPGA.1
CPU
GPU.0
GPU.1
```
Each device name can then be passed to:
* `IECore.load_network` to load the network to a specific device.
* `IECore.get_metric` to get common or device specific metrics.
* All other methods of the `IECore` class that accept a device name.
#### Get Metric
To extract device properties such as available device, device name, supported configuration keys, and others, use the [IECore.get_metric](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.get_metric) method:
```python
from openvino.inference_engine import IECore
ie = IECore()
ie.get_metric(device_name="CPU", metric_name="FULL_DEVICE_NAME")
```
A returned value appears as follows: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz`.
To list all supported metrics for a device:
```python
from openvino.inference_engine import IECore
ie = IECore()
ie.get_metric(device_name="GPU", metric_name="SUPPORTED_METRICS")
```
#### Get Configuration
The code below uses the [IECore.get_config](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.get_config) method and demonstrates how to understand whether the HETERO device dumps .dot files with split graphs during the split stage:
```python
from openvino.inference_engine import IECore
ie = IECore()
ie.get_config(device_name="HETERO", config_name="HETERO_DUMP_GRAPH_DOT")
```
To list all supported configuration keys for a device:
```python
from openvino.inference_engine import IECore
ie = IECore()
ie.get_metric(device_name=device, metric_name="SUPPORTED_CONFIG_KEYS")
```
For documentation about common configuration keys, refer to `ie_plugin_config.hpp`. Device specific configuration keys can be found in corresponding plugin folders.
### Query API in the ExecutableNetwork Class
#### Get Metric
To get the name of the loaded network:
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_xml_file)
exec_net = ie.load_network(network=net, device_name=device)
exec_net.get_metric("NETWORK_NAME")
```
Use `exec_net.get_metric("SUPPORTED_METRICS")` to list all supported metrics for an ExecutableNetwork instance.
#### Get Configuration
The [IECore.get_config](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.get_config) method is used to get information about configuration values the executable network has been created with:
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_xml_file)
exec_net = ie.load_network(network=net, device_name="CPU")
exec_net.get_config("CPU_THREADS_NUM")
```
Or the current temperature of MYRIAD device:
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_xml_file)
exec_net = ie.load_network(network=net, device_name="MYRIAD")
exec_net.get_config("DEVICE_THERMAL")
```
Use `exec_net.get_metric("SUPPORTED_CONFIG_KEYS")` to list all supported configuration keys.
#### Set Configuration
The only device that supports this method in the ExecutableNetwork class is the [Multi-Device](supported_plugins/MULTI.md), where you can change the priorities of the devices for the Multi plugin in real time: `exec_net.set_config({{"MULTI_DEVICE_PRIORITIES", "GPU,CPU"}})`. See the Multi-Device documentation for more details.

View File

@@ -1,58 +0,0 @@
# Known Issues and Limitations {#openvino_docs_IE_DG_Known_Issues_Limitations}
## Multiple OpenMP Loadings
If the application uses the Inference Engine with third-party components that depend on Intel OpenMP, multiple loadings of the libiomp library may occur and cause OpenMP runtime initialization conflicts. This may happen, for example, if the application uses Intel® Math Kernel Library (Intel® MKL) through the “Single Dynamic Library” (<code>libmkl_rt.so</code>) mechanism and calls Intel MKL after loading the Inference Engine plugin.
The error log looks like this:
```sh
OMP: Error #15: Initializing libiomp5.so, but found libiomp5.so already initialized.
OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
```
Possible workarounds:
* Preload the OpenMP runtime using the <code>LD_PRELOAD</code> variable:
```sh
LD_PRELOAD=<path_to_libiomp5.so> <path_to your_executable>
```
This eliminates multiple loadings of libiomp, and makes all the components use this specific version of OpenMP.
* Alternatively, you can set <code>KMP_DUPLICATE_LIB_OK=TRUE</code>. However, performance degradation or incorrect results may occur in this case.
## Old proto compiler breaks protobuf library
With python protobuf library version 3.5.1, the following incompatibility can happen.
The known case is for Cent OS 7.4.
The error log looks like this:
```sh
File "../lib64/python3.5/site-packages/google/protobuf/descriptor.py", line 829, in _new_
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: expected bytes, str found
```
A possible workaround is to upgrade default protobuf compiler (libprotoc 2.5.0) to newer version, for example libprotoc 2.6.1.
[protobuf_issue]: https://github.com/google/protobuf/issues/4272
## Dynamic batching
Refer to the **Limitations** section of the [Dynamic batching page](DynamicBatching.md).
## Static Shape Infer
Refer to the **Limitations** section of the [Static Shape Infer page](ShapeInference.md).
## Image Pre-Processing Performance Optimization Issue
As described in [documentation for the new API](Integrate_with_customer_application_new_API.md), you can set an image blob of any size to an
infer request using resizable input. Resize is executed during inference using the configured resize algorithm.
But currently, resize algorithms are not completely optimized. So expect performance degradation if resizable input is
specified and an input blob (to be resized) is set using `SetBlob()`. The best performance is for the
[CPU](supported_plugins/CPU.md) plugin only (because enabled openMP* provides parallelism).
Another limitation is that currently, resize algorithms support NCHW layout only. So if you set NHWC layout for an input
blob, NHWC is converted to NCHW before resize and back to NHWC after resize.

View File

@@ -1,60 +0,0 @@
# Inference Engine Memory Primitives {#openvino_docs_IE_DG_Memory_primitives}
## Inference Memory Primitives (C++)
@sphinxdirective
.. raw:: html
<div id="switcher-cpp" class="switcher-anchor">C++</div>
@endsphinxdirective
## Blobs
<code>InferenceEngine::Blob</code> is the main class intended for working with memory.
Using this class you can read and write memory, get information about the memory structure etc.
The right way to create <code>Blob</code> objects with a specific layout is to use constructors with <code>InferenceEngine::TensorDesc</code>.
<pre class="brush:cpp">
InferenceEngine::TensorDesc tdesc(FP32, {1, 3, 227, 227}, InferenceEngine::Layout::NCHW);
InferenceEngine::Blob::Ptr blob = InferenceEngine::make_shared_blob<float>(tdesc);
</pre>
## Layouts
<code>InferenceEngine::TensorDesc</code> is a special class that provides layout format description.
This class allows to create planar layouts using the standard formats (like <code>InferenceEngine::Layout::NCDHW</code>, <code>InferenceEngine::Layout::NCHW</code>, <code>InferenceEngine::Layout::NC</code>, <code>InferenceEngine::Layout::C</code> and etc) and also non-planar layouts using <code>InferenceEngine::BlockingDesc</code>.
In order to create a complex layout you should use <code>InferenceEngine::BlockingDesc</code>, which allows you to define the blocked memory with offsets and strides.
## Examples
1. You can define a blob with dimensions {N: 1, C: 25, H: 20, W: 20} and format NHWC with using next parameters:<br/>
<pre class="brush:cpp">
InferenceEngine::BlockingDesc({1, 20, 20, 25}, {0, 2, 3, 1}); // or
InferenceEngine::BlockingDesc({1, 20, 20, 25}, InferenceEngine::Layout::NHWC);
</pre>
2. If you have a memory with real dimensions {N: 1, C: 25, H: 20, W: 20} but with channels that are blocked by 8, you can define it using next parameters:<br/>
<pre class="brush:cpp">
InferenceEngine::BlockingDesc({1, 4, 20, 20, 8}, {0, 1, 2, 3, 1})
</pre>
3. Also you can set strides and offsets if layout contains it.
4. If you have a complex blob layout and you don't want to calculate the real offset to data you can use the <code>InferenceEngine::TensorDesc::offset(size_t l)</code> or <code>InferenceEngine::TensorDesc::offset(SizeVector v)</code> methods.<br/>
For example:
<pre class="brush:cpp">
InferenceEngine::BlockingDesc blk({1, 4, 20, 20, 8}, {0, 1, 2, 3, 1});
InferenceEngine::TensorDesc tdesc(FP32, {1, 25, 20, 20}, blk);
tdesc.offset(0); // = 0
tdesc.offset(1); // = 8
tdesc.offset({0, 0, 0, 2}); // = 16
tdesc.offset({0, 1, 0, 2}); // = 17
</pre>
5. If you would like to create a TensorDesc with a planar format and for N dimensions (N can be different 1, 2, 4 and etc), you can use the <code>InferenceEngine::TensorDesc::getLayoutByDims</code> method.
<pre class="brush:cpp">
InferenceEngine::TensorDesc::getLayoutByDims({1}); // InferenceEngine::Layout::C
InferenceEngine::TensorDesc::getLayoutByDims({1, 2}); // InferenceEngine::Layout::NC
InferenceEngine::TensorDesc::getLayoutByDims({1, 2, 3, 4}); // InferenceEngine::Layout::NCHW
InferenceEngine::TensorDesc::getLayoutByDims({1, 2, 3}); // InferenceEngine::Layout::BLOCKED
InferenceEngine::TensorDesc::getLayoutByDims({1, 2, 3, 4, 5}); // InferenceEngine::Layout::NCDHW
InferenceEngine::TensorDesc::getLayoutByDims({1, 2, 3, 4, 5, ...}); // InferenceEngine::Layout::BLOCKED
</pre>

View File

@@ -1,91 +0,0 @@
# ONNX Format Support {#openvino_docs_IE_DG_ONNX_Support}
## Introduction (C++)
@sphinxdirective
.. raw:: html
<div id="switcher-cpp" class="switcher-anchor">C++</div>
@endsphinxdirective
Starting with the 2020.4 release, OpenVINO™ supports reading native ONNX models. The `Core::ReadNetwork()` method provides a uniform way to read models from IR or ONNX format, it is a recommended approach to reading models. Example:
```cpp
InferenceEngine::Core core;
auto network = core.ReadNetwork("model.onnx");
```
### Reshape Feature
OpenVINO™ does not provide a mechanism to specify pre-processing (like mean values subtraction, reverse input channels) for the ONNX format. If an ONNX model contains dynamic shapes for input, please use the `CNNNetwork::reshape` method to reshape the model.
### Weights Saved in External Files
OpenVINO™ supports ONNX models that store weights in external files. It is especially useful for models larger than 2GB because of protobuf limitations. To read such models, use the `ReadNetwork` overload which takes `modelPath` as input parameter (both `std::string` and `std::wstring`). Note that the `binPath` argument of `ReadNetwork` should be empty in this case, because paths to external weights are saved directly in an ONNX model.
Otherwise, a runtime exception is thrown. Reading models with external weights is not supported by the `ReadNetwork(const std::string& model, const Blob::CPtr& weights)` overload.
Paths to external weight files are saved in an ONNX model; these paths are relative to the model's directory path.
It means that if a model is located at `home/user/workspace/models/model.onnx` and a file that contains external weights is in `home/user/workspace/models/data/weights.bin`, then the path saved in the model should be:
`data/weights.bin`
> **NOTE**: A single model can use many external weights files.
> **NOTE**: Data of many tensors can be stored in a single external weights file (it is processed using offset and length values, which can be also saved in a model).
The described mechanism is the only way to read weights from external files. The following input parameters of the `ReadNetwork` function overloads are NOT supported for ONNX models and should be passed as empty:
* `const std::wstring& binPath`
* `const std::string& binPath`
* `const Blob::CPtr& weights`
You can find more details about the external data mechanism in [ONNX documentation](https://github.com/onnx/onnx/blob/master/docs/ExternalData.md).
To convert a model to use the external data feature, you can use [ONNX helper functions](https://github.com/onnx/onnx/blob/master/onnx/external_data_helper.py).
Unsupported types of tensors:
* string
* complex64
* complex128
## Introduction (Python)
@sphinxdirective
.. raw:: html
<div id="switcher-python" class="switcher-anchor">Python</div>
@endsphinxdirective
Starting with the 2020.4 release, OpenVINO™ supports reading native ONNX models. The `IECore.read_network()` method provides a uniform way to read models from IR or ONNX format, it is a recommended approach to reading models. Example:
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_onnx_file)
```
### Reshape Feature
OpenVINO™ does not provide a mechanism to specify pre-processing (like mean values subtraction, reverse input channels) for the ONNX format. If an ONNX model contains dynamic shapes for input, please use the [IENetwork.reshape](api/ie_python_api/_autosummary/openvino.inference_engine.IENetwork.html#openvino.inference_engine.IENetwork.reshape) method to reshape the model.
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_onnx_file)
input_layer = next(iter(net.input_info))
net.reshape({input_layer: new_shape})
```
### Weights Saved in External Files
OpenVINO™ supports ONNX models that store weights in external files. It is especially useful for models larger than 2GB because of protobuf limitations. To read such models, use the `model` parameter in the `IECore.read_network(model=path_to_onnx_file)` method. Note that the parameter for the path to the binary weight file, `weights=` should be empty in this case, because paths to external weights are saved directly in an ONNX model. Otherwise, a runtime exception is thrown. Reading models with external weights is **NOT** supported by the `read_network(weights=path_to_bin_file)` parameter.
Paths to external weight files are saved in an ONNX model; these paths are relative to the models directory path. It means that if a model is located at: `$HOME/workspace/models/model.onnx` and a file that contains external weights: `$HOME/workspace/models/data/weights.bin`, the path saved in model should be: data/weights.bin.
**NOTE**:
* A single model can use many external weights files.
* Data of many tensors can be stored in a single external weights file (it is processed using offset and length values, which can be also saved in a model).
The described mechanism is the only possibility to read weights from external files. The `weights` input parameter of the [IECore.read_network](api/ie_python_api/_autosummary/openvino.inference_engine.IECore.html#openvino.inference_engine.IECore.read_network) function is NOT supported for ONNX models and should not be passed, or set as None.
Unsupported types of tensors:
* string
* complex64
* complex128

View File

@@ -1,52 +0,0 @@
# Paddle Support in OpenVINO™ {#openvino_docs_IE_DG_Paddle_Support}
Starting from the 2022.1 release, OpenVINO™ supports reading native Paddle models.
The `Core::ReadNetwork()` method provides a uniform way to read models from either the Paddle format or IR, which is the recommended approach.
## Read Paddle Models from IR
The Paddle Model can be read after it is [converted](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md) to [Intermediate Representation (IR)](../MO_DG/IR_and_opsets.md).
**C++ Example:**
```cpp
InferenceEngine::Core core;
auto network = core.ReadNetwork("model.xml");
```
**Python Example:**
```sh
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network("model.xml")
```
## Read Paddle Models from The Paddle Format (Paddle `inference model` model type)
**C++ Example:**
```cpp
InferenceEngine::Core core;
auto network = core.ReadNetwork("model.pdmodel");
```
**Python Example:**
```sh
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network("model.pdmodel")
```
**The Reshape feature:**
OpenVINO™ does not provide a mechanism to specify pre-processing, such as mean values subtraction or reverse input channels, for the Paddle format.
If a Paddle model contains dynamic shapes for input, use the `CNNNetwork::reshape` method for shape specialization.
## NOTES
* The Paddle [`inference model`](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/inference_en.md) mainly contains two kinds of files `model.pdmodel`(model file) and `model.pdiparams`(params file), which are used for inference.
* The list of supported Paddle models and a description of how to export them can be found in [Convert a Paddle Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md). The following Paddle models are supported by intel CPU only: `Fast-SCNN`, `Yolo v3`, `ppyolo`, `MobileNetv3-SSD`, `BERT`.
* For `Normalize` Paddle Models, the input data should be in FP32 format.
* When reading Paddle models from The Paddle format, make sure that `model.pdmodel` and `model.pdiparams` are in the same folder directory.

View File

@@ -1,14 +0,0 @@
# OpenVINO™ Python* Package
OpenVINO™ Python\* package includes types to measure model and calibrate to low precision.
The OpenVINO™ Python\* package available in the `<INSTALL_DIR>/python/python3.X` directory.
The OpenVINO™ Python\* package includes the following sub-packages:
- [openvino.inference_engine](../../src/bindings/python/docs/api_overview.md) - Python\* wrapper on OpenVINO™ Inference Engine.
- `openvino.tools.accuracy_checker` - Measure accuracy.
- `openvino.tools.benchmark` - Measure latency and throughput.
## See Also
* [Integrate with Customer Application New API](Integrate_with_customer_application_new_API.md)

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2d147adf801535e95d8b627a8a1d23f7b89dea1eabe06218235e756b0a9866fe
size 1636

View File

@@ -1,256 +0,0 @@
# Heterogeneous Plugin {#openvino_docs_IE_DG_supported_plugins_HETERO}
## Introducing the Heterogeneous Plugin (C++)
@sphinxdirective
.. raw:: html
<div id="switcher-cpp" class="switcher-anchor">C++</div>
@endsphinxdirective
The heterogeneous plugin enables computing the inference of one network on several devices. The purposes of executing networks in heterogeneous mode are to:
* Utilize the power of accelerators to process the heaviest parts of the network and to execute unsupported layers on fallback devices like the CPU
* Utilize all available hardware more efficiently during one inference
The execution through heterogeneous plugin can be divided into two independent steps:
1. Setting of hardware affinity to layers
2. Loading a network to the Heterogeneous plugin, splitting the network to parts, and executing them through the plugin
These steps are decoupled. The setting of affinity can be done automatically using the fallback policy or in manual mode.
The fallback automatic policy causes "greedy" behavior and assigns all layers that can be executed on certain device according to the priorities you specify (for example, HETERO:GPU,CPU).
Automatic policy does not take into account plugin peculiarities such as the inability to infer some layers without other special layers placed before or after that layer. The plugin is responsible for solving such cases. If the device plugin does not support the subgraph topology constructed by the HETERO plugin, then you should set affinity manually.
### Details of Splitting Network and Execution
During loading of the network to the Heterogeneous plugin, the network is divided into separate parts and loaded to dedicated plugins.
Intermediate blobs between these subgraphs are allocated automatically in the most efficient way.
### Sample Usage
Inference Engine sample programs can use the Heterogeneous plugin used with the `-d` option:
```sh
./hello_classification <path_to_model>/squeezenet1.1.xml <path_to_pictures>/picture.jpg HETERO:GPU,CPU
```
where:
- `HETERO` stands for the Heterogeneous plugin
- `GPU,CPU` points to fallback policy with priority on GPU and fallback to CPU
You can point more than two devices: `-d HETERO:MYRIAD,GPU,CPU`
### Annotation of Layers per Device and Default Fallback Policy
Default fallback policy decides which layer goes to which device automatically according to the support in dedicated plugins (GPU, CPU, MYRIAD).
Another way to annotate a network is to set affinity manually using `ngraph::Node::get_rt_info` with key `affinity`:
@snippet snippets/HETERO0.cpp part0
The fallback policy does not work if even one layer has an initialized affinity. The sequence should be to call automating affinity settings and then fix manually.
> **NOTE**: If you set affinity manually, be careful because currently Inference Engine plugins don't support constant (`Constant`->`Result`) and empty (`Parameter`->`Result`) networks. Please avoid such subgraphs when you set affinity manually.
@snippet snippets/HETERO1.cpp part1
If you rely on the default affinity distribution, you can avoid calling <code>InferenceEngine::Core::QueryNetwork</code> and just call <code>InferenceEngine::Core::LoadNetwork</code> instead:
@snippet snippets/HETERO2.cpp part2
> **NOTE**: `InferenceEngine::Core::QueryNetwork` does not depend on affinities set by a user. Instead, it queries for layer support based on device capabilities.
### Handling Difficult Topologies
Some topologies are not friendly to heterogeneous execution on some devices or cannot be executed at all with this plugin
Examples are networks having activation layers that are not supported on the primary device.
If transmitting data from one part of a network to another part in heterogeneous mode takes more time than in normal mode, it may not make sense to execute them in heterogeneous mode.
In this case, you can define the heaviest part manually and set the affinity to avoid sending data back and forth many times during one inference.
### Execution Precision
Precision for inference in the heterogeneous plugin is defined by:
* Precision of IR
* Ability of final plugins to execute in precision defined in IR
For example, if you want to execute GPU with CPU fallback with FP16 on GPU, you need to use only FP16 IR.
### Analyzing Performance Heterogeneous Execution
After enabling the <code>KEY_HETERO_DUMP_GRAPH_DOT</code> config key (shown in code snippet below), you can dump GraphViz* `.dot` files with annotations of devices per layer.
The Heterogeneous plugin can generate two files:
* `hetero_affinity_<network name>.dot` - annotation of affinities per layer. This file is written to the disk only if default fallback policy was executed
* `hetero_subgraphs_<network name>.dot` - annotation of affinities per graph. This file is written to the disk during execution of `ICNNNetwork::LoadNetwork()` for the Heterogeneous plugin
@snippet snippets/HETERO3.cpp part3
You can use the GraphViz* utility or a file converter to view the images. On the Ubuntu* operating system, you can use xdot:
* `sudo apt-get install xdot`
* `xdot hetero_subgraphs.dot`
You can use performance data (in sample applications, it is the option `-pc`) to get the performance data on each subgraph.
Here is an example of the output for Googlenet v1 running on HDDL with fallback to CPU:
```
subgraph1: 1. input preprocessing (mean data/HDDL):EXECUTED layerType: realTime: 129 cpu: 129 execType:
subgraph1: 2. input transfer to DDR:EXECUTED layerType: realTime: 201 cpu: 0 execType:
subgraph1: 3. HDDL execute time:EXECUTED layerType: realTime: 3808 cpu: 0 execType:
subgraph1: 4. output transfer from DDR:EXECUTED layerType: realTime: 55 cpu: 0 execType:
subgraph1: 5. HDDL output postprocessing:EXECUTED layerType: realTime: 7 cpu: 7 execType:
subgraph1: 6. copy to IE blob:EXECUTED layerType: realTime: 2 cpu: 2 execType:
subgraph2: out_prob: NOT_RUN layerType: Output realTime: 0 cpu: 0 execType: unknown
subgraph2: prob: EXECUTED layerType: SoftMax realTime: 10 cpu: 10 execType: ref
Total time: 4212 microseconds
```
### See Also
[Supported Devices](Supported_Devices.md)
## Introducing the Heterogeneous Plugin (Python)
@sphinxdirective
.. raw:: html
<div id="switcher-python" class="switcher-anchor">Python</div>
@endsphinxdirective
The heterogeneous plugin enables computing the inference of one network on several devices. The purposes of executing networks in heterogeneous mode are to:
* Utilize the power of accelerators to process the heaviest parts of the network and to execute unsupported layers on fallback devices like the CPU
* Utilize all available hardware more efficiently during one inference
The execution through heterogeneous plugin can be divided into two independent steps:
1. Setting of hardware affinity to layers
2. Loading a network to the Heterogeneous plugin, splitting the network to parts, and executing them through the plugin
These steps are decoupled. The setting of affinity can be done automatically using the fallback policy or in manual mode.
The fallback automatic policy causes "greedy" behavior and assigns all layers that can be executed on certain device according to the priorities you specify (for example, HETERO:GPU,CPU).
Automatic policy does not take into account plugin peculiarities such as the inability to infer some layers without other special layers placed before or after that layer. The plugin is responsible for solving such cases. If the device plugin does not support the subgraph topology constructed by the HETERO plugin, then you should set affinity manually.
Some of the topologies are not well-supported for heterogeneous execution on some devices or cannot be executed in this mode at all. Examples of such networks are those having activation layers which are not supported on the primary device. If transmitting data from one part of a network to another part in heterogeneous mode takes more time than in normal mode, it may not make sense to execute them in heterogeneous mode. In this case, you can define the most compute intense part manually and set the affinity to avoid sending data back and forth many times during one inference.
### Use Default Layer Affinities
To use the default affinities, call `load_network` with the "HETERO" device, with an optional list of devices to consider.
```python
from openvino.inference_engine import IECore
ie = IECore()
net = ie.read_network(model=path_to_model)
exec_net = ie.load_network(network=net, device_name='HETERO:GPU,CPU')
```
### Annotation of Layers per Device and Default Fallback Policy
Default fallback policy decides which layer goes to which device automatically according to the support in dedicated plugins (GPU, CPU, MYRIAD).
Another way to annotate a network is to set affinity manually using code.
### Set Affinity of All Layers to CPU
```python
import ngraph as ng
from openvino.inference_engine import IECore
ie = IECore()
# Read a network in IR or ONNX format
net = ie.read_network(path_to_model)
# Create an Ngraph (graph) function from the network
ng_func = ng.function_from_cnn(net)
for node in ng_func.get_ordered_ops():
rt_info = node.get_rt_info()
rt_info["affinity"] = "CPU"
```
The fallback policy does not work if even one layer has an initialized affinity. The sequence should be calling the default affinity settings and then setting the layers manually.
> **NOTE**: If you set affinity manually, be aware that currently Inference Engine plugins do not support constant (*Constant -> Result*) and empty (*Parameter -> Result*) networks. Please avoid these subgraphs when you set affinity manually.
### Example - Manually Setting Layer Affinities
```python
import ngraph as ng
from openvino.inference_engine import IECore
ie = IECore()
# Read a network in IR or ONNX format
net = ie.read_network(path_to_model)
ng_func = ng.function_from_cnn(net)
for node in ng_func.get_ordered_ops():
rt_info = node.get_rt_info()
rt_info["affinity"] = "CPU"
# Load the network on the target device
exec_net = ie.load_network(network=net, device_name='HETERO:FPGA,CPU')
```
> **NOTE**: `ie.query_network` does not depend on affinities set by a user, but queries for layer support based on device capabilities.
### Details of Splitting Network and Execution
During the loading of the network to the heterogeneous plugin, the network is divided into separate parts and loaded to dedicated plugins. Intermediate blobs between these sub graphs are allocated automatically in the most efficient way.
### Execution Precision
The precision for inference in the heterogeneous plugin is defined by:
* Precision of IR
* Ability of final plugins to execute in precision defined in IR
For example, if you want to execute GPU with CPU fallback with FP16 on GPU, you need to use only FP16 IR.
OpenVINO samples can be used with the following command:
```sh
./hello_classification <path_to_model>/squeezenet1.1.xml <path_to_pictures>/picture.jpg HETERO:GPU,CPU
```
where `HETERO` stands for the heterogeneous plugin.
You can point to more than two devices, for example: `-d HETERO:MYRIAD,GPU,CPU`
### Analyzing Heterogeneous Execution
After enabling the KEY_HETERO_DUMP_GRAPH_DOT config key, you can dump GraphViz* .dot files with annotations of devices per layer.
The heterogeneous plugin can generate two files:
* `hetero_affinity_<network name>.dot` - annotation of affinities per layer. This file is written to the disk only if the default fallback policy was executed
* `hetero_subgraphs_<network name>.dot` - annotation of affinities per graph. This file is written to the disk during execution of `ICNNNetwork::LoadNetwork()` for the heterogeneous plugin
#### To Generate the .dot Files
```python
ie = IECore()
ie.set_config( config={'HETERO_DUMP_GRAPH_DOT' : 'YES'}, device_name='HETERO')
```
You can use the GraphViz* utility or a file converter to view the images. On the Ubuntu* operating system, you can use xdot:
* `sudo apt-get install xdot`
* `xdot hetero_subgraphs.dot`
You can use performance data (in sample applications, it is the option `-pc`) to get the performance data on each subgraph.
Here is an example of the output for Googlenet v1 running on HDDL with fallback to CPU:
```
subgraph1: 1. input preprocessing (mean data/HDDL):EXECUTED layerType: realTime: 129 cpu: 129 execType:
subgraph1: 2. input transfer to DDR:EXECUTED layerType: realTime: 201 cpu: 0 execType:
subgraph1: 3. HDDL execute time:EXECUTED layerType: realTime: 3808 cpu: 0 execType:
subgraph1: 4. output transfer from DDR:EXECUTED layerType: realTime: 55 cpu: 0 execType:
subgraph1: 5. HDDL output postprocessing:EXECUTED layerType: realTime: 7 cpu: 7 execType:
subgraph1: 6. copy to IE blob:EXECUTED layerType: realTime: 2 cpu: 2 execType:
subgraph2: out_prob: NOT_RUN layerType: Output realTime: 0 cpu: 0 execType: unknown
subgraph2: prob: EXECUTED layerType: SoftMax realTime: 10 cpu: 10 execType: ref
Total time: 4212 microseconds
```
### See Also
[Supported Devices](Supported_Devices.md)

View File

@@ -1,7 +1,7 @@
# Asynchronous Inference Request {#openvino_docs_ie_plugin_dg_async_infer_request}
Asynchronous Inference Request runs an inference pipeline asynchronously in one or several task executors depending on a device pipeline structure.
Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class:
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class:
- The class has the `_pipeline` field of `std::vector<std::pair<ITaskExecutor::Ptr, Task> >`, which contains pairs of an executor and executed task.
- All executors are passed as arguments to a class constructor and they are in the running state and ready to run tasks.
@@ -10,7 +10,7 @@ Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequest
`AsyncInferRequest` Class
------------------------
Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class for a custom asynchronous inference request implementation:
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class for a custom asynchronous inference request implementation:
@snippet src/template_async_infer_request.hpp async_infer_request:header

View File

@@ -21,7 +21,7 @@ Once the commands above are executed, the Inference Engine Developer Package is
* `IE::ngraph` - shared nGraph library
* `IE::inference_engine` - shared Inference Engine library
* `IE::inference_engine_transformations` - shared library with Inference Engine ngraph-based Transformations
* `IE::inference_engine_preproc` - shared library with Inference Engine preprocessing plugin
* `IE::openvino_gapi_preproc` - shared library with Inference Engine preprocessing plugin
* `IE::inference_engine_plugin_api` - interface library with Inference Engine Plugin API headers
* `IE::inference_engine_lp_transformations` - shared library with low-precision transformations
* `IE::pugixml` - static Pugixml library

View File

@@ -56,7 +56,7 @@ Detailed guides
* Plugin and its components [testing](@ref openvino_docs_ie_plugin_dg_plugin_testing)
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks)
* [Low precision transformations](@ref openvino_docs_IE_DG_lpt) guide
* [Writing nGraph transformations](@ref ngraph_transformation) guide
* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide
API References
-----------------------

View File

@@ -30,7 +30,7 @@ Based on that, declaration of a plugin class can look as follows:
The provided plugin class also has several fields:
* `_backend` - a backend engine that is used to perform actual computations for network inference. For `Template` plugin `ngraph::runtime::Backend` is used which performs computations using ngraph reference implementations.
* `_backend` - a backend engine that is used to perform actual computations for network inference. For `Template` plugin `ngraph::runtime::Backend` is used which performs computations using OpenVINO™ reference implementations.
* `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
* `_cfg` of type `Configuration`:
@@ -67,7 +67,7 @@ which holds a backend-dependent compiled graph in an internal representation:
Before a creation of an `ExecutableNetwork` instance via a constructor, a plugin may check if a provided
InferenceEngine::ICNNNetwork object is supported by a device. In the example above, the plugin checks precision information.
The very important part before creation of `ExecutableNetwork` instance is to call `TransformNetwork` method which applies ngraph transformation passes.
The very important part before creation of `ExecutableNetwork` instance is to call `TransformNetwork` method which applies OpenVINO™ transformation passes.
Actual graph compilation is done in the `ExecutableNetwork` constructor. Refer to the [ExecutableNetwork Implementation Guide](@ref openvino_docs_ie_plugin_dg_executable_network) for details.
@@ -77,27 +77,27 @@ Actual graph compilation is done in the `ExecutableNetwork` constructor. Refer t
### `TransformNetwork()`
The function accepts a const shared pointer to `ngraph::Function` object and performs the following steps:
The function accepts a const shared pointer to `ov::Model` object and performs the following steps:
1. Deep copies a const object to a local object, which can later be modified.
2. Applies common and plugin-specific transformations on a copied graph to make the graph more friendly to hardware operations. For details how to write custom plugin-specific transformation, please, refer to [Writing ngraph transformations](@ref ngraph_transformation) guide. See detailed topics about network representation:
2. Applies common and plugin-specific transformations on a copied graph to make the graph more friendly to hardware operations. For details how to write custom plugin-specific transformation, please, refer to [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide. See detailed topics about network representation:
* [Intermediate Representation and Operation Sets](../_docs_MO_DG_IR_and_opsets.html)
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks).
@snippet template_plugin/src/template_plugin.cpp plugin:transform_network
> **NOTE**: After all these transformations, a `ngraph::Function` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
> **NOTE**: After all these transformations, a `ov::Model` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
### `QueryNetwork()`
Use the method with the `HETERO` mode, which allows to distribute network execution between different
devices based on the `ngraph::Node::get_rt_info()` map, which can contain the `"affinity"` key.
devices based on the `ov::Node::get_rt_info()` map, which can contain the `"affinity"` key.
The `QueryNetwork` method analyzes operations of provided `network` and returns a list of supported
operations via the InferenceEngine::QueryNetworkResult structure. The `QueryNetwork` firstly applies `TransformNetwork` passes to input `ngraph::Function` argument. After this, the transformed network in ideal case contains only operations are 1:1 mapped to kernels in computational backend. In this case, it's very easy to analyze which operations is supposed (`_backend` has a kernel for such operation or extensions for the operation is provided) and not supported (kernel is missed in `_backend`):
operations via the InferenceEngine::QueryNetworkResult structure. The `QueryNetwork` firstly applies `TransformNetwork` passes to input `ov::Model` argument. After this, the transformed network in ideal case contains only operations are 1:1 mapped to kernels in computational backend. In this case, it's very easy to analyze which operations is supposed (`_backend` has a kernel for such operation or extensions for the operation is provided) and not supported (kernel is missed in `_backend`):
1. Store original names of all operations in input `ngraph::Function`
1. Store original names of all operations in input `ov::Model`
2. Apply `TransformNetwork` passes. Note, the names of operations in a transformed network can be different and we need to restore the mapping in the steps below.
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using ngraph reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using OpenVINO™ reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
4. `QueryNetworkResult.supportedLayersMap` contains only operations which are fully supported by `_backend`.
@snippet template_plugin/src/template_plugin.cpp plugin:query_network

View File

@@ -26,7 +26,7 @@ Engine concepts: plugin creation, multiple executable networks support, multiple
@snippet single_layer_tests/convolution.cpp test_convolution:instantiate
3. **Sub-graph tests** (`subgraph_tests` sub-folder). This group of tests is designed to tests small patterns or combination of layers. E.g. when a particular topology is being enabled in a plugin e.g. TF ResNet-50, there is no need to add the whole topology to test tests. In opposite way, a particular repetitive subgraph or pattern can be extracted from `ResNet-50` and added to the tests. The instantiation of the sub-graph tests is done in the same way as for single layer tests.
> **Note**, such sub-graphs or patterns for sub-graph tests should be added to `IE::ngraphFunctions` library first (this library is a pre-defined set of small `ngraph::Function`) and re-used in sub-graph tests after.
> **Note**, such sub-graphs or patterns for sub-graph tests should be added to `IE::ngraphFunctions` library first (this library is a pre-defined set of small `ov::Model`) and re-used in sub-graph tests after.
4. **HETERO tests** (`subgraph_tests` sub-folder) contains tests for `HETERO` scenario (manual or automatic affinities settings, tests for `QueryNetwork`).
@@ -41,18 +41,14 @@ To use these tests for your own plugin development, link the `IE::funcSharedTest
To build test binaries together with other build artifacts, use the `make all` command. For details, see
[Build Plugin Using CMake*](@ref openvino_docs_ie_plugin_dg_plugin_build).
### Tests for plugin-specific ngraph transformations
Please, refer to [Transformation testing](@ref ngraph_transformation) guide.
### How to Extend Inference Engine Plugin Tests
Inference Engine Plugin tests are open for contribution.
Add common test case definitions applicable for all plugins to the `IE::funcSharedTests` target within the DLDT repository. Then, any other plugin supporting corresponding functionality can instantiate the new test.
All Inference Engine per-layer tests check test layers functionality. They are developed using nGraph functions
All Inference Engine per-layer tests check test layers functionality. They are developed using ov::Model.
as input graphs used by tests. In this case, to test a new layer with layer tests, extend
the `IE::ngraphFunctions` library, which is also included in the Inference Engine Developer package, with a new nGraph function
the `IE::ngraphFunctions` library, which is also included in the Inference Engine Developer package, with a new model.
including the corresponding operation.
> **NOTE**: When implementing a new subgraph test, add new single-layer tests for each operation of the subgraph if such test does not exist.

View File

@@ -220,17 +220,17 @@ Typical transformation pipeline described below.
### Step 1. Common optimizations
This step is optional for LPT but typically is presented in OpenVINO™ plugins. The step doesn't use any LPT transformation. Firstly, the step disables dequantization operations constant folding on constant subgraph on weights to prevent the lost of dequantization info on the next plugin transformations. After that, it optimizes nGraph function and convert operations to operation set 1. Typically, usage of this step is the simplest way to meet LPT requirements for the input quantized model. If plugin can guarantee that LPT input requirements are met, then this step can be skipped.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_common
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_common
### Step 2. Low precision transformations execution
This step is mandatory. It configures and runs LPT transformations.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_execution
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_execution
### Step 3. Plugin-specific transformations
This step is optional. It modifies the nGraph function to a device-specific operation set.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_device
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_device
## Result model overview
@@ -298,14 +298,14 @@ Low Precision Transformations can be customizable. Build-in customization option
### Operation precision restrictions
This option defines precisions which allowed for the operation input ports. The option value is passed as input argument for `LowPrecision` constructor. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_supported_precisions
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_supported_precisions
In provided example in result model `Convolution` operation inputs must have specific precisions: `u8` (unsigned int8) precision on input 0 (on activations) and `i8` (signed int8) precision on input 1 (on weights).
### Operation per tensor quantization restrictions
This option defines if operation supports per-tensor quantization only. The option value is passed as input argument for `LowPrecision` constructor. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp per_tensor_quantization
@snippet snippets/lpt_intel_cpu_plugin.cpp per_tensor_quantization
In provided example in result model `Convolution` operations must have per-tensor quantization on input 0 (on activations).
@@ -316,4 +316,4 @@ This option defines if each LPT transformation updates precision or not. The opt
Plugin specific customization can be implemented via nGraph transformation callbacks. For example: asymmetric quantization support can be easily customizable via `LayerTransformation::isAsymmetricQuantization` and `WeightableLayerTransformation::isAsymmetricOnWeights` methods usage in callbacks. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp asymmetric_quantization
@snippet snippets/lpt_intel_cpu_plugin.cpp asymmetric_quantization

View File

@@ -44,7 +44,7 @@ The original model key features:
Transformations are run with the following parameters:
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_markup_pipeline
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_markup_pipeline
## 1. MarkupCanBeQuantized
The transformation marks operations that cannot be quantized. No attributes are required before the transformation.

View File

@@ -2,10 +2,13 @@
@sphinxdirective
.. _deep learning model optimizer:
.. toctree::
:maxdepth: 1
:hidden:
openvino_docs_MO_DG_IR_and_opsets
openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model
openvino_docs_MO_DG_Additional_Optimization_Use_Cases
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer
@@ -19,7 +22,7 @@
Model Optimizer is a cross-platform command-line tool that facilitates the transition between the training and deployment environment, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices.
Model Optimizer process assumes you have a network model trained using supported deep learning frameworks: Caffe*, TensorFlow*, Kaldi*, MXNet* or converted to the ONNX* format. Model Optimizer produces an Intermediate Representation (IR) of the network, which can be inferred with the [Inference Engine](../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md).
Model Optimizer process assumes you have a network model trained using supported deep learning frameworks: Caffe*, TensorFlow*, Kaldi*, MXNet* or converted to the ONNX* format. Model Optimizer produces an Intermediate Representation (IR) of the network, which can be inferred with the [OpenVINO™ Runtime](../OV_Runtime_UG/openvino_intro.md).
> **NOTE**: Model Optimizer does not infer models. Model Optimizer is an offline tool that runs before the inference takes place.

View File

@@ -7,41 +7,3 @@ TensorFlow* provides only prebuilt binaries with AVX instructions enabled. When
To run the Model Optimizer on this hardware, you should compile TensorFlow binaries from source as described at the [TensorFlow website](https://www.tensorflow.org/install/source).
Another option is to run the Model Optimizer to generate an IR on hardware that supports AVX to and then perform inference on hardware without AVX.
## Multiple OpenMP Loadings
If the application uses the Inference Engine with third-party components that depend on Intel OpenMP, multiple loadings of the libiomp library may occur and cause OpenMP runtime initialization conflicts. This may happen, for example, if the application uses Intel® Math Kernel Library (Intel® MKL) through the “Single Dynamic Library” (<code>libmkl_rt.so</code>) mechanism and calls Intel MKL after loading the Inference Engine plugin.
The error log looks as follows:
```sh
OMP: Error #15: Initializing libiomp5.so, but found libiomp5.so already initialized.
OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
```
Possible workarounds:
* Preload the OpenMP runtime using the <code>LD_PRELOAD</code> variable:
```sh
LD_PRELOAD=<path_to_libiomp5.so> <path_to your_executable> ```
This eliminates multiple loadings of libiomp, and makes all the components use this specific version of OpenMP.
* Alternatively, you can set <code>KMP_DUPLICATE_LIB_OK=TRUE</code>. However, performance degradation or incorrect results may occur in this case.
## Old proto compiler breaks protobuf library
With python protobuf library version 3.5.1 the following incompatibility can happen.
The known case is for Cent OS 7.4
The error log looks as follows:
```sh
File "../lib64/python3.5/site-packages/google/protobuf/descriptor.py", line 829, in _new_
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: expected bytes, str found
```
Possible workaround is to upgrade default protobuf compiler (libprotoc 2.5.0) to newer version, for example
libprotoc 2.6.1.
[protobuf_issue]: https://github.com/google/protobuf/issues/4272

View File

@@ -3,13 +3,13 @@
Model Optimizer performs preprocessing to a model. It is possible to optimize this step and improve first inference time, to do that, follow the tips bellow:
- **Image mean/scale parameters**<br>
Make sure to use the input image mean/scale parameters (`--scale` and `mean_values`) with the Model Optimizer when you need pre-processing. It allows the tool to bake the pre-processing into the IR to get accelerated by the Inference Engine.
Make sure to use the input image mean/scale parameters (`--scale` and `mean_values`) with the Model Optimizer when you need pre-processing. It allows the tool to bake the pre-processing into the IR to get accelerated by the OpenVINO Runtime.
- **RGB vs. BGR inputs**<br>
If, for example, your network assumes the RGB inputs, the Model Optimizer can swap the channels in the first convolution using the `--reverse_input_channels` command line option, so you do not need to convert your inputs to RGB every time you get the BGR image, for example, from OpenCV*.
- **Larger batch size**<br>
Notice that the devices like GPU are doing better with larger batch size. While it is possible to set the batch size in the runtime using the Inference Engine [ShapeInference feature](../../IE_DG/ShapeInference.md).
Notice that the devices like GPU are doing better with larger batch size. While it is possible to set the batch size in the runtime using the OpenVINO Runtime API [ShapeInference feature](../../OV_Runtime_UG/ShapeInference.md).
- **Resulting IR precision**<br>
The resulting IR precision, for instance, `FP16` or `FP32`, directly affects performance. As CPU now supports `FP16` (while internally upscaling to `FP32` anyway) and because this is the best precision for a GPU target, you may want to always convert models to `FP16`. Notice that this is the only precision that Intel&reg; Movidius&trade; Myriad&trade; 2 and Intel&reg; Myriad&trade; X VPUs support.

View File

@@ -8,4 +8,4 @@ The picture above shows Caffe\* Resnet269\* topology. The left model is the orig
If you still see these operations, inspect the Model Optimizer output carefully while searching for warnings, such as on the tool being unable to fuse. For example, non-linear operations (like activations) in between convolutions and linear operations might prevent the fusing. If performance is of concern, try to change (and potentially re-train) the topology. Refer to the [Model Optimizer Guide](Model_Optimization_Techniques.md) for more optimizations.
Notice that the activation (`_relu`) is not touched by the Model Optimizer, and while it can be merged into convolution as well, this is rather a device-specific optimization, covered by Inference Engine during the model loading time. You are encouraged to inspect performance counters from plugins that should indicate that these particular layers are not executed (“Optimized out”). For more information, refer to <a href="#performance-counters">Internal Inference Performance Counters</a>.
Notice that the activation (`_relu`) is not touched by the Model Optimizer, and while it can be merged into convolution as well, this is rather a device-specific optimization, covered by OpenVINO Runtime during the model loading time. You are encouraged to inspect performance counters from plugins that should indicate that these particular layers are not executed (“Optimized out”). For more information, refer to <a href="#performance-counters">Internal Inference Performance Counters</a>.

View File

@@ -3,11 +3,11 @@
## Tip 1. Measure the Proper Set of Operations
When evaluating performance of your model with the Inference Engine, you must measure the proper set of operations. To do so, consider the following tips:
When evaluating performance of your model with the OpenVINO Runtime, you must measure the proper set of operations. To do so, consider the following tips:
- Avoid including one-time costs like model loading.
- Track separately the operations that happen outside the Inference Engine, like video decoding.
- Track separately the operations that happen outside the OpenVINO Runtime, like video decoding.
> **NOTE**: Some image pre-processing can be baked into the IR and accelerated. For more information, refer to [Model Optimizer Knobs Related to Performance](Additional_Optimizations.md)
@@ -18,7 +18,7 @@ You need to build your performance conclusions on reproducible data. Do the perf
- If the warm-up run does not help or execution time still varies, you can try running a large number of iterations and then average or find a mean of the results.
- For time values that range too much, use geomean.
Refer to the [Inference Engine Samples](../../IE_DG/Samples_Overview.md) for code examples for the performance measurements. Almost every sample, except interactive demos, has a `-ni` option to specify the number of iterations.
Refer to the [OpenVINO Samples](../../OV_Runtime_UG/Samples_Overview.md) for code examples for the performance measurements. Almost every sample, except interactive demos, has a `-ni` option to specify the number of iterations.
## Getting performance numbers using OpenVINO tool
@@ -39,22 +39,22 @@ to execute on the CPU instead.
For example, for the CPU throughput mode from the previous section, you can play with number of streams (`-nstreams` command-line param).
Try different values of the `-nstreams` argument from `1` to a number of CPU cores and find one that provides the best performance. For example, on a 8-core CPU, compare the `-nstreams 1` (which is a latency-oriented scenario) to the `2`, `4` and `8` streams. Notice that `benchmark_app` automatically queries/creates/runs number of requests required to saturate the given number of streams.
Finally, notice that when you don't specify number of streams with `-nstreams`, "AUTO" value for the streams is used, e.g. for the CPU this is [CPU_THROUGHPUT_AUTO](../../IE_DG/supported_plugins/CPU.md). You can spot the actual value behind "AUTO" for your machine in the application output.
Finally, notice that when you don't specify number of streams with `-nstreams`, "AUTO" value for the streams is used, e.g. for the CPU this is [CPU_THROUGHPUT_AUTO](../../OV_Runtime_UG/supported_plugins/CPU.md). You can spot the actual value behind "AUTO" for your machine in the application output.
Notice that the "AUTO" number is not necessarily most optimal, so it is generally recommended to play either with the benchmark_app's "-nstreams" as described above, or via [new Workbench tool](@ref workbench_docs_Workbench_DG_Introduction).This allows you to simplify the app-logic, as you don't need to combine multiple inputs into a batch to achieve good CPU performance.
Instead, it is possible to keep a separate infer request per camera or another source of input and process the requests in parallel using Async API.
## Comparing Performance with Native/Framework Code
When comparing the Inference Engine performance with the framework or another reference code, make sure that both versions are as similar as possible:
When comparing the OpenVINO Runtime performance with the framework or another reference code, make sure that both versions are as similar as possible:
- Wrap exactly the inference execution (refer to the [Inference Engine Samples](../../IE_DG/Samples_Overview.md) for examples).
- Wrap exactly the inference execution (refer to the [OpenVINO Samples](../../OV_Runtime_UG/Samples_Overview.md) for examples).
- Do not include model loading time.
- Ensure the inputs are identical for the Inference Engine and the framework. For example, Caffe\* allows to auto-populate the input with random values. Notice that it might give different performance than on real images.
- Similarly, for correct performance comparison, make sure the access pattern, for example, input layouts, is optimal for Inference Engine (currently, it is NCHW).
- Ensure the inputs are identical for the OpenVINO Runtime and the framework. For example, Caffe\* allows to auto-populate the input with random values. Notice that it might give different performance than on real images.
- Similarly, for correct performance comparison, make sure the access pattern, for example, input layouts, is optimal for OpenVINO Runtime (currently, it is NCHW).
- Any user-side pre-processing should be tracked separately.
- Make sure to try the same environment settings that the framework developers recommend, for example, for TensorFlow*. In many cases, things that are more machine friendly, like respecting NUMA (see <a href="#cpu-checklist">CPU Checklist</a>), might work well for the Inference Engine as well.
- If applicable, use batching with the Inference Engine.
- If possible, demand the same accuracy. For example, TensorFlow allows `FP16` support, so when comparing to that, make sure to test the Inference Engine with the `FP16` as well.
- Make sure to try the same environment settings that the framework developers recommend, for example, for TensorFlow*. In many cases, things that are more machine friendly, like respecting NUMA (see <a href="#cpu-checklist">CPU Checklist</a>), might work well for the OpenVINO Runtime as well.
- If applicable, use batching.
- If possible, demand the same accuracy. For example, TensorFlow allows `FP16` support, so when comparing to that, make sure to test the OpenVINO Runtime with the `FP16` as well.
## Using Tools <a name="using-tools"></a>
@@ -64,7 +64,7 @@ Alternatively, you can gather the raw profiling data that samples report, the se
### Internal Inference Performance Counters <a name="performance-counters"></a>
Almost every sample (inspect command-line options for a specific sample with `-h`) supports a `-pc` command that outputs internal execution breakdown. Refer to the [samples code](../../IE_DG/Samples_Overview.md) for the actual Inference Engine API behind that.
Almost every sample (inspect command-line options for a specific sample with `-h`) supports a `-pc` command that outputs internal execution breakdown. Refer to the [OpenVINO Samples](../../OV_Runtime_UG/Samples_Overview.md) for the actual OpenVINO Runtime API behind that.
Below is example of CPU plugin output for a network (since the device is CPU, the layers wall clock `realTime` and the `cpu` time are the same):

View File

@@ -158,7 +158,7 @@ However, if your model contains more than one input, the Model Optimizer is able
#### 9. What does the message "Mean file for topologies with multiple inputs is not supported" mean? <a name="question-9"></a>
Model Optimizer does not support mean file processing for topologies with more than one input. In this case, you need to perform preprocessing of the inputs for a generated Intermediate Representation in the Inference Engine to perform subtraction for every input of your multi-input model.
Model Optimizer does not support mean file processing for topologies with more than one input. In this case, you need to perform preprocessing of the inputs for a generated Intermediate Representation in the OpenVINO Runtime to perform subtraction for every input of your multi-input model, see [Overview of Preprocessing](../../OV_Runtime_UG/preprocessing_overview.md) for details.
#### 10. What does the message "Cannot load or process mean file: value error" mean? <a name="question-10"></a>
@@ -214,7 +214,7 @@ One of the layers in the specified topology might not have inputs or values. Ple
#### 24. What does the message "Part of the nodes was not translated to IE. Stopped" mean? <a name="question-24"></a>
Some of the layers are not supported by the Inference Engine and cannot be translated to an Intermediate Representation. You can extend the Model Optimizer by allowing generation of new types of layers and implement these layers in the dedicated Inference Engine plugins. For more information, refer to the [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md) and [Inference Engine Extensibility Mechanism](../../IE_DG/Extensibility_DG/Intro.md)
Some of the operations are not supported by the OpenVINO Runtime and cannot be translated to an Intermediate Representation. You can extend the Model Optimizer by allowing generation of new types of operations and implement these operations in the dedicated OpenVINO plugins. For more information, refer to the [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md)
#### 25. What does the message "While creating an edge from .. to .. : node name is undefined in the graph. Check correctness of the input model" mean? <a name="question-25"></a>
@@ -268,7 +268,7 @@ Model Optimizer tried to write an event file in the specified directory but fail
#### 37. What does the message "There is no registered 'infer' function for node with op = .. . Please implement this function in the extensions" mean? <a name="question-37"></a>
Most likely, you tried to extend Model Optimizer with a new primitive, but did not specify an infer function. For more information on extensions, see [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
Most likely, you tried to extend Model Optimizer with a new primitive, but did not specify an infer function. For more information on extensions, see [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 38. What does the message "Stopped shape/value propagation at node" mean? <a name="question-38"></a>
@@ -300,7 +300,7 @@ Most likely, there is a problem with the specified file for model. The file exis
#### 45. What does the message "Found custom layer. Model Optimizer does not support this layer. Please, register it in CustomLayersMapping.xml or implement extension" mean? <a name="question-45"></a>
This means that the layer `{layer_name}` is not supported in the Model Optimizer. You can find a list of all unsupported layers in the corresponding section. You should implement the extensions for this layer ([Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md)).
This means that the layer `{layer_name}` is not supported in the Model Optimizer. You can find a list of all unsupported layers in the corresponding section. You should implement the extensions for this layer ([OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md)).
#### 46. What does the message "Custom replacement configuration file does not exist" mean? <a name="question-46"></a>
@@ -308,7 +308,7 @@ Path to the custom replacement configuration file was provided with the `--trans
#### 47. What does the message "Extractors collection have case insensitive duplicates" mean? <a name="question-47"></a>
When extending Model Optimizer with new primitives keep in mind that their names are case insensitive. Most likely, another operation with the same name is already defined. For more information, see [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
When extending Model Optimizer with new primitives keep in mind that their names are case insensitive. Most likely, another operation with the same name is already defined. For more information, see [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 48. What does the message "Input model name is not in an expected format, cannot extract iteration number" mean? <a name="question-48"></a>
@@ -340,7 +340,7 @@ Please, make sure that inputs are defined and have correct shapes. You can use `
#### 55. What does the message "Attempt to register of custom name for the second time as class. Note that custom names are case-insensitive" mean? <a name="question-55"></a>
When extending Model Optimizer with new primitives keep in mind that their names are case insensitive. Most likely, another operation with the same name is already defined. For more information, see [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
When extending Model Optimizer with new primitives keep in mind that their names are case insensitive. Most likely, another operation with the same name is already defined. For more information, see [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 56. What does the message "Both --input_shape and --batch were provided. Please, provide only one of them" mean? <a name="question-56"></a>
@@ -492,7 +492,7 @@ For more information, refer to [Converting a MXNet* Model](convert_model/Convert
Model Optimizer tried to load the model that contains some unsupported operations.
If you want to convert model that contains unsupported operations you need to prepare extension for all such operations.
For more information, refer to [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
For more information, refer to [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 87. What does the message "Can not register Op ... Please, call function 'register_caffe_python_extractor' with parameter 'name'" mean? <a name="question-87"></a>
@@ -538,7 +538,7 @@ Note that the first call <code>register_caffe_python_extractor(ProposalPythonExa
The second call prevents Model Optimizer from using this extension as if it is an extension for
a layer with type `Proposal`. Otherwise, this layer can be chosen as an implementation of extension that can lead to potential issues.
For more information, refer to the [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
For more information, refer to the [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 88. What does the message "Model Optimizer is unable to calculate output shape of Memory node .." mean? <a name="question-88"></a>
@@ -572,8 +572,8 @@ file is not available or does not exist. Also refer to FAQ [#90](#question-90).
This message means that if you have model with custom layers and its json file has been generated with MXNet version
lower than 1.0.0, Model Optimizer does not support such topologies. If you want to convert it you have to rebuild
MXNet with unsupported layers or generate new json with MXNet version 1.0.0 and higher. Also you need to implement
Inference Engine extension for used custom layers.
For more information, refer to the [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md).
OpenVINO extension for used custom layers.
For more information, refer to the [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md).
#### 97. What does the message "Graph contains a cycle. Can not proceed .." mean? <a name="question-97"></a>
@@ -586,7 +586,7 @@ For Tensorflow:
For all frameworks:
1. [Replace cycle containing Sub-graph in Model Optimizer](customize_model_optimizer/Subgraph_Replacement_Model_Optimizer.md)
2. [Custom Layers Guide](../../HOWTO/Custom_Layers_Guide.md)
2. [OpenVINO™ Extensibility Mechanism](../../Extensibility_UG/Intro.md)
or
* Edit network in original framework to exclude cycle.
@@ -638,4 +638,4 @@ Starting from the 2022.1 version, the default IR conversion path for ONNX models
Certain features, such as `--extensions` and `--transformations_config`, are not yet fully supported on the new frontends.
For `--extensions`, the new frontends support only paths to shared libraries (.dll and .so). For `--transformations_config`, they support JSON configurations with defined library fields.
Inputs freezing (enabled by `--freeze_placeholder_with_value` or `--input` arguments) is not supported on the new frontends.
The IR conversion falls back to the old path if a user does not select any expected path of conversion explicitly (by `--use_new_frontend` or `--use_legacy_frontend` MO arguments) and unsupported pre-defined scenario is detected on the new frontend path.
The IR conversion falls back to the old path if a user does not select any expected path of conversion explicitly (by `--use_new_frontend` or `--use_legacy_frontend` MO arguments) and unsupported pre-defined scenario is detected on the new frontend path.

View File

@@ -1,9 +1,9 @@
# Supported Framework Layers {#openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers}
## Caffe\* Supported Layers
## Caffe Supported Layers
| Layer Name in Caffe\* | Limitations |
| Layer Name in Caffe | Limitations |
|:---------- | :----------|
| Axpy | |
| BN | |
@@ -47,10 +47,10 @@
| Tile | |
## MXNet\* Supported Symbols
## MXNet Supported Symbols
| Symbol Name in MXNet\*| Limitations|
| Symbol Name in MXNet| Limitations|
| :----------| :----------|
| _Plus | |
| _contrib_arange_like | |
@@ -119,7 +119,7 @@
| Concat | |
| Convolution | |
| Crop | "center_crop" = 1 is not supported |
| Custom | [Custom Layers in the Model Optimizer](customize_model_optimizer/Customize_Model_Optimizer.md) |
| Custom | [Custom Layers in Model Optimizer](customize_model_optimizer/Customize_Model_Optimizer.md) |
| Deconvolution | |
| DeformableConvolution | |
| DeformablePSROIPooling | |
@@ -149,12 +149,12 @@
| zeros_like | |
## TensorFlow\* Supported Operations
## TensorFlow Supported Operations
Some TensorFlow\* operations do not match to any Inference Engine layer, but are still supported by the Model Optimizer and can be used on constant propagation path. These layers are labeled 'Constant propagation' in the table.
Some TensorFlow operations do not match to any OpenVINO operation, but are still supported by the Model Optimizer and can be used on constant propagation path. These layers are labeled 'Constant propagation' in the table.
| Operation Name in TensorFlow\* | Limitations|
| Operation Name in TensorFlow | Limitations|
| :----------| :----------|
| Abs | |
| Acosh | |
@@ -348,10 +348,10 @@ Some TensorFlow\* operations do not match to any Inference Engine layer, but are
| ZerosLike | |
## TensorFlow 2 Keras\* Supported Operations
## TensorFlow 2 Keras Supported Operations
| Operation Name in TensorFlow 2 Keras\* | Limitations|
| Operation Name in TensorFlow 2 Keras | Limitations|
| :----------| :----------|
| ActivityRegularization | |
| Add | |
@@ -431,10 +431,10 @@ Some TensorFlow\* operations do not match to any Inference Engine layer, but are
| ZeroPadding2D | |
| ZeroPadding3D | |
## Kaldi\* Supported Layers
## Kaldi Supported Layers
| Symbol Name in Kaldi\*| Limitations|
| Symbol Name in Kaldi| Limitations|
| :----------| :----------|
| addshift | |
| affinecomponent | |
@@ -478,10 +478,10 @@ Some TensorFlow\* operations do not match to any Inference Engine layer, but are
| timeheightconvolutioncomponent | |
## ONNX\* Supported Operators
## ONNX Supported Operators
| Symbol Name in ONNX\*| Limitations|
| Symbol Name in ONNX| Limitations|
| :----------| :----------|
| Abs | |
| Acos | |
@@ -621,11 +621,11 @@ Some TensorFlow\* operations do not match to any Inference Engine layer, but are
| Xor | |
## PaddlePaddle\* Supported Operators
## PaddlePaddle Supported Operators
paddlepaddle>=2.1
| Operator Name in PaddlePaddle\*| Limitations|
| Operator Name in PaddlePaddle| Limitations|
| :----------| :----------|
| adpative_pool2d | 'NHWC' data_layout is not supported |
| arg_max | 'int32' output data_type is not supported |

View File

@@ -1,11 +1,17 @@
# Converting a Caffe* Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe}
@sphinxdirective
.. _convert model caffe:
@endsphinxdirective
A summary of the steps for optimizing and deploying a model that was trained with Caffe\*:
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for Caffe\*.
2. [Convert a Caffe\* Model](#Convert_From_Caffe) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values
3. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided Inference Engine [sample applications](../../../IE_DG/Samples_Overview.md)
4. [Integrate](../../../IE_DG/Samples_Overview.md) the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in your application to deploy the model in the target environment
3. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [OpenVINO samples](../../../OV_Runtime_UG/Samples_Overview.md)
4. [Integrate](../../../OV_Runtime_UG/Samples_Overview.md) the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in your application to deploy the model in the target environment
## Supported Topologies

View File

@@ -2,6 +2,8 @@
@sphinxdirective
.. _convert model kaldi:
.. toctree::
:maxdepth: 1
:hidden:
@@ -14,8 +16,8 @@ A summary of the steps for optimizing and deploying a model that was trained wit
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for Kaldi\*.
2. [Convert a Kaldi\* Model](#Convert_From_Kaldi) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values.
3. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided Inference Engine [sample applications](../../../IE_DG/Samples_Overview.md).
4. [Integrate](../../../IE_DG/Samples_Overview.md) the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in your application to deploy the model in the target environment.
3. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [OpenVINO Samples](../../../OV_Runtime_UG/Samples_Overview.md).
4. [Integrate](../../../OV_Runtime_UG/Samples_Overview.md) the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in your application to deploy the model in the target environment.
> **NOTE**: The Model Optimizer supports the [nnet1](http://kaldi-asr.org/doc/dnn1.html) and [nnet2](http://kaldi-asr.org/doc/dnn2.html) formats of Kaldi models. Support of the [nnet3](http://kaldi-asr.org/doc/dnn3.html) format is limited.
@@ -98,7 +100,7 @@ The Model Optimizer finds the last layer of the topology and removes this layer
> **NOTE**: Model Optimizer can remove SoftMax layer only if the topology has one output.
> **NOTE**: For sample inference of Kaldi models, you can use the Inference Engine Speech Recognition sample application. The sample supports models with one output. If your model has several outputs, specify the desired one with the `--output` option.
> **NOTE**: For sample inference of Kaldi models, you can use the OpenVINO Speech Recognition sample application. The sample supports models with one output. If your model has several outputs, specify the desired one with the `--output` option.
If you want to convert a model for inference on Intel® Movidius™ Myriad™, use the `--remove_memory` option.
It removes Memory layers from the IR. Instead of it, additional inputs and outputs appear in the IR.

View File

@@ -2,6 +2,8 @@
@sphinxdirective
.. _convert model mxnet:
.. toctree::
:maxdepth: 1
:hidden:
@@ -15,8 +17,8 @@ A summary of the steps for optimizing and deploying a model that was trained wit
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for MXNet* (MXNet was used to train your model)
2. [Convert a MXNet model](#ConvertMxNet) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values
3. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided Inference Engine [sample applications](../../../IE_DG/Samples_Overview.md)
4. [Integrate](../../../IE_DG/Samples_Overview.md) the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in your application to deploy the model in the target environment
3. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [OpenVINO Samples](../../../OV_Runtime_UG/Samples_Overview.md)
4. [Integrate](../../../OV_Runtime_UG/Samples_Overview.md) the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in your application to deploy the model in the target environment
## Supported Topologies

View File

@@ -2,6 +2,8 @@
@sphinxdirective
.. _convert model onnx:
.. toctree::
:maxdepth: 1
:hidden:

View File

@@ -1,11 +1,11 @@
# Converting a Paddle* Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle}
# Converting a PaddlePaddle Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle}
A summary of the steps for optimizing and deploying a model trained with Paddle\*:
A summary of the steps for optimizing and deploying a model trained with PaddlePaddle:
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for Paddle\*.
2. [Convert a Paddle\* Model](#Convert_From_Paddle) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases.
3. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided Inference Engine [sample applications](../../../IE_DG/Samples_Overview.md).
4. [Integrate](../../../IE_DG/Samples_Overview.md) the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in your application to deploy the model in the target environment.
1. [Configure Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for PaddlePaddle.
2. [Convert a PaddlePaddle Model](#Convert_From_Paddle) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases.
3. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [OpenVINO Samples](../../../OV_Runtime_UG/Samples_Overview.md).
4. [Integrate](../../../OV_Runtime_UG/Samples_Overview.md) the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in your application to deploy the model in the target environment.
## Supported Topologies
@@ -29,11 +29,11 @@ A summary of the steps for optimizing and deploying a model trained with Paddle\
> **NOTE:** The verified models are exported from the repository of branch release/2.1.
## Convert a Paddle* Model <a name="Convert_From_Paddle"></a>
## Convert a PaddlePaddle Model <a name="Convert_From_Paddle"></a>
To convert a Paddle\* model:
To convert a PaddlePaddle model:
1. Activate environment with installed OpenVINO if needed
1. Activate environment with installed OpenVINO if needed
2. Use the `mo` script to simply convert a model, specifying the framework, the path to the input model `.pdmodel` file and the path to an output directory with write permissions:
```sh
mo --input_model <INPUT_MODEL>.pdmodel --output_dir <OUTPUT_MODEL_DIR> --framework=paddle
@@ -44,13 +44,13 @@ Parameters to convert your model:
* [Framework-agnostic parameters](Converting_Model.md): These parameters are used to convert a model trained with any supported framework.
> **NOTE:** `--scale`, `--scale_values`, `--mean_values` are not supported in the current version of mo_paddle.
### Example of Converting a Paddle* Model
Below is the example command to convert yolo v3 Paddle\* network to OpenVINO IR network with Model Optimizer.
### Example of Converting a PaddlePaddle Model
Below is the example command to convert yolo v3 PaddlePaddle network to OpenVINO IR network with Model Optimizer.
```sh
mo --model_name yolov3_darknet53_270e_coco --output_dir <OUTPUT_MODEL_DIR> --framework=paddle --data_type=FP32 --reverse_input_channels --input_shape=[1,3,608,608],[1,2],[1,2] --input=image,im_shape,scale_factor --output=save_infer_model/scale_0.tmp_1,save_infer_model/scale_1.tmp_1 --input_model=yolov3.pdmodel
```
## Supported Paddle\* Layers
## Supported PaddlePaddle Layers
Refer to [Supported Framework Layers](../Supported_Frameworks_Layers.md) for the list of supported standard layers.
## Frequently Asked Questions (FAQ)

View File

@@ -40,6 +40,8 @@ Here is the list of models that are tested and guaranteed to be supported. Howev
instruction which is used instead of steps 2 and 3 of [regular instructions](#typical-pytorch).
* [BERT_NER](https://github.com/kamalkraj/BERT-NER) topology can be converted using steps described in [Convert PyTorch* BERT-NER to the IR](pytorch_specific/Convert_Bert_ner.md)
instruction which is used instead of steps 2 and 3 of [regular instructions](#typical-pytorch).
* ResNeXt-101 from [facebookresearch/semi-supervised-ImageNet1K-models](https://github.com/facebookresearch/semi-supervised-ImageNet1K-models)
can be converted using [regular instructions](#typical-pytorch).
## Typical steps to convert PyTorch\* model <a name="typical-pytorch"></a>
@@ -48,8 +50,8 @@ PyTorch* framework is supported through export to ONNX\* format. A summary of th
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for ONNX\*.
2. [Export PyTorch model to ONNX\*](#export-to-onnx).
3. [Convert an ONNX\* model](Convert_Model_From_ONNX.md) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values.
4. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided [sample applications](../../../IE_DG/Samples_Overview.md).
5. [Integrate](../../../IE_DG/Samples_Overview.md) the Inference Engine in your application to deploy the model in the target environment.
4. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [sample applications](../../../OV_Runtime_UG/Samples_Overview.md).
5. [Integrate OpenVINO Runtime](../../../OV_Runtime_UG/Samples_Overview.md) in your application to deploy the model in the target environment.
## Export PyTorch\* Model to ONNX\* Format <a name="export-to-onnx"></a>

View File

@@ -2,6 +2,8 @@
@sphinxdirective
.. _convert model tf:
.. toctree::
:maxdepth: 1
:hidden:
@@ -29,14 +31,14 @@ A summary of the steps for optimizing and deploying a model that was trained wit
1. [Configure the Model Optimizer](../../Deep_Learning_Model_Optimizer_DevGuide.md) for TensorFlow\* (TensorFlow was used to train your model).
2. [Freeze the TensorFlow model](#freeze-the-tensorflow-model) if your model is not already frozen or skip this step and use the [instruction](#loading-nonfrozen-models) to a convert a non-frozen model.
3. [Convert a TensorFlow\* model](#Convert_From_TF) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values.
4. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided [sample applications](../../../IE_DG/Samples_Overview.md).
5. [Integrate](../../../IE_DG/Samples_Overview.md) the Inference Engine in your application to deploy the model in the target environment.
4. Test the model in the Intermediate Representation format using the [OpenVINO™ Runtime](../../../OV_Runtime_UG/openvino_intro.md) in the target environment via provided [sample applications](../../../OV_Runtime_UG/Samples_Overview.md).
5. [Integrate OpenVINO Runtime](../../../OV_Runtime_UG/Samples_Overview.md) in your application to deploy the model in the target environment.
## Supported Topologies
**Supported Non-Frozen Topologies with Links to the Associated Slim Model Classification Download Files**
Detailed information on how to convert models from the <a href="https://github.com/tensorflow/models/tree/master/research/slim/README.md">TensorFlow\*-Slim Image Classification Model Library</a> is available in the [Converting TensorFlow*-Slim Image Classification Model Library Models](tf_specific/Convert_Slim_Library_Models.md) chapter. The table below contains list of supported TensorFlow\*-Slim Image Classification Model Library models and required mean/scale values. The mean values are specified as if the input image is read in BGR channels order layout like Inference Engine classification sample does.
Detailed information on how to convert models from the <a href="https://github.com/tensorflow/models/tree/master/research/slim/README.md">TensorFlow\*-Slim Image Classification Model Library</a> is available in the [Converting TensorFlow*-Slim Image Classification Model Library Models](tf_specific/Convert_Slim_Library_Models.md) chapter. The table below contains list of supported TensorFlow\*-Slim Image Classification Model Library models and required mean/scale values. The mean values are specified as if the input image is read in BGR channels order layout like OpenVINO classification sample does.
| Model Name| Slim Model Checkpoint File| \-\-mean_values | \-\-scale|
| ------------- | ------------ | ------------- | -----:|
@@ -352,7 +354,7 @@ TensorFlow*-specific parameters:
mo --input_model inception_v1.pb -b 1 --tensorboard_logdir /tmp/log_dir --output_dir <OUTPUT_MODEL_DIR>
```
* Launching the Model Optimizer for a model with custom TensorFlow operations (refer to the [TensorFlow* documentation](https://www.tensorflow.org/extend/adding_an_op)) implemented in C++ and compiled into the shared library `my_custom_op.so`. Model Optimizer falls back to TensorFlow to infer output shape of operations implemented in the library if a custom TensorFlow operation library is provided. If it is not provided, a custom operation with an inference function is needed. For more information about custom operations, refer to the [Custom Layers Guide](../../../HOWTO/Custom_Layers_Guide.md).
* Launching the Model Optimizer for a model with custom TensorFlow operations (refer to the [TensorFlow* documentation](https://www.tensorflow.org/extend/adding_an_op)) implemented in C++ and compiled into the shared library `my_custom_op.so`. Model Optimizer falls back to TensorFlow to infer output shape of operations implemented in the library if a custom TensorFlow operation library is provided. If it is not provided, a custom operation with an inference function is needed. For more information about custom operations, refer to the [OpenVINO™ Extensibility Mechanism](../../../Extensibility_UG/Intro.md).
```sh
mo --input_model custom_model.pb --tensorflow_custom_layer_libraries ./my_custom_op.so --output_dir <OUTPUT_MODEL_DIR>
```

View File

@@ -24,7 +24,7 @@
To convert the model to the Intermediate Representation (IR), run Model Optimizer using the following command:
```sh
mo --input_model INPUT_MODEL --output_dir <OUTPUT_MODEL_DIR>
mo --input_model INPUT_MODEL
```
The output directory must have write permissions, so you can run Model Optimizer from the output directory or specify an output path with the `--output_dir` option.
@@ -37,6 +37,7 @@ Framework-specific parameters for:
* [TensorFlow](Convert_Model_From_TensorFlow.md)
* [MXNet](Convert_Model_From_MxNet.md)
* [ONNX](Convert_Model_From_ONNX.md)
* [PaddlePaddle](Convert_Model_From_Paddle.md)
* [Kaldi](Convert_Model_From_Kaldi.md)
@@ -70,12 +71,9 @@ Framework-agnostic parameters:
square brackets, for example [1,3,227,227] or
(1,227,227,3), where the order of dimensions depends
on the framework input layout of the model. For
example, [N,C,H,W] is used for Caffe* models and
[N,H,W,C] for TensorFlow* models. Model Optimizer
performs necessary transformations to convert the
shape to the layout required by Inference Engine
(N,C,H,W). The shape should not contain undefined
dimensions (? or -1) and should fit the dimensions
example, [N,C,H,W] is used for ONNX* models and
[N,H,W,C] for TensorFlow* models. The shape can contain
undefined dimensions (? or -1) and should fit the dimensions
defined in the input operation of the graph. Boundaries
of undefined dimension can be specified with ellipsis,
for example [1,1..10,128,128]. One boundary can be undefined,
@@ -155,13 +153,12 @@ Framework-agnostic parameters:
original model is in FP32 and --data_type=FP16 is
specified, all model weights and biases are compressed
to FP16.
--disable_fusing Turn off fusing of linear operations to Convolution
--disable_fusing [DEPRECATED] Turn off fusing of linear operations to Convolution.
--disable_resnet_optimization
Turn off resnet optimization
[DEPRECATED] Turn off ResNet optimization.
--finegrain_fusing FINEGRAIN_FUSING
Regex for layers/operations that won't be fused.
[DEPRECATED] Regex for layers/operations that won't be fused.
Example: --finegrain_fusing Convolution1,.*Scale.*
--disable_gfusing Turn off fusing of grouped convolutions
--enable_concat_optimization
Turn on Concat optimization.
--extensions EXTENSIONS
@@ -184,9 +181,9 @@ Framework-agnostic parameters:
--static_shape Enables IR generation for fixed input shape (folding
`ShapeOf` operations and shape-calculating sub-graphs
to `Constant`). Changing model input shape using
the Inference Engine API in runtime may fail for such an IR.
the OpenVINO Runtime API in runtime may fail for such an IR.
--disable_weights_compression
Disable compression and store weights with original
[DEPRECATED] Disable compression and store weights with original
precision.
--progress Enable model conversion progress display.
--stream_output Switch model conversion progress display to a
@@ -194,6 +191,13 @@ Framework-agnostic parameters:
--transformations_config TRANSFORMATIONS_CONFIG
Use the configuration file with transformations
description.
--use_new_frontend Force the usage of new Frontend of Model Optimizer for model conversion into IR.
The new Frontend is C++ based and is available for ONNX* and PaddlePaddle* models.
Model optimizer uses new Frontend for ONNX* and PaddlePaddle* by default that means
`--use_new_frontend` and `--use_legacy_frontend` options are not specified.
--use_legacy_frontend Force the usage of legacy Frontend of Model Optimizer for model conversion into IR.
The legacy Frontend is Python based and is available for TensorFlow*, ONNX*, MXNet*,
Caffe*, and Kaldi* models.
```
The sections below provide details on using particular parameters and examples of CLI commands.
@@ -203,7 +207,7 @@ Usually neural network models are trained with the normalized input data. This m
* The input pre-processing operations are a part of a topology. In this case, the application that uses the framework to infer the topology does not pre-process the input.
* The input pre-processing operations are not a part of a topology and the pre-processing is performed within the application which feeds the model with an input data.
In the first case, the Model Optimizer generates the IR with required pre-processing layers and Inference Engine samples may be used to infer the model.
In the first case, the Model Optimizer generates the IR with required pre-processing operations and OpenVINO Samples may be used to infer the model.
In the second case, information about mean/scale values should be provided to the Model Optimizer to embed it to the generated IR. Model Optimizer provides a number of command line parameters to specify them: `--mean`, `--scale`, `--scale_values`, `--mean_values`.
@@ -215,67 +219,64 @@ There is no a universal recipe for determining the mean/scale values for a parti
* Open the model in a visualization tool and check for layers performing subtraction or multiplication (like `Sub`, `Mul`, `ScaleShift`, `Eltwise` etc) of the input data. If such layers exist, pre-processing is probably part of the model.
## When to Specify Input Shapes <a name="when_to_specify_input_shapes"></a>
There are situations when the input data shape for the model is not fixed, like for the fully-convolutional neural networks. In this case, for example, TensorFlow\* models contain `-1` values in the `shape` attribute of the `Placeholder` operation. Inference Engine does not support input layers with undefined size, so if the input shapes are not defined in the model, the Model Optimizer fails to convert the model. The solution is to provide the input shape(s) using the `--input` or `--input_shape` command line parameter for all input(s) of the model or provide the batch size using the `-b` command line parameter if the model contains just one input with undefined batch size only. In the latter case, the `Placeholder` shape for the TensorFlow\* model looks like this `[-1, 224, 224, 3]`.
There are situations when Model Optimizer is unable to deduce input shapes of the model, for example, in case of model cutting due to unsupported operations.
The solution is to provide input shapes of a static rank explicitly.
## When to Reverse Input Channels <a name="when_to_reverse_input_channels"></a>
Input data for your application can be of RGB or BRG color input order. For example, Inference Engine samples load input images in the BGR channels order. However, the model may be trained on images loaded with the opposite order (for example, most TensorFlow\* models are trained with images in RGB order). In this case, inference results using the Inference Engine samples may be incorrect. The solution is to provide `--reverse_input_channels` command line parameter. Taking this parameter, the Model Optimizer performs first convolution or other channel dependent operation weights modification so these operations output will be like the image is passed with RGB channels order.
Input data for your application can be of RGB or BRG color input order. For example, OpenVINO Samples load input images in the BGR channels order. However, the model may be trained on images loaded with the opposite order (for example, most TensorFlow\* models are trained with images in RGB order). In this case, inference results using the OpenVINO samples may be incorrect. The solution is to provide `--reverse_input_channels` command line parameter. Taking this parameter, the Model Optimizer performs first convolution or other channel dependent operation weights modification so these operations output will be like the image is passed with RGB channels order.
## When to Specify `--static_shape` Command Line Parameter
If the `--static_shape` command line parameter is specified the Model Optimizer evaluates shapes of all operations in the model (shape propagation) for a fixed input(s) shape(s). During the shape propagation the Model Optimizer evaluates operations *Shape* and removes them from the computation graph. With that approach, the initial model which can consume inputs of different shapes may be converted to IR working with the input of one fixed shape only. For example, consider the case when some blob is reshaped from 4D of a shape *[N, C, H, W]* to a shape *[N, C, H \* W]*. During the model conversion the Model Optimize calculates output shape as a constant 1D blob with values *[N, C, H \* W]*. So if the input shape changes to some other value *[N,C,H1,W1]* (it is possible scenario for a fully convolutional model) then the reshape layer becomes invalid.
Resulting Intermediate Representation will not be resizable with the help of Inference Engine.
Resulting Intermediate Representation will not be resizable with the help of OpenVINO Runtime API.
## Examples of CLI Commands
Launch the Model Optimizer for the Caffe bvlc_alexnet model with debug log level:
```sh
mo --input_model bvlc_alexnet.caffemodel --log_level DEBUG --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --log_level DEBUG
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with the output IR called `result.*` in the specified `output_dir`:
```sh
mo --input_model bvlc_alexnet.caffemodel --model_name result --output_dir /../../models/
mo --input_model bvlc_alexnet.caffemodel --model_name result --output_dir <OUTPUT_MODEL_DIR>
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with one input with scale values:
```sh
mo --input_model bvlc_alexnet.caffemodel --scale_values [59,59,59] --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --scale_values [59,59,59]
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with multiple inputs with scale values:
```sh
mo --input_model bvlc_alexnet.caffemodel --input data,rois --scale_values [59,59,59],[5,5,5] --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --input data,rois --scale_values [59,59,59],[5,5,5]
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with multiple inputs with scale and mean values specified for the particular nodes:
```sh
mo --input_model bvlc_alexnet.caffemodel --input data,rois --mean_values data[59,59,59] --scale_values rois[5,5,5] --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --input data,rois --mean_values data[59,59,59] --scale_values rois[5,5,5]
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with specified input layer, overridden input shape, scale 5, batch 8 and specified name of an output operation:
```sh
mo --input_model bvlc_alexnet.caffemodel --input "data[1 3 224 224]" --output pool5 -s 5 -b 8 --output_dir <OUTPUT_MODEL_DIR>
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with disabled fusing for linear operations to Convolution and grouped convolutions:
```sh
mo --input_model bvlc_alexnet.caffemodel --disable_fusing --disable_gfusing --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --input data --output pool5 -s 5 -b 8
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with reversed input channels order between RGB and BGR, specified mean values to be used for the input image per channel and specified data type for input tensor values:
```sh
mo --input_model bvlc_alexnet.caffemodel --reverse_input_channels --mean_values [255,255,255] --data_type FP16 --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --reverse_input_channels --mean_values [255,255,255] --data_type FP16
```
Launch the Model Optimizer for the Caffe bvlc_alexnet model with extensions listed in specified directories, specified mean_images binaryproto
file. For more information about extensions, please refer to the [Custom Layers Guide](../../../HOWTO/Custom_Layers_Guide.md).
file. For more information about extensions, please refer to the [OpenVINO™ Extensibility Mechanism](../../../Extensibility_UG/Intro.md).
```sh
mo --input_model bvlc_alexnet.caffemodel --extensions /home/,/some/other/path/ --mean_file /path/to/binaryproto --output_dir <OUTPUT_MODEL_DIR>
mo --input_model bvlc_alexnet.caffemodel --extensions /home/,/some/other/path/ --mean_file /path/to/binaryproto
```
Launch the Model Optimizer for TensorFlow* FaceNet* model with a placeholder freezing value.
It replaces the placeholder with a constant layer that contains the passed value.
For more information about FaceNet conversion, please refer to [this](tf_specific/Convert_FaceNet_From_Tensorflow.md) page.
```sh
mo --input_model FaceNet.pb --input "phase_train->False" --output_dir <OUTPUT_MODEL_DIR>
mo --input_model FaceNet.pb --input "phase_train->False"
```
Launch the Model Optimizer for any model with a placeholder freezing tensor of values.
It replaces the placeholder with a constant layer that contains the passed values.
@@ -284,7 +285,7 @@ Tensor here is represented in square brackets with each value separated from ano
If data type is set in the model, this tensor will be reshaped to a placeholder shape and casted to placeholder data type.
Otherwise, it will be casted to data type passed to `--data_type` parameter (by default, it is FP32).
```sh
mo --input_model FaceNet.pb --input "placeholder_layer_name->[0.1 1.2 2.3]" --output_dir <OUTPUT_MODEL_DIR>
mo --input_model FaceNet.pb --input "placeholder_layer_name->[0.1 1.2 2.3]"
```

View File

@@ -6,10 +6,10 @@ Sometimes some parts of a model must be removed while the Model Optimizer is con
The following examples are the situations when model cutting is useful or even required:
* model has pre- or post-processing parts that cannot be translated to existing Inference Engine layers.
* model has pre- or post-processing parts that cannot be translated to existing OpenVINO operations.
* model has a training part that is convenient to be kept in the model, but not used during inference.
* model is too complex (contains lots of unsupported operations that cannot be easily implemented as custom layers), so the complete model cannot be converted in one shot.
* problem with model conversion in the Model Optimizer or inference in the Inference Engine occurred. To localize the issue, limit the scope for conversion by iteratively searching for problematic places in the model.
* problem with model conversion in the Model Optimizer or inference in the OpenVINO Runtime occurred. To localize the issue, limit the scope for conversion by iteratively searching for problematic places in the model.
* single custom layer or a combination of custom layers is isolated for debugging purposes.
## Command-Line Options

View File

@@ -2,8 +2,8 @@
## Introduction
Inference Engine CPU and GPU plugin can infer models in the low precision.
For details, refer to [Low Precision Inference on the CPU](../../../IE_DG/Int8Inference.md).
OpenVINO Runtime CPU and GPU devices can infer models in the low precision.
For details, refer to [Low Precision Inference on the CPU](../../../OV_Runtime_UG/Int8Inference.md).
Intermediate Representation (IR) should be specifically formed to be suitable for low precision inference.
Such an IR is called a Low Precision IR and you can generate it in two ways:

View File

@@ -114,4 +114,4 @@ cp models/13_decoder_auxs.nd nst_model
```sh
mo --input_symbol <path/to/nst_model>/nst_vgg19-symbol.json --framework mxnet --output_dir <path/to/output_dir> --input_shape [1,3,224,224] --nd_prefix_name 13_decoder --pretrained_model <path/to/nst_model>/vgg19-0000.params
```
4. The IR is generated (`.bin`, `.xml` and `.mapping` files) in the specified output directory and ready to be consumed by the Inference Engine.
4. The IR is generated (`.bin`, `.xml` and `.mapping` files) in the specified output directory and ready to be consumed by the OpenVINO Runtime.

View File

@@ -104,5 +104,5 @@ mo --input_model rnnt_prediction.onnx --input "symbol[1 1],hidden_in_1[2 1 320],
mo --input_model rnnt_joint.onnx --input "0[1 1 1024],1[1 1 320]"
```
Please note that hardcoded value for sequence length = 157 was taken from the MLCommons but conversion to IR preserves
network [reshapeability](../../../../IE_DG/ShapeInference.md), this means you can change input shapes manually to any value either during conversion or
network [reshapeability](../../../../OV_Runtime_UG/ShapeInference.md), this means you can change input shapes manually to any value either during conversion or
inference.

View File

@@ -116,4 +116,4 @@ Run the Model Optimizer with the following command line parameters to generate r
```
For other applicable parameters, refer to [Convert Model from TensorFlow](../Convert_Model_From_TensorFlow.md).
For more information about reshape abilities, refer to [Using Shape Inference](../../../../IE_DG/ShapeInference.md).
For more information about reshape abilities, refer to [Using Shape Inference](../../../../OV_Runtime_UG/ShapeInference.md).

View File

@@ -47,7 +47,7 @@ There are two specificities with the supported part of the model.
The first is that the model contains an input with sequence length. So the model can be converted with
a fixed input length shape, thus the model is not reshapeable.
Refer to the [Using Shape Inference](../../../../IE_DG/ShapeInference.md).
Refer to the [Using Shape Inference](../../../../OV_Runtime_UG/ShapeInference.md).
The second is that the frozen model still has two variables: `previous_state_c` and `previous_state_h`, figure
with the frozen *.pb model is below. It means that the model keeps training these variables at each inference.

View File

@@ -244,7 +244,7 @@ python3 benchmark_app.py -m <path to the generated GNMT IR> -d CPU
```
2. With Inference Engine Python API:
2. With OpenVINO Runtime Python API:
> **NOTE**: Before running the example, insert a path to your GNMT `.xml` and `.bin` files into `MODEL_PATH` and `WEIGHTS_PATH`, and fill `input_data_tensor` and `seq_lengths` tensors according to your input data.
@@ -274,4 +274,4 @@ exec_net = ie.load_network(network=net, device_name="CPU")
result_ie = exec_net.infer(input_data)
```
For more information about Python API, refer to [Inference Engine Python API](ie_python_api/api.html).
For more information about Python API, refer to [OpenVINO Runtime Python API](ie_python_api/api.html).

View File

@@ -2,8 +2,8 @@
> **NOTES**:
> * Starting with the 2022.1 release, the Model Optimizer can convert the TensorFlow\* Object Detection API Faster and Mask RCNNs topologies differently. By default, the Model Optimizer adds operation "Proposal" to the generated IR. This operation needs an additional input to the model with name "image_info" which should be fed with several values describing the pre-processing applied to the input image (refer to the [Proposal](../../../../ops/detection/Proposal_4.md) operation specification for more information). However, this input is redundant for the models trained and inferred with equal size images. Model Optimizer can generate IR for such models and insert operation [DetectionOutput](../../../../ops/detection/DetectionOutput_1.md) instead of `Proposal`. The `DetectionOutput` operation does not require additional model input "image_info" and moreover, for some models the produced inference results are closer to the original TensorFlow\* model. In order to trigger new behaviour the attribute "operation_to_add" in the corresponding JSON transformation configuration file should be set to value "DetectionOutput" instead of default one "Proposal".
> * Starting with the 2021.1 release, the Model Optimizer converts the TensorFlow\* Object Detection API SSDs, Faster and Mask RCNNs topologies keeping shape-calculating sub-graphs by default, so topologies can be re-shaped in the Inference Engine using dedicated reshape API. Refer to [Using Shape Inference](../../../../IE_DG/ShapeInference.md) for more information on how to use this feature. It is possible to change the both spatial dimensions of the input image and batch size.
> * To generate IRs for TF 1 SSD topologies, the Model Optimizer creates a number of `PriorBoxClustered` operations instead of a constant node with prior boxes calculated for the particular input image size. This change allows you to reshape the topology in the Inference Engine using dedicated Inference Engine API. The reshaping is supported for all SSD topologies except FPNs which contain hardcoded shapes for some operations preventing from changing topology input shape.
> * Starting with the 2021.1 release, the Model Optimizer converts the TensorFlow\* Object Detection API SSDs, Faster and Mask RCNNs topologies keeping shape-calculating sub-graphs by default, so topologies can be re-shaped in the OpenVINO Runtime using dedicated reshape API. Refer to [Using Shape Inference](../../../../OV_Runtime_UG/ShapeInference.md) for more information on how to use this feature. It is possible to change the both spatial dimensions of the input image and batch size.
> * To generate IRs for TF 1 SSD topologies, the Model Optimizer creates a number of `PriorBoxClustered` operations instead of a constant node with prior boxes calculated for the particular input image size. This change allows you to reshape the topology in the OpenVINO Runtime using dedicated API. The reshaping is supported for all SSD topologies except FPNs which contain hardcoded shapes for some operations preventing from changing topology input shape.
## How to Convert a Model
@@ -45,7 +45,7 @@ To convert a TensorFlow\* Object Detection API model, go to the `<INSTALL_DIR>/t
* `--tensorflow_object_detection_api_pipeline_config <path_to_pipeline.config>` --- A special configuration file that describes the topology hyper-parameters and structure of the TensorFlow Object Detection API model. For the models downloaded from the TensorFlow\* Object Detection API zoo, the configuration file is named `pipeline.config`. If you plan to train a model yourself, you can find templates for these files in the [models repository](https://github.com/tensorflow/models/tree/master/research/object_detection/samples/configs).
* `--input_shape` (optional) --- A custom input image shape. Refer to [Custom Input Shape](#tf_od_custom_input_shape) for more information how the `--input_shape` parameter is handled for the TensorFlow* Object Detection API models.
> **NOTE**: The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the `RGB<->BGR` conversion specifying the command-line parameter: `--reverse_input_channels`. Otherwise, inference results may be incorrect. If you convert a TensorFlow\* Object Detection API model to use with the Inference Engine sample applications, you must specify the `--reverse_input_channels` parameter. For more information about the parameter, refer to **When to Reverse Input Channels** section of [Converting a Model to Intermediate Representation (IR)](../Converting_Model.md).
> **NOTE**: The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the `RGB<->BGR` conversion specifying the command-line parameter: `--reverse_input_channels`. Otherwise, inference results may be incorrect. If you convert a TensorFlow\* Object Detection API model to use with the OpenVINO sample applications, you must specify the `--reverse_input_channels` parameter. For more information about the parameter, refer to **When to Reverse Input Channels** section of [Converting a Model to Intermediate Representation (IR)](../Converting_Model.md).
Additionally to the mandatory parameters listed above you can use optional conversion parameters if needed. A full list of parameters is available in the [Converting a TensorFlow* Model](../Convert_Model_From_TensorFlow.md) topic.
@@ -57,24 +57,24 @@ mo --input_model=/tmp/ssd_inception_v2_coco_2018_01_28/frozen_inference_graph.pb
## OpenVINO&; Toolkit Samples and Open Model Zoo Demos
Inference Engine comes with a number of samples to demonstrate use of OpenVINO API, additionally,
OpenVINO comes with a number of samples to demonstrate use of OpenVINO Runtime API, additionally,
Open Model Zoo provides set of demo applications to show implementation of close to real life applications
based on deep learning in various tasks, including Image Classifiacton, Visual Object Detection, Text Recognition,
Speech Recognition, Natural Language Processing and others. Refer to the links below for more details.
* [Inference Engine Samples](../../../../IE_DG/Samples_Overview.md)
* [OpenVINO Samples](../../../../OV_Runtime_UG/Samples_Overview.md)
* [Open Model Zoo Demos](@ref omz_demos)
## Important Notes About Feeding Input Images to the Samples
There are several important notes about feeding input images to the samples:
1. Inference Engine samples stretch input image to the size of the input operation without preserving aspect ratio. This behavior is usually correct for most topologies (including SSDs), but incorrect for other models like Faster R-CNN, Mask R-CNN and R-FCN. These models usually use keeps aspect ratio resizer. The type of pre-processing is defined in the pipeline configuration file in the section `image_resizer`. If keeping aspect ratio is used, then it is necessary to resize image before passing it to the sample and optionally pad the resized image with 0s (if the attribute "pad_to_max_dimension" in the pipeline.config is equal to "true").
1. OpenVINO samples stretch input image to the size of the input operation without preserving aspect ratio. This behavior is usually correct for most topologies (including SSDs), but incorrect for other models like Faster R-CNN, Mask R-CNN and R-FCN. These models usually use keeps aspect ratio resizer. The type of pre-processing is defined in the pipeline configuration file in the section `image_resizer`. If keeping aspect ratio is used, then it is necessary to resize image before passing it to the sample and optionally pad the resized image with 0s (if the attribute "pad_to_max_dimension" in the pipeline.config is equal to "true").
2. TensorFlow\* implementation of image resize may be different from the one implemented in the sample. Even reading input image from compressed format (like `.jpg`) could give different results in the sample and TensorFlow\*. So, if it is necessary to compare accuracy between the TensorFlow\* and the Inference Engine it is recommended to pass pre-resized input image in a non-compressed format (like `.bmp`).
2. TensorFlow\* implementation of image resize may be different from the one implemented in the sample. Even reading input image from compressed format (like `.jpg`) could give different results in the sample and TensorFlow\*. So, if it is necessary to compare accuracy between the TensorFlow\* and the OpenVINO it is recommended to pass pre-resized input image in a non-compressed format (like `.bmp`).
3. If you want to infer the model with the Inference Engine samples, convert the model specifying the `--reverse_input_channels` command line parameter. The samples load images in BGR channels order, while TensorFlow* models were trained with images in RGB order. When the `--reverse_input_channels` command line parameter is specified, the Model Optimizer performs first convolution or other channel dependent operation weights modification so the output will be like the image is passed with RGB channels order.
3. If you want to infer the model with the OpenVINO samples, convert the model specifying the `--reverse_input_channels` command line parameter. The samples load images in BGR channels order, while TensorFlow* models were trained with images in RGB order. When the `--reverse_input_channels` command line parameter is specified, the Model Optimizer performs first convolution or other channel dependent operation weights modification so the output will be like the image is passed with RGB channels order.
4. Read carefully messaged printed by the Model Optimizer during a model conversion. They contain important instructions on how to prepare input data before running the inference and how to interpret the output.

View File

@@ -64,7 +64,7 @@ The `-b` command line parameter is required because the Model Optimizer cannot c
Refer to the [Mean and Scale Values for TensorFlow\*-Slim Models](#tf_slim_mean_scale_values) for the information why `--mean_values` and `--scale` command line parameters are used.
## Mean and Scale Values for TensorFlow\*-Slim Models <a name="tf_slim_mean_scale_values"></a>
The TensorFlow\*-Slim Models were trained with normalized input data. There are several different normalization algorithms used in the Slim library. Inference Engine classification sample does not perform image pre-processing except resizing to the input layer size. It is necessary to pass mean and scale values to the Model Optimizer so they are embedded into the generated IR in order to get correct classification results.
The TensorFlow\*-Slim Models were trained with normalized input data. There are several different normalization algorithms used in the Slim library. OpenVINO classification sample does not perform image pre-processing except resizing to the input layer size. It is necessary to pass mean and scale values to the Model Optimizer so they are embedded into the generated IR in order to get correct classification results.
The file [preprocessing_factory.py](https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/preprocessing_factory.py) contains a dictionary variable `preprocessing_fn_map` defining mapping between the model type and pre-processing function to be used. The function code should be analyzed to figure out the mean/scale values.
@@ -83,7 +83,7 @@ The [inception_preprocessing.py](https://github.com/tensorflow/models/blob/maste
Firstly, the `image` is converted to data type `tf.float32` and the values in the tensor are scaled to the `[0, 1]` range using the [tf.image.convert_image_dtype](https://www.tensorflow.org/api_docs/python/tf/image/convert_image_dtype) function. Then the `0.5` is subtracted from the image values and values multiplied by `2.0`. The final image range of values is `[-1, 1]`.
Inference Engine classification sample reads an input image as a three-dimensional array of integer values from the range `[0, 255]`. In order to scale them to `[-1, 1]` range, the mean value `127.5` for each image channel should be specified as well as scale factor `127.5`.
OpenVINO classification sample reads an input image as a three-dimensional array of integer values from the range `[0, 255]`. In order to scale them to `[-1, 1]` range, the mean value `127.5` for each image channel should be specified as well as scale factor `127.5`.
Similarly, the mean/scale values can be determined for other Slim models.

View File

@@ -65,13 +65,14 @@ cd tensorflow-yolo-v3
```sh
git checkout ed60b90
```
3. Download [coco.names](https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names) file from the DarkNet website **OR** use labels that fit your task.
3. Download [coco.names](https://github.com/AlexeyAB/darknet/blob/master/data/coco.names) file from the DarkNet website **OR** use labels that fit your task.
4. Download the [yolov3.weights](https://pjreddie.com/media/files/yolov3.weights) (for the YOLOv3 model) or [yolov3-tiny.weights](https://pjreddie.com/media/files/yolov3-tiny.weights) (for the YOLOv3-tiny model) file **OR** use your pre-trained weights with the same structure.
5. Install PIL, which is used by the conversion script in the repo:
```sh
pip install PIL
pip install pillow
```
6. Run a converter:
> **NOTE**: This converter works with TensorFlow 1.x and numpy 1.19 or lower.
- For YOLO-v3:
```sh
python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3.weights
@@ -116,7 +117,7 @@ where:
- `custom_attributes` is a parameter that stores all the YOLOv3 specific attributes:
- `classes`, `coords`, `num`, and `masks` are attributes that you should copy from the configuration
file that was used for model training. If you used DarkNet officially shared weights,
you can use `yolov3.cfg` or `yolov3-tiny.cfg` configuration file from https://github.com/pjreddie/darknet/tree/master/cfg. Replace the default values in `custom_attributes` with the parameters that
you can use `yolov3.cfg` or `yolov3-tiny.cfg` configuration file from https://github.com/david8862/keras-YOLOv3-model-set/tree/master/cfg. Replace the default values in `custom_attributes` with the parameters that
follow the `[yolo]` titles in the configuration file.
- `anchors` is an optional parameter that is not used while inference of the model, but it used in a demo to parse `Region` layer output
- `entry_points` is a node name list to cut off the model and append the Region layer with custom attributes specified above.

View File

@@ -157,7 +157,7 @@ the following (for the case when `axis` is not equal to 0 and 1):
4. Use the concatenated value as the second input to the `Reshape` operation.
It is highly recommended that you write shape-agnostic transformations to avoid model reshape-ability issues. Refer to
[Using Shape Inference](../../../IE_DG/ShapeInference.md) for more information related to the reshaping of a model.
[Using Shape Inference](../../../OV_Runtime_UG/ShapeInference.md) for more information related to the reshaping of a model.
More information on how to develop front phase transformations and dedicated API description is provided in the
[Front Phase Transformations](#front-phase-transformations).
@@ -171,15 +171,15 @@ defined as a mathematical expression using the [ShapeOf](../../../ops/shape/Shap
> **NOTE**: Model Optimizer does not fold sub-graphs starting from the [ShapeOf](../../../ops/shape/ShapeOf_3.md)
> operation by default because this leads to a model non-reshape-ability (the command line parameter `--static_shape`
> can override this behavior). Refer to [Using Shape Inference](../../../IE_DG/ShapeInference.md) for more information
> can override this behavior). Refer to [Using Shape Inference](../../../OV_Runtime_UG/ShapeInference.md) for more information
> related to reshaping of a model.
Model Optimizer calculates output shapes for all operations in a model to write them to Intermediate Representation
files.
> **NOTE**: This is a legacy requirement because starting from IR version 10 Inference Engine needs to know shapes of
> **NOTE**: This is a legacy requirement because starting from IR version 10 OpenVINO Runtime needs to know shapes of
> the [Const](../../../ops/infrastructure/Constant_1.md) and the [Parameter](../../../ops/infrastructure/Parameter_1.md)
> operations only. The nGraph component of the Inference Engine calculates output shapes for all operations in a model
> operations only. The OpenVINO Runtime calculates output shapes for all operations in a model
> using shapes of [Parameter](../../../ops/infrastructure/Parameter_1.md) and
> [Const](../../../ops/infrastructure/Constant_1.md) operations defined with respective operation attributes.
@@ -257,11 +257,13 @@ More information on how to develop middle transformations and dedicated API desc
[Middle Phase Transformations](#middle-phase-transformations).
### NHWC to NCHW Layout Change <a name="layout-change"></a>
There are several middle transformations responsible for changing model layout from NHWC to NCHW. These transformations
are triggered by default for TensorFlow\* models only because it is the only framework with Convolution operations in
NHWC layout. This layout change is disabled if the model does not have operations that OpenVINO&trade needs to execute in
NCHW layout, for example, Convolutions in NHWC layout. It is still possible to force Model Optimizer to do layout change
using `--disable_nhwc_to_nchw` command-line parameter.
There are several middle transformations responsible for changing model layout from NHWC to NCHW. These transformations are triggered by default for TensorFlow models as TensorFlow supports Convolution operations in the NHWC layout.
This layout change is disabled automatically if the model does not have operations that OpenVINO&trade needs to execute in the NCHW layout, for example, Convolutions in NHWC layout.
It is still possible to force Model Optimizer to do layout change, using `--disable_nhwc_to_nchw` command-line parameter, although it is not advised.
The layout change is a complex problem and detailed explanation of it is out of this document scope. A very brief
explanation of this process is provided below:
@@ -301,7 +303,7 @@ The last phase of a model conversion is the Intermediate Representation emitting
steps:
1. Iterates over all operation nodes in the graph and checks that all nodes have the `type` attribute set. This attribute
defines the operation type and is used in the Inference Engine to instantiate proper operation from the
defines the operation type and is used in the OpenVINO to instantiate proper operation from the
[opset](@ref openvino_docs_ops_opset) specified in the `version` attribute of the node. If some node does not have
attribute `type` or its values is equal to `None`, the Model Optimizer exits with an error.
2. Performs type inference of graph operations similar to the shape inference. Inferred data types are saved to a port
@@ -507,7 +509,7 @@ There are a number of common attributes used in the operations. Here is the list
Model Optimizer operations this attribute should be set to `None`. The model conversion fails if an operation with
`type` equal to `None` comes to the IR emitting phase. **Mandatory**.
* `version` — the operation set (opset) name the operation belongs to. If not specified, the Model Optimizer sets it
equal to `experimental`. Refer to [nGraph Basic Concepts](@ref openvino_docs_nGraph_DG_basic_concepts) for more
equal to `experimental`. Refer to [OpenVINO Model Representation](@ref openvino_docs_OV_Runtime_UG_Model_Representation) for more
information about operation sets. **Mandatory**.
* `op` — Model Optimizer type of the operation. In many cases, the value of `type` is equal to the value of `op`. But
when the Model Optimizer cannot instantiate the opset operation during model loading, it creates an instance of an internal
@@ -741,8 +743,7 @@ sub-graph of the original graph isomorphic to the specified pattern.
2. [Specific Operation Front Phase Transformations](#specific-operation-front-phase-transformations) triggered for the
node with a specific `op` attribute value.
3. [Generic Front Phase Transformations](#generic-front-phase-transformations).
4. Manually enabled transformation defined with a JSON configuration file (for TensorFlow\*, ONNX\* and MXNet\* models
only) specified using the `--transformations_config` command line parameter:
4. Manually enabled transformation defined with a JSON configuration file (for TensorFlow, ONNX, MXNet, and PaddlePaddle models) specified using the `--transformations_config` command line parameter:
1. [Node Name Pattern Front Phase Transformations](#node-name-pattern-front-phase-transformation).
2. [Front Phase Transformations Using Start and End Points](#start-end-points-front-phase-transformations).
3. [Generic Front Phase Transformations Enabled with Transformations Configuration File](#generic-transformations-config-front-phase-transformations).
@@ -1259,6 +1260,6 @@ Refer to the `extensions/back/GatherNormalizer.py` for the example of a such typ
## See Also <a name="see-also"></a>
* [Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™](../../IR_and_opsets.md)
* [Converting a Model to Intermediate Representation (IR)](../convert_model/Converting_Model.md)
* [nGraph Basic Concepts](../../../nGraph_DG/nGraph_basic_concepts.md)
* [Inference Engine Extensibility Mechanism](../../../IE_DG/Extensibility_DG/Intro.md)
* [OpenVINO Model Representation](../../../OV_Runtime_UG/model_representation.md)
* [OpenVINO™ Extensibility Mechanism](../../../Extensibility_UG/Intro.md)
* [Extending the Model Optimizer with Caffe* Python Layers](Extending_Model_Optimizer_with_Caffe_Python_Layers.md)

View File

@@ -0,0 +1,9 @@
# OpenVINO™ Runtime API Changes History {#openvino_docs_OV_Runtime_API_Changes}
The sections below contain detailed list of changes made to the OpenVINO™ Runtime API in recent releases.
## 2022.1
### New API
* The OpenVINO™ 2.0 API was introduced.

View File

@@ -26,7 +26,7 @@ There are two ways to check if CPU device can support bfloat16 computations for
1. Query the instruction set using one of these system commands:
* `lscpu | grep avx512_bf16`
* `cat /proc/cpuinfo | grep avx512_bf16`
2. Use the [Query API](InferenceEngine_QueryAPI.md) with `METRIC_KEY(OPTIMIZATION_CAPABILITIES)`, which should return `BF16` in the list of CPU optimization options:
2. Use the [Configure devices](supported_plugins/config_properties.md) with `METRIC_KEY(OPTIMIZATION_CAPABILITIES)`, which should return `BF16` in the list of CPU optimization options:
@snippet snippets/Bfloat16Inference0.cpp part0

View File

@@ -1,4 +1,4 @@
# Using Dynamic Batching {#openvino_docs_IE_DG_DynamicBatching}
# Working with dynamic shapes {#openvino_docs_IE_DG_DynamicBatching}
## Using Dynamic Batching (C++)

Some files were not shown because too many files have changed in this diff Show More