Compare commits

...

719 Commits

Author SHA1 Message Date
Fang Xu
4ade0e5533 fix wheel_blacklist_extension for macos (#16799) 2023-04-07 11:28:56 +04:00
Yuan Hu
06cacfe2a7 Revert "[CPU] optimize shape infer of Reshape (#16537)" (#16703)
This reverts commit 75c62ea320.
2023-04-07 06:18:58 +00:00
Roman Lyamin
132b657977 [GPU] Added GatherND dynamic support and changed logic for empty tensor support (#16690) 2023-04-07 09:19:05 +04:00
Vladimir Paramuzov
6d82f36050 Enable nop elimination for f16 type (#16749) 2023-04-07 09:18:27 +04:00
Xuejun Zhai
3be946371d Xuejun/remove api tensor related (#15877)
* [Remove APIs] remove api set_partial_shape()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove api set_element_type()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove api set_tensor_type()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Revert "[Remove APIs] remove api set_tensor_type()"

This reverts commit 96f89e222d.

* Revert "[Remove APIs] remove api set_element_type()"

This reverts commit 33ebb61977.

* Apply suggestions from code review

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
Co-authored-by: Evgenya Stepyreva <eva.my.link@gmail.com>
Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2023-04-07 06:37:25 +02:00
Eddy Kim
07437eec1e updated to store dims and data type for binary post ops (#16792) 2023-04-06 20:13:53 -07:00
yanlan song
51967fd27b Optimize and fix fps number in log (#16615)
* fix in correct fps with cpu_help

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

* fix some threading issue

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

* indenting

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

* fix lock

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

* formatting

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

* do print in destructor, avoid CI script parse failure

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

* fix build warning

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

---------

Signed-off-by: fishbell <bell.song@intel.com>
2023-04-07 09:31:40 +08:00
Eddy Kim
df4d7bd3e9 fix uninitialized scalar variables (#16772) 2023-04-06 17:28:45 -07:00
Mingyu Kim
e17a6f29bf [GPU] Use unique symbol name for typedef (#16777) 2023-04-07 09:03:28 +09:00
Paul Youngsoo Ahn
24ab3f7c41 [GPU] Fix sub kernel ordering issue in kernels_cache (#16746)
* [GPU] Fix sub kernel ordering issue in kernels_cache (#16746)

* [GPU] Add unit test for sub kernel idx (#16746)

* [GPU]Follow up code review (#16746)

* [GPU] Skip kernel compilation when current node is optimized out in update_impl (#16746)

* [GPU]Code refactoring (#16746)
2023-04-06 12:44:25 -07:00
Nadezhda Ageeva
5e2f424fd0 [HETERO] Enable smoke_Hetero_CachingSupportCase tests (#16711) 2023-04-06 21:19:37 +04:00
Zlobin Vladimir
c7c7c4bb05 samples/cpp remove unused code (#16787) 2023-04-06 20:59:00 +04:00
Ivan Tikhonov
4812879318 Enable transformation callback for TS transformations (#16767) 2023-04-06 20:42:01 +04:00
Ilya Lavrenov
d2deae225a Added rpath for TBB libs to find hwloc (#16788) 2023-04-06 20:33:32 +04:00
Sofya Balandina
5ccc743707 [apiConformance] Fix relative all (#16518) 2023-04-06 18:24:13 +02:00
Vladislav Golubev
5f416dc4d2 [LPT] Introduced BiasAttribute (#16781)
* Extended check on ConvSum fusing

* [LPT] Introduced 'bias' rt attribute

* [CPU][TESTS] Added FQLayerDQBias tests
2023-04-06 16:01:04 +00:00
Anastasiia Pnevskaia
906ec7ee1b Fixed command lines in MO docs. (#16780)
* Fixed command lines in docs.

* Removed freezing from tutorial.
2023-04-06 18:30:59 +04:00
Jan Iwaszkiewicz
92eb62fe63 [PyOV] Fix getting all names in OVDict (#16665)
* [PyOV] Fix getting all names in OVDict

* Add docs and adjust tests

* Fix linter issues

* Adjust typing and add test for incorrect key type

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-04-06 14:44:37 +02:00
Ilya Lavrenov
d732024ccb Extended a list of libraries to exclude from wheel package (#16764) 2023-04-06 16:37:11 +04:00
Tomasz Jankowski
cb436112b2 [Transformations] Assert valid output shape on ReduceReshape fusion (#16712)
* Assert valid output shape on ReduceReshape fusion

* Remove useless test step

* Reduce tests flow

* _dummy_

to retrigger failed nonrestartable check
2023-04-06 11:55:57 +00:00
Ilya Churaev
cafc7359c5 Set test case name for ReshapeMatMul tests (#16705)
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-04-06 15:40:20 +04:00
Anastasia Kuporosova
dbe051aa79 [POT] use serialize methid (#16768) 2023-04-06 15:02:24 +04:00
Katarzyna Mitrus
7a5c472ccc [ShapeInference] Fix Group Convolution shape infer - relax inputs size check (#16707)
* Relax group conv inputs size check

* Tests

* Relax inputs size checks for Backprop Convs
2023-04-06 10:59:37 +00:00
Min, Byungil
932a668a2f [GPU] Bugfix in reorder_bfyx_to_blocked_format kernel (#16689)
+ Bugfix bfyx_to_blocked_format kernel of reorder prim for doubl blocked format
+ issued format is bs_fs_yx_bsv16_fsv32. Added test-cases.
+ Fixed accuracy issue from check_accuracy_issue

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2023-04-06 18:08:34 +09:00
Marcin Kusmierski
bc0c8374da [GNA] Fix issues with GNA 3.5 - Increasing kernel to stride for Convolution2D (#16642)
* [GNA] Add increasing kernel in case stride is bigger than kernel.

* [GNA] fix review comments
2023-04-06 09:34:38 +01:00
Wang Wangwang
53d9b26e1f [AUTO] Show the detailed failure message when AUTO load network failed (#16297)
* Show the detailed failure message when AUTO load network failed

* Add test case

* Update test case to check multi load network failed

* Update test case based master

* RM _availableDevices hard code from AUTO

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
2023-04-06 15:41:32 +08:00
Vladimir Paramuzov
b2a64e8c3a [GPU] Enable dynamic shapes support for gather elements (#16727) 2023-04-06 11:14:36 +04:00
Shen, Wanglei
9f0e557744 HOT FIX: update cpu map calculation for Windows to avoid incorrect total number of processors (#16763)
* update cpu map calculation for Windows

* update typo

* update typo

* update for hybrid CPU

* update for hybrid CPU

* update for typo
2023-04-06 15:08:42 +08:00
Ilya Churaev
70ef0b5316 Minimize rebuild for Makefiles generator (#16729)
* Add dependency from ov_plugins.hpp only for files which use it

* Remove rebuild files depends on CI_BUILD_NUMBER changes

* Try to fix static build

* Fixed comments

* Fixed build

* Merged some change

* Try to fix build

* Try to fix nvidia build

* Take LTO value from target property
2023-04-06 11:02:28 +04:00
Ilya Churaev
f2894d09e9 Fixed windows build after #16716 (#16773) 2023-04-06 11:02:10 +04:00
Roman Lyamin
38c8a3d15b [GPU] Added custom canonicalize_shapes for Gather (#16733) 2023-04-06 10:50:57 +04:00
Wang Wangwang
362389c733 [DOCS][AUTO] Add enable_runtime_fallback property to AUTO Device Sele… (#16645)
* [DOCS][AUTO] Add enable_runtime_fallback property to AUTO Device Selection article

* Update docs/OV_Runtime_UG/auto_device_selection.md

Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>

* Update docs/OV_Runtime_UG/auto_device_selection.md

Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>

* Update docs/OV_Runtime_UG/auto_device_selection.md

---------

Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>
2023-04-06 14:35:55 +08:00
Sun Xiaoxia
f95fd27c16 HOT FIX: CPU binding cannot follow numactl's control (#16736)
* fix numactl command issue

* fix comments
2023-04-06 13:47:34 +08:00
Oleg Pipikin
1c564226f3 Deprecate util functions in public api (#16716)
* Deprecate util functions in public api

* Add deprecation suppression for usage inside openvino

* Fix clang-format

* Fix1
2023-04-06 06:32:04 +04:00
Roman Kazantsev
6e97c82c97 [Spec] Fix Interpolate specification: input index port (#16762) 2023-04-05 23:01:02 +04:00
Anastasia Kuporosova
2e0bac34db [PyOV] Fix warnings (#16674)
* [PyOV] Fix warnings

* another win

* fix codestyle

* fix test

* fix any

* exclude some warnings
2023-04-05 20:01:43 +02:00
Irina Efode
ff8f361778 [CONFORMANCE] Solve the problem to generate filters (#16713)
* [CONFORMANCE] Solve the problem to generate filters

* trigger linux build

* Add handling of not run tests

* Remove extra
2023-04-05 21:25:05 +04:00
Sebastian Golebiewski
8c2766c4bc DOCS shift to rst - Converting TensorFlow YOLO Models (#16735)
Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2023-04-05 16:49:43 +02:00
Vitaliy Urusovskij
7442a17240 Add Core property to switch from mmap to read in IR Frontend (#16600)
* Add Core property to switch from `mmap` to `read`
in IR FrontEnd

* Add tests on `ov::enable_mmap` property

* Add `enable_mmap` in C & Py APIs

* ClangFormat
2023-04-05 18:22:11 +04:00
Sungeun Kim
fef04e468a [GPU] add WA to avoid hang issue. (#16724) 2023-04-05 16:32:42 +04:00
Andrew Kwangwoong Park
44cfbea9ab [GPU] Fix synchronization issue from wrong stream in multi-stream mode on dGPU (#16671)
Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-04-05 16:29:47 +04:00
Vladimir Paramuzov
f5e199c494 [GPU] Don't reorder weights when can reinterpret (#16714)
* [GPU] Don't reorder weights when can reinterpret

* [GPU] Test fixes
2023-04-05 16:20:51 +04:00
Anastasiia Pnevskaia
4098434233 Parameter list and descriptions for mo.convert_model() method in docstring (#16459)
* Added convert_model() params docs.

* Added auto-generating of most cli params.

* Added auto-generating of cli params.

* Small correction.

* Removed wrong change.

* Corrected default values.

* Fixed errors, added tests.

* Small correction.

* Corrected params descriptions, moved cli specific params to separate file.

* Moved params specifics to utils/help.py.
2023-04-05 14:48:13 +04:00
Ekaterina Aidova
837f5a7d53 [PT FE]: fix aten::index inconsistent reshape (#16741)
* [PT FE]:  fix aten::index inconsistent reshape

* add index name, return false

* Update src/frontends/pytorch/src/transforms/aten_index_replacer.cpp
2023-04-05 10:44:25 +02:00
Bogdan Pereanu
73ab0dd065 Fixing run_timest python script for input and output precision (#16661)
* Fixing run_timest python script for input and output precision

* Update code according to the PR review

* Update run_timetest according to the last review

* Add input_precision and output_precision to test_timetest as well

* Set input/output precision per model
2023-04-05 12:16:27 +04:00
Ilya Churaev
f2d4c96032 Fixed add_output for new subgraph (#16726) 2023-04-05 11:39:47 +04:00
Tatiana Savina
c474f564a9 DOCS Change sample path (#16738)
* change path

* change path for sample

* change architecture in path

* change windows sample comment
2023-04-05 11:34:07 +04:00
Pavel Esir
f9bd2d2c1e [ie transformations] improve SoftMax fusion for better mixed precision inference (#16574)
* improve SoftMax fusion

* style and unit-test fix

* more precise SoftMax unit-tests

* rewritten SoftMaxFusion with single matcher

* fixes for align_mixed_fp32_fp16_types_test.cpp and mark_subgraph_to_keep_in_mixed_precision_test.cpp

* add include for pass/pattern/op/or.hpp

* get rank only when necessary

* style-fix

* add comment why SoftmaxFusion is called manually

* fix copy_runtime_info
2023-04-05 11:28:48 +04:00
Roman Kazantsev
45daa2095f [TF FE] Add diagnostics capabilities via Framework nodes (#16706)
* [TF FE] Add diagnostics capabilities via Framework nodes

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

* Refactor normalize logic

* Applied code-review feedback: fix in get_unsupported_operations_and_failures

* Handle unknown exception type

* Store only first encountered failure

* Update src/frontends/tensorflow/tests/convert_unsupported.cpp

* Apply code-review ffeedback: use stringstream

* Correct Key for exception message

* Fix build

* Use helper for creation of fw node with exception message inside

* Add test for conversion with unknown exception

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-05 11:28:10 +04:00
Karol Blaszczak
18c876bf23 Update openvino_sphinx_theme.css (#16740) 2023-04-04 18:55:16 +02:00
Ivan Tikhonov
093990118d Remove legacy TransposeSinking transformation (#16731)
* delete TransposeSinkingOVTF transformation

* delete include from tf_lite frontend
2023-04-04 18:51:10 +04:00
Roman Kazantsev
c034975183 [TF FE] Fix layer tests for BatchToSpace and add to the pre-commit (#16722)
* [TF FE] Fix layer tests for BatchToSpace and add to the pre-commit

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

* Specify type for batch_shape

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-04 18:46:12 +04:00
Mateusz Bencer
d4b394c1b6 Skip Reduce* ops layer tests due to ORT error (#16730)
* skip reduce mean

* skip other reduce ops
2023-04-04 14:50:34 +02:00
Tatiana Savina
1ee0c151ea DOCS shift to rst - Conversion tutorials (#16704) 2023-04-04 11:30:19 +00:00
Shen, Wanglei
9f54504232 update cpu properties name to enable_hyper_threading and enable_hyper_threading (#16723) 2023-04-04 15:25:11 +04:00
Maciej Smyk
8691ec2779 Update README.md (#16700) 2023-04-04 13:15:31 +02:00
Sebastian Golebiewski
f4fe856d9d [DOCS] Adding a new class for sortable tables - for master (#15314) 2023-04-04 12:42:19 +02:00
Eddy Kim
90615cf26a [GPU] Fix OneDNN primitive attr serialization logic (#16654)
* fix onednn primitive attr serialization logic

* added an onednn fc fusing serialization test

* added gemm fusing serialization tests
2023-04-03 18:24:40 -07:00
Maria Pushkina
4f7f7c31ee [CVS-104864] Action: Renamed group for concurrency (#16715) 2023-04-03 23:26:25 +04:00
Mikhail Ryzhov
06e6a69356 Revert "[GNA]Fix crash in gna_pluing when using POT (#16003)" (#16719)
This reverts commit 0a56927671.
2023-04-03 20:12:57 +02:00
Shen, Wanglei
f6c7213ae4 support Ecore only in streams calculation (#16552)
* support Ecore only in streams calculation

* fix merge conflict
2023-04-03 23:33:18 +08:00
Marcin Kusmierski
0a56927671 [GNA]Fix crash in gna_pluing when using POT (#16003) 2023-04-03 16:22:56 +01:00
River Li
dec425c408 [C API] remove UNDEFINED property value (#16709) 2023-04-03 16:54:03 +04:00
Mateusz Tabaka
03ab0e4388 Add ConvolutionToGroupConvolutionFusion (#16688)
Fuses Split->series of Conv->Concat to GroupConvolution op.

Ticket: 105170
2023-04-03 14:38:44 +02:00
Przemyslaw Wysocki
6237868437 Dependabot-ignore line (#16679) 2023-04-03 15:49:27 +04:00
Vladimir Paramuzov
f7d15e12c8 [GPU] Refactor dimensions jitter and max rank related code (#16603)
* [GPU] Refactor dimensions jitter and max rank related code
2023-04-03 13:34:06 +02:00
River Li
b7b788917d Fix double free in snippets (#16702) 2023-04-03 14:42:10 +04:00
Shen, Wanglei
86da15e621 enable new property ov::hint::use_cpu_pinning (#16383)
* enable ov::hint::use_cpu_pinning

* update test case for comments

* update header file

* update header file

* Delete cpu_streams_calculation.hpp

* Revert "Delete cpu_streams_calculation.hpp"

This reverts commit a1074ca843.

* update config name

* fix code styple issue

* update for merge conflict
2023-04-03 18:14:33 +08:00
Sebastian Golebiewski
e7c1cdf982 DOCS shift to rst (#16686) 2023-04-03 11:41:28 +02:00
Vitaliy Urusovskij
016d36f032 Add mmap notes in dldt_depl_optimization_latency.md (#16682) 2023-04-03 12:10:12 +04:00
Zlobin Vladimir
44330b22bd Update open_model_zoo submodule (#16678)
Upgrade onnx to 1.13. Ticket 102716
2023-04-03 12:09:18 +04:00
Roman Kazantsev
f4fca2d578 [TF FE] Activate TopK layer test with the second output in the pre-commit (#16691)
* [TF FE] Test the second output for TopK operation

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

* Switch off no sorted case

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-03 11:38:27 +04:00
Sebastian Golebiewski
b2e4857a64 DOCS shift to rst - AccuracyAwareQuantization Parameters (#16663) 2023-04-03 08:29:40 +02:00
Sebastian Golebiewski
02b35d7984 DOCS shift to rst - POT CLI Example (#16649) 2023-04-03 08:29:10 +02:00
Sebastian Golebiewski
3a5b819685 DOCS shift to rst - POT API examples (#16627) 2023-04-03 08:28:47 +02:00
Sebastian Golebiewski
2f5be5e81c DOCS shift to rst - Post-Training Optimization (#16621) 2023-04-03 08:28:24 +02:00
Sebastian Golebiewski
848c9e3b76 DOCS shift to rst (#16616) 2023-04-03 08:27:02 +02:00
Maciej Smyk
cddbb667a5 [DOCS] Automatic Batching Update (#16607) 2023-04-03 08:26:21 +02:00
Maciej Smyk
950b46ecad DOCS shift to rst - Model Creation C++ Sample & Model Creation Python* Sample (#16637) 2023-04-03 08:24:35 +02:00
Maciej Smyk
bb20151c9d DOCS shift to rst - Hello Query Device C++ Sample & Hello Query Device Python* Sample (#16650) 2023-04-03 08:24:02 +02:00
Maciej Smyk
f5dced8e69 DOCS shift to rst - Hello Classification Samples (#16681) 2023-04-03 08:23:44 +02:00
Yaroslav Torzuk
8491f15ba7 [GPU] Softmax for stable diffusion (#15863) 2023-04-03 10:21:02 +04:00
Anton Voronov
b64cbff10b [CPU] FQ shape agnostic kernel (#16585) 2023-04-03 09:55:49 +04:00
Karol Blaszczak
d7f70b647b [DOCS] shift to rst -install guides aptyumdocker (#16680) 2023-04-03 07:48:57 +02:00
Wang Wangwang
99eda5b5e1 [PYTHON][CAPI][AUTO] Add ENABLE_STARTUP_FALLBACK and ENABLE_RUNTIME_FALLBACK proper… (#16436)
* [AUTO] Add ENABLE_STARTUP_FALLBACK and ENABLE_RUNTIME_FALLBACK properties to Python API

* Add DEVICE_BIND_BUFFER property

* Add AUTO properties to C API

* Update test case && Update AUTO properties in PYTHON API

* Create dedicated files for auto plugin

* Update header files

* Update test case

* Modify code style

* Update variable name

* Add test case for invalid input value
2023-04-03 11:56:48 +08:00
Oleg Pipikin
e978db3132 Move new util functions from public api to dev api (#16683) 2023-04-01 11:46:20 +04:00
Ilya Churaev
186a1ccdcd Move interpreter test to template plugin (#16673) 2023-03-31 20:49:07 +00:00
Oleg Pipikin
66ea57addd Move memory tests from core to template plugin tests (#16460)
* Move memory tests from core to template plugin tests

* Rewrite tests to use template plugin

* Don't clone model in INTExecutable

* Add reset and modify tests

* Delete old test

* Fix clang-format

* Fix VariableState::set_state

* Enable and add var modify tests

* Fix INTExecutable

* Apply comments
2023-03-31 19:55:55 +02:00
guozhong wang
341217de99 Unify code path for MULTI and AUTO CTPUT hint (#16349)
[MULTI] pass through to AUTO with CTPUT hint
After this change
-- MULTI doesn't support setting infer request via CPU(4),GPU(8).
-- MULTI doesn't support CompiledModel::set_property() and ExecutableNetwork::GetConfig().
2023-03-31 18:40:41 +02:00
Roman Kazantsev
9a5a8f6abc [TF FE] Move to TopK-11 operation and update downgrading TopK transformation (#16590)
* [TF FE] Move to TopK-11 operation

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

* Update downgrading transformation

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-31 17:44:58 +02:00
dependabot[bot]
c33a3f87f0 Bump attrs from 22.1.0 to 22.2.0 in /tests (#16676)
Bumps [attrs](https://github.com/python-attrs/attrs) from 22.1.0 to 22.2.0.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python-attrs/attrs/compare/22.1.0...22.2.0)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-31 11:35:38 +00:00
Gorokhov Dmitriy
6e09e53f0d [CORE] Added optimized fp32->fp16 precision conversion implementation (#16672) 2023-03-31 11:02:39 +00:00
Egor Duplenskii
6d1e5d336d [CPU] Enable execution_mode API property (#16367) 2023-03-31 14:29:18 +04:00
Sebastian Golebiewski
f9ff518d16 DOCS shift to rst - Model Optimization Guide articles (#16598) 2023-03-31 11:26:04 +02:00
Sergey Shlyapnikov
bb93bfd90f [GPU] Add clDNN shape agnostic kernels usage as an initial impls for dGPU (#16018)
* [GPU] Add clDNN shape agnostic kernels usage as an initial impls for dGPU

* [GPU] Use layout as a key of weights cache, implement logic for weights cache capacity calculation based on available memory
2023-03-31 13:05:59 +04:00
Zhang Yi
fc88bed604 [CPU] Improvement for NoneZero and Gather (#16641) 2023-03-31 11:05:43 +02:00
Chen Xu
35398e339d [CPU] Implement TopK-11 to CPU plugin (#16522) 2023-03-31 10:28:20 +02:00
Pavel Esir
6d064d26cb remove deprecated MO args (#16626)
Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-03-31 12:28:04 +04:00
Ilya Lavrenov
ee0bb79ed6 Fixed LTO build (#16629)
* Partially fixed LTO

* Fixed issues with cnpy LTO

* CPU

* Disabled failing GPU test
2023-03-31 11:34:42 +04:00
Anton Voronov
43fca3d231 [CPU] Introduced shape agnostic eltwise (#15976) 2023-03-31 11:28:54 +04:00
Ilya Churaev
1b9bd61767 Added constructor from string for element Type (#16643)
* Added constructor from string for element Type

* Fixed code style

* Removed WA for tests
2023-03-31 07:24:32 +00:00
Maciej Smyk
73e75c58ba DOCS shift to rst - Hello NV12 Input Classification C++ Sample & Hello NV12 Input Classification C Sample (#16664) 2023-03-31 09:07:59 +02:00
Maciej Smyk
385bbbd49b DOCS shift to rst - Hello Reshape SSD C++ Sample & Hello Reshape SSD Python* Sample (#16662) 2023-03-31 09:07:30 +02:00
Sebastian Golebiewski
8fad140a02 DOCS shift to rst - Quantization articles (#16596) 2023-03-31 09:06:52 +02:00
Oleg Pipikin
9cf4ee1eae Fix sanitizer out-of-memory error (#16457)
* Fix sanitizer out-of-memory error

* Add implementation for Windows

* apply comments

* Fix1

* Fix2

* Fix3
2023-03-31 07:49:45 +04:00
Bogdan Pereanu
bf8e5cb4a2 Fix ITT build fail (#16648) 2023-03-31 01:18:13 +04:00
Roman Kazantsev
fc95d8e544 [TF FE] Align opset usage in utils (#16656)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-30 17:58:46 +00:00
Ilya Lavrenov
e94f7b25c0 Fixed cmake dev warnings (#16655) 2023-03-30 21:01:41 +04:00
dependabot[bot]
5e149aa0dd Bump test-generator from 0.1.1 to 0.1.2 in /tests (#16625)
Bumps [test-generator](https://github.com/kevinastone/generator) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/kevinastone/generator/releases)
- [Changelog](https://github.com/kevinastone/generator/blob/master/HISTORY.rst)
- [Commits](https://github.com/kevinastone/generator/compare/v0.1.1...v0.1.2)

---
updated-dependencies:
- dependency-name: test-generator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-03-30 16:58:02 +00:00
Sebastian Golebiewski
ab96cc939b DOCS shift to rst - Embedding Preprocessing Computation (#16659) 2023-03-30 16:59:58 +02:00
Ilya Churaev
b3503c8b7a Fixed coverity for ov::Any (#16647) 2023-03-30 13:12:50 +00:00
Tatiana Savina
961a99586a DOCS shift to rst Supported Model Formats (#16657)
* add model intro doc

* add supported model formats page

* add TF doc

* add pytorch doc

* add paddle  doc

* add mxnet doc

* add caffe doc

* add kaldi doc

* fix format

* fix cide snippets

* fix code snippets

* fix kaldi doc

* kaldi code snippets

* fix format

* fix list

* directive test

* fix note

* move code block

* code snippets style
2023-03-30 14:44:31 +02:00
Pawel Raasz
392b67f082 Fix pooling padding update (#16531)
* Review adaptive max pool shape inference

* Review AvgPool and MaxPool

* Review convolution operator

* Review GroupConvolution shape inference

* Review ConvolutionBackpropData operator

* Review GroupConvolutionBackpropData op

* Review BinaryConvolution operator
- add common bases for convolution ops
- refactor convolution ops

* Review DeformableConvolution operator

* Use new convolution shape_infer in GPU

* Fix build and test issues

* Correct set output spatial shape
in default constructed back prop convolutions

* The convolution shape_infer use pads as parameters
the external padding can be operators or other class padding properties shape_infer should not modify operators padding when
called from plugin

* Apply code formatting

* Fix padding validation and update

* Max and Avg pool don't update op properties
from plugin shape inference
- use ShapeInferWithPadding for pooling operators

* Remove not used function in shape_inference

* Fix evaluates in MaxPool

* Relax convolution shape infer inputs size check

* Remove unused entryFallbackWithPadding class

* Remove unused dilations variable

* Remove unused resize_attributes from max_pool_base

---------

Co-authored-by: mitruska <katarzyna.mitrus@intel.com>
2023-03-30 11:55:53 +00:00
Sebastian Golebiewski
7983e00b00 DOCS shift to rst - Cutting Off Parts of a Model article (#16640) 2023-03-30 13:05:53 +02:00
Irina Efode
87365fa21d [CONFORMANCE] Parallelization over HW devices (#16431)
* init

* just fix version

* Update merge script

* remove extra code

* Uncomment correct func

* dd

* validate_nvidia

* Small refactoring

* Trigger linux build

* Update main.cpp

revert

* trigger

* fix build

* Update main.cpp
2023-03-30 14:45:49 +04:00
totoka-intel
086ee93bcd [doc] Install guide openvino_2022 link location fix (#16572) 2023-03-30 12:40:20 +02:00
Ilya Lavrenov
ccf9c19f61 Deprecated UNDEFINED values for execution / performance hints (#16563)
* Deprecated UNDEFINED values for execution / performance hints

* Update src/tests/functional/plugin/gpu/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp

* Fixes

* Fixes
2023-03-30 13:48:19 +04:00
Ilya Lavrenov
5b203efb9c Disable PDPD test on Linux debian post-commit (#16644) 2023-03-30 12:24:17 +04:00
Bogdan Pereanu
5eea99d96c Update timetest tool to support ip and op params config (#15916)
* User can set input and output precision for timetest tool

* Update run_timetest.py with the ip and op options as well

* Use only one getType function

* Add extra line at the end of the file

* Remove unused parameters

* Update comment accordingly

---------

Co-authored-by: Vitaliy Urusovskij <vitaliy.urusovskij@intel.com>
2023-03-30 11:27:51 +04:00
Sebastian Golebiewski
3573a38e0b DOCS shift to rst - Model Optimizer Usage (#16630) 2023-03-30 08:24:22 +02:00
Sebastian Golebiewski
712d1b99d1 DOCS shift to rst - Post-training Quantization with NNCF (#16631) 2023-03-30 08:23:55 +02:00
Vladislav Golubev
b0e6b1e83c [TF FE] NgramCompilation test fix (#16636)
* [TF FE] NgramCompilation test fixed

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-03-29 18:34:23 +00:00
Artyom Anokhov
2a01695370 Deployment Manager: updated configs with 2023.0.0 layout and versions (#16633) 2023-03-29 19:34:26 +02:00
Ilya Lavrenov
0250f62d11 Revert inference precision to be a hint (#16634) 2023-03-29 18:59:33 +04:00
Maciej Smyk
7d8f4af78a DOCS shift to rst - Automatic Speech Recognition C++ Sample & Automatic Speech Recognition Python* Sample (#16609) 2023-03-29 16:39:09 +02:00
Karol Blaszczak
10668f4f3a Docs shift to rst - install guides linux (#16568) 2023-03-29 15:40:53 +02:00
Vladislav Golubev
8d59252966 [Transforamtions] NonZero horizontal fusion (#16571)
* Added ValuePredicate 'consumers_more_than'

* NonZero fusion

* NonZero fusion tests
2023-03-29 17:23:37 +04:00
Edward Shogulin
a9360f8045 [CPU] Element-wise precision selection fix (#16547) 2023-03-29 12:31:30 +00:00
Roman Kazantsev
0c2308506f [TF FE] Fix leftovers from review (#16619)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-29 16:28:37 +04:00
Tomasz Jankowski
f7e898893d Add PRelu fusion (#16617) 2023-03-29 11:32:57 +00:00
Przemyslaw Wysocki
591c3e61c5 [PyOV] Simplify requirement files (#15343)
* Partial progress

* Finish v1

* Cleanup

* Remove useless files

* Fix path to pdpd

* Fix onnx path

* Minor change

* Rework MO

* Minor change

* Remove some costraints

* Add MO constraints

* Update gitignore for MO

* Minor change

* Apply tech sync discussion

* Cleanup

* CR comment

* Debug ONNX FE

* simplify ONNX FE

* Update cmake

* Hardcode ONNX requirement

* Add dependency resolver to cmake

* Add constraints for openvino/tests

* Add missing pytest-html

* Fix -c path

* Revert debug changes to path

* Add cmake to copy constraints.txt

* Update dependabot

* Remove slash

* Remove cmake

* Debug prints

* Minor changes

* Move reqs check to separate file

* Add requirements parser to benchmark_tool

* Fix smoke tests constraints

* Minor fixes

* Minor change

* My fixes were apparently wrong

* Debug - self.executable_path

* Debug - add singledispatch to tests and tools

* Debug - print IE_APP_PATHs

* Revert "Debug - print IE_APP_PATHs"

This reverts commit 67ccb6d3f5.

* Revert "Debug - add singledispatch to tests and tools"

This reverts commit 3b945931e2.

* Revert "Debug - self.executable_path"

This reverts commit 3aa724eff6.

* update dependabot

* update dependabot

* Skip benchmark_app tests

* Use CMAKE_CURRENT_BINARY_DIR in cmake

* Remove debug prints

* minor change

---------

Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
2023-03-29 14:27:27 +04:00
Sun Xiaoxia
988a8dd6a9 Xiaoxia/Optimize the streams calculation process (#15777)
* add _big_core_logic_streams

* modify core binding with cpu mapping table

* get _cpu_ids with querying cpu_mapping_table

* fix mac build issue

* fix cpu func test issue

* fix clang-format issue

* remove getCoreOffset and getThreadStep

* motify return false from cpuMapAvailable on windows

* remove core binding in latency mode

* add bind core on windows

* add model prefer threads

* modify streams calculating schedule in ApplyPerformanceHints

* modify MakeDefaultMultiThreaded and Stream

* add unified cpu binding with cpu_mapping on linux and windows. add GPU core binding interface. modify streams calculation scheduling

* fix code style issue

* modify default streams to 1 to fix ci test issue

* add SetStreamtoConfig, modify getNumOfAvailableCPUCores to fix continuous call loadnetwork issue

* modify code according to comments

* fix build issue on macos

* fix macos error

* fix cputest issue

* fix build issue on macos

* move features about CPU to lin_system_config.cpp

* fix code style

* fix bebian_arm build failed issue

* fix macos build issue

* fix code style

* fix test issue on windows

* fix code style

* add latency in hybrid_aware condition

* add the condition used all cores in latency mode

* fix code style

* fix code style

* add init_cpu

* fix code style

* fix streams=2 issue

* fix multi gpu core bind issue

* modify interface

* fix debian arm build issue

* add bind core in different socket

* fix code style

* fix build issue on windows

* fix GPU set_executor_config sync issue

* fix latency issue

* fix bind_cores issue

* modify model prefer on tigerlake machine

* modify according to comments

* fix code style

* modify GPU reserve CPU interface, remove bind core on windows feater

* fix code style

* add 3rd type core in cpu_mapping_table

* fix build issue

* update test case

* modify core bind behavior in latency mode

* remove 3rd core type function

* update format

* add lock in get_task_flag

* not bind core in latency mode

* change model_prefer to 0 with latency mode on core machine. bind core with latency mode on core machine

* remove a void thread

* modify condition of create task_area

* modify comments

* fix according to comments

* fix spelling mistake

* fix according to comments

* fix code style

---------

Co-authored-by: Shen, Wanglei <wanglei.shen@intel.com>
2023-03-29 18:26:27 +08:00
Ilya Churaev
f3dcf93f96 Remove suppression Wno-delete-non-abstract-non-virtual-dtor (#16560)
* Remove suppression Wno-delete-non-abstract-non-virtual-dtor

* Fixed Allocator warning

* Suppress warning for GPU plugin

* Skip warning for GNA

* Fixed preprocessing

* Added virtual constructor for base plugin class

* Some fix for CPU

* Suppress for CPU

* Fixed any

* Fixed meta

* Disable warning for paddle

* Fixed Allocator tests

* Move suppress to paddle

* Fixed benchmark_app
2023-03-29 14:19:30 +04:00
Vladislav Golubev
df3c06ecb4 [CPU] Ngram node fusion (#16131) 2023-03-29 13:58:41 +04:00
Karol Blaszczak
f4da729a19 [DOCS] prerelease notes 0329 (#16584) 2023-03-29 11:27:12 +02:00
Yuan Hu
75c62ea320 [CPU] optimize shape infer of Reshape (#16537)
* add reshape shapeinfer in cpu plugin

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

* add squeeze and unsqueeze

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

* add precision i8 i64 on test

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

* fix code out of bounds risk

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

* test performance of this PR

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

* fix code issue

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

* Revert "test performance of this PR"

This reverts commit f4f9f002de28d03bc1c55c24067f75b74824904c.

* fix reviewer comment

fix throw message
not create ov::shape instance
remove i8 test case

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

* fix pytorch layer test failed issue

inputShape(1,0) outpattern(-1) is a valid input

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

* fix windows compile issue

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

* fix rebase mistaken

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

---------

Signed-off-by: Hu Yuan2 <yuan2.hu@intel.com>
2023-03-29 11:26:49 +02:00
Tingqian Li
05ab0f32d7 [CPU] Simple fix of redundant const-weight reordering for brgconv node in dynamic model (#16305) 2023-03-29 10:27:08 +02:00
Mateusz Tabaka
556d469f6b [PADDLE] add paddle opextension support (#16439)
* add opextension support

* support opconversion

* fix test contructor ambiguous

* fix ci fail

* add tag to avoid compiler ambiguous

* move tests to layer_tests & remove PaddleTag

* static cast

* use create_ov_node_by_name

---------

Co-authored-by: Luo Cheng <cheng.luo@intel.com>
2023-03-29 12:23:47 +04:00
Roman Kazantsev
35e03d33bb [TF FE] Support frozen models in text protobuf format aka pbtxt (#16604)
* [TF FE] Support frozen models in Text Protobuf format aka pbtxt

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

* Fix gen_wrapper.py for pbtxt

* Fix is_supported method

* Fix gen_wrapper.py script

* Adopt test_text_frozen_format unit-test

* Update src/frontends/tensorflow/src/frontend.cpp

* Update src/frontends/tensorflow/src/frontend.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-29 11:58:08 +04:00
Min, Byungil
7a95830d24 [GPU] Disable failed onednn tests (#16614)
* Resolved failed unit-tests for fully connected

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2023-03-29 15:53:04 +09:00
Min, Byungil
ea6e3481cd [GPU] Fix failed onednn tests (#16410)
* Fix failed unit-tests on dGPU

+ modified fully_connected_random_test_i8_3d not to have ambiguous
+ oneDNN does NOT support i64 type for reorder. Added exception.
+ bugfix in prepare_primitive_fusing about exception of activation function
+ Add exception logic for dynamic to select ocl type in is_node_for_onednn

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2023-03-29 15:50:09 +09:00
Roman Kazantsev
966c47e7cd [MO] Remove Python version check (#16612)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-29 09:23:14 +04:00
Katarzyna Mitrus
f7891aa034 [Interpolate-11] Reference implementation for Interpolate-11 (#16342)
* Reference impl for interpolate-11 init

* ND support init

* Tests clean up

* Add evaluate method for Interpolate-11

* New version tests init

* Type parametrized tests

* Tests duplication clean up and reusage of v4 test cases

* Add clipping to the type bounds

* Style fix

* Add float type tests

* Fix default ports values

* Commented code clean up

* Add passing cube_coeff param

* Tests clean up

* Add separate namespace

* Adjust variable names

* Adjust function name

* Use vectors instead of raw ptrs

* update func to static inline

* Adjust types

* Add Interpolate-11 to template plugin evaluates map

* Revert interpolate-11 core evaluate support

* Use const ref to filter

* Use static cast

* Update link
2023-03-29 07:11:56 +02:00
Taylor Yeonbok Lee
daf562832f [GPU] Fix malfunction in crop static kernel in dynamic shape scenario (#16586)
* Fix malfunction in crop static kernel in dynamic shape execution

* Add unittest

* Fix lint errort
2023-03-29 04:19:24 +00:00
Sergey Shlyapnikov
6c766a81b5 [GPU] Treat warnings C4267 as errors for Windows (#16345) 2023-03-28 22:56:47 +00:00
Mateusz Tabaka
b82bedd648 Add Conversion and Op Extension to Pytorch frontend (#16434)
Tickets: 98766 and 98767
2023-03-29 00:25:29 +02:00
Wilson Seok
79b267033c [GPU] Fix program::replace() to copy duplicated connection from single constant (#16529)
* fix program::replace() to copy duplicated connection from single constant

* add unit test

* modified with review feedback
2023-03-28 19:25:22 +00:00
Vitaliy Urusovskij
40cc006bae Enable MapAllocator in IR Frontend (#12673)
* Enable MapAllocator in IR Frontend

* Fix `ov_infer_request_ppp` test

With `mmap()`ing of IR, .bin can't be deleted until unmapping.
And it shows that there was a leak in test

* Add comment to Win `CreateFile()` regarding
FILE_SHARE_DELETE

* Unmap .bin file before IR files deletion

Wait ov::Model deletion to trigger .bin file unmapping
before IR files deletion

* ClangFormat

* Add `use_map_allocator` switch in FE

In case of direct use of FE (e.g. via MO), `mmap()` is OFF.
But in case of use FE via Core, `mmap()` is ON.
2023-03-28 23:24:13 +04:00
Pawel Raasz
796bd98913 Review convolution classes for shape inference aspects (#16375)
* Review adaptive max pool shape inference

* Review AvgPool and MaxPool

* Review convolution operator

* Review GroupConvolution shape inference

* Review ConvolutionBackpropData operator

* Review GroupConvolutionBackpropData op

* Review BinaryConvolution operator
- add common bases for convolution ops
- refactor convolution ops

* Review DeformableConvolution operator

* Use new convolution shape_infer in GPU

* Fix build and test issues

* Correct set output spatial shape
in default constructed back prop convolutions

* The convolution shape_infer use pads as parameters
the external padding can be operators or other class padding properties shape_infer should not modify operators padding when
called from plugin

* Apply code formatting

* Fix padding validation and update

* Use shape inference with padding instead fallback
for DeformableConvolution from opset1

* Update convertPadding function to be template
2023-03-28 19:10:08 +00:00
Maxim Vafin
8d90c11a35 Fix sporadic fails when beta==0 in baddmm (#16610)
* Fix sporadic fails when beta==0 in baddmm

* Remove sporadic test loop
2023-03-28 18:47:35 +00:00
Mateusz Bencer
4403433309 [ONNX FE] Implementation of ONNX STFT op (#16461) 2023-03-28 20:47:17 +02:00
Eddy Kim
e169c7cd38 fix a bug in permute_bfzyx_to_bfyxz (#16599) 2023-03-28 18:19:35 +00:00
Irina Efode
3849d5aa02 [INSTALL] Fix setupvars (installation for MacOS) and build python (#16514)
* Fix installation + Python build on MacOS

* Update setupvars.sh

* Update setupvars.sh

* Revert

* revert

* Update scripts/setupvars/setupvars.sh

---------

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-03-28 22:03:22 +04:00
Chen Peter
a2218ab169 Add notes for oneTBB (#16606)
* Add notes for oneTBB

Signed-off-by: Peter Chen <peter.chen@intel.com>

* Update wording

---------

Signed-off-by: Peter Chen <peter.chen@intel.com>
2023-03-28 21:19:00 +04:00
Alexandra Sidorova
38c924a3ae [Snippets] Added support of BF16/I8/U8 for MatMul (#15063) 2023-03-28 20:49:26 +04:00
Paul Youngsoo Ahn
253e4eb366 [GPU] Remove duplicated OpenCL kernel compilation on static model (#16262)
* * update kernel_ids using hash value
* Change set to unordered_map for kernels_code
* replace unique_id to hash value
* Remove hash_val params
* remove redundant codes (#16262)
** Remove unique_id in program_node
** Remove gen_kernel_id
** Remove set_kernels_source
** Remove remove_kernels
** Remove kernel_idx in kernels_cache

* * Use kernel_impl_params instead of kernel_id
* Divide batch when entry_point are duplicated
* rollback removing unique_id

* * Fix get_kernel failure issue (#102467)
 - Modify has function of custom_gpu_primitive and generic_layer
 - Add ==operation of generic_layer for _kernels map in kernels_cache
 - Fix invalid kernel_impl_params related to unique_ptr life cycle issue

* Improve kernels_cache (#102467)
* Move add_kernels_source step to build_implementations
* Change replace kernels_code key to kernel_impl_params
* Return kernel vector in get_kernels

* Modify function name to get_kernels (#102467)

* Fix functions related graph serialization (#102467)

* Fix failure to run dynamic model (#102467)

* Add unit test

* Code review follow-up
- Add const to input params
- Add missing code to check kernel duplication in kernels_cache

* Add const to input params (#102467)

* [GPU] update hash and ==operator for generic_layer and custom_gpu_primitive (#102467)

* [GPU] override get_kernels_source in generic_layer and custom_gpu_primitive (#102467)

* [GPU] Fix onednn build error (#102467)

* [GPU] Fix Lin build error (#102467)

* [GPU] kernels_cache::get_kernels return vector of clone of cldnn::kernel (#102467)

* Updated serialization logics for improved kernel caches (#16262)

* primitive key kernel cache for serialization
* kernel serialization with binaries hash
* fix kernel cache init function for deserialization
* removed unnecessary codes

* [GPU] Update commnet and fix test failure (#16262)

* [GPU] Fix custom_gpu_primitive unit test failures (#16262)

* [GPU] Improved kernels cache serialization (#16262)
* removed hash in serialization logic
* update not to create a new kernels_cache for serialization
* code refactoring in serialization logic

* [GPU] Follow-up code review (#16262)

* [GPU] modify lock(#16262)

* [GPU] Fix custom_gpu_primitive unit test failure (#16262)

---------

Co-authored-by: Eddy Kim <eddy.kim@intel.com>
2023-03-28 18:48:19 +02:00
Roman Kazantsev
17c3e67336 [TF FE] Add layer test for Mish activation function (#16557)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-28 18:43:11 +02:00
Maxim Vafin
44f0419a0b Get mo version once (#16576) 2023-03-28 15:45:08 +00:00
Ilya Churaev
05b0c58521 Add doc for ENABLE_QSPECTRE option (#16605)
* Add doc for ENABLE_QSPECTRE option

* Updated the link
2023-03-28 19:41:20 +04:00
Mikhail Ryzhov
55e9cae54f [GNA] Pre/Post processing via evaluate (#15691) 2023-03-28 14:50:02 +00:00
Ekaterina Aidova
6fc0b6479e [PT FE]: revert usage mo.convert_model in pt layer tests (#16573)
* [PT FE]: revert usage mo.convert_model in tests

* fix failed test
2023-03-28 16:06:21 +04:00
Pawel Raasz
49d150b3b8 Review PSROIPooling class for shape inference aspects (#16447)
* Review ROIPooling class
- check interval shape and label propagation
- add template shape_infer
- add shape infer into cpu plugin
- add test with StaticShape

* Use get_output_roi instead of get_output_size

* Add missing includes

* Review PSROIPooling operator
- review interval and label propagation
- add template shape_infer implementation
- add shape_infer to cpu plugin
2023-03-28 15:02:16 +04:00
Marcin Kacprzak
d9d1df2fe3 [GNA] Implemented ExecutionMode support in GNA Plugin (#16396) 2023-03-28 14:47:12 +04:00
Shen, Wanglei
a726f0ae38 Enable new property ov::hint::scheduling_core_type (#16106)
* enable apply_processor_type()

* declare PROCESSOR_TYPE

* enable readProperties

* test case for get_property()

* enable set_property() and test cases

* reduce changes

* fix code style issue

* fix python test case issue

* remove python interface

* move processor type definition out of dev_api

* refine coding

* add dependency

* update header file

* update description

* merge intel_cpu header file

* add inline in-code documentation

* change 'UNDEFINED' to 'DEFAULT'

* remove ProcTypeConfig

* refine change

* refine change

* refine process_type to scheduling_core_type

* refine description

* fix code style issue

* change to ov::hint::scheduling_core_type

* fix code style issue

* fix code style issue

* fix python issue

* fix python issue

* fix python issue

* fix python issue

* change core_type_cfg to ov::hint::SchedulingCoreType

* update test case for comments

* update test case for comments

* add default for comments

* update code style

* update for comments

* update for comments

* fix typo

* move cpu_map_scheduling into threading folder

* update for merge conflict

* update for code style
2023-03-28 10:04:30 +04:00
Vladimir Paramuzov
906939a1f1 [GPU] Fixed invalid is_dynamic flag value for scalar inputs (#16565) 2023-03-28 10:03:51 +04:00
hyunback kim
d06a22f4e4 [GPU] Support FC+eltwise fusion in fp16 for OneDNN (#16303)
* [GPU] Support FC+eltwise fusion in fp16

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-28 14:49:49 +09:00
Ilya Churaev
5dff012233 Fixed Warnings in reference implementations (#16559)
* Fixed Warnings in reference implementations

* Removed suppression from shape_inference
2023-03-28 00:45:40 +04:00
Ilya Churaev
167bf7e16a Added test to check that layout can be created from serialized format (#16575) 2023-03-28 00:43:30 +04:00
Shen, Wanglei
815d4abc03 enable new property ov::hint::use_hyper_threading (#16176)
* enable apply_processor_type()

* declare PROCESSOR_TYPE

* enable readProperties

* test case for get_property()

* enable set_property() and test cases

* reduce changes

* fix code style issue

* fix python test case issue

* remove python interface

* move processor type definition out of dev_api

* refine coding

* add dependency

* update header file

* update description

* merge intel_cpu header file

* add inline in-code documentation

* change 'UNDEFINED' to 'DEFAULT'

* remove ProcTypeConfig

* refine change

* refine change

* enable new property use hyper threading

* update description

* resume legacy code

* change to ov::hint namespace

* update including header file

* update C API and Python API

* update description for comments

* update test case for comments

* update function location for comments

* fix typo

* fix typo

* fix code style issue and update test case

* move cpu_map_scheduling into threading folder
2023-03-28 00:39:26 +04:00
Orest Chura
aa0df8e535 [Python][Build] Fix building openvino wheel on Windows (#16374)
* Add snippets dependency

* - removed dependency back
- added an INTEL_CPU condition on snippets configuring -> no dependency when configured w/0 CPU

* Disable snippets_ngraph_functions conditionally if inference_engine_snippets are not configured

---------

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-03-27 23:52:58 +04:00
Sebastian Golebiewski
68e067062f Update Doxyfile.config (#16564) 2023-03-27 23:47:10 +04:00
Sebastian Golebiewski
1ca94326cb DOCS shift to rst - Benchmark Samples and Tools (#16566) 2023-03-27 18:29:05 +02:00
Sebastian Golebiewski
5c5a29d095 DOCS shift to rst -Sync Benchmark Samples (#16561) 2023-03-27 18:28:16 +02:00
Maciej Smyk
6e99b48ecc DOCS shift to rst - OpenVINO™ Samples and Get Started with C++ Samples (#16577) 2023-03-27 18:26:47 +02:00
Irina Efode
9863b32792 [CONFORMANCE] w/a Api Conformance crash for NVIDIA (#16508) 2023-03-27 17:57:10 +02:00
Maciej Smyk
7ccf1c89cf DOCS shift to rst - Image Classification Async C++ Sample & Image Classification Async Python* Sample (#16580) 2023-03-27 16:54:50 +02:00
Roman Kazantsev
5e9ea6a146 [TF FE] Refactor utils routine (#16554)
Move all openvino_conversion rountines into utils. Avoid using Squeeze without axis
that can create dynamic output rank

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-27 11:10:00 +00:00
Roman Lyamin
5113a5538c [GPU] Added shape canonicalization mechanism (#16166) 2023-03-27 15:02:06 +04:00
Tomasz Adamowicz
4936d4bb1d [GNA] Introduce 16Byte memory alignment for LNL (GNA3.6) (#16363)
* [GNA] Introduce 16Byte memory alignment for LNL (GNA3.6)

* update after review
2023-03-27 10:42:34 +01:00
Mang Guo
5e835e327b [CPU] Fix edge memory share issue (#16202) 2023-03-27 13:20:51 +04:00
Piotr Krzemiński
6b70c449ba [PT FE] Add aten::Chunk implementation (#16035)
* [PT FE] Add chunk implementation:

* [PT FE] Fix chunk int64 instead of const node errors, add tests for chunking

* [PT FE] Test Chunk-If implementation

* [PT FE] Change the translate to replace chunk implementation, use VariadicSplit instead of Slice

* [PT FE] Reduce artifacts from debugging

* Update test_chunk.py

* [PT FE] Improve & debug chunk implementation:

* [PT FE] Simplify implementation, fix remaining bugs

* [PT FE] Statify the split lenghts output

* [PT FE] Clear code, remove debugging artifacts
2023-03-27 11:16:16 +02:00
Mateusz Mikolajczyk
7d16ee1835 [PT FE] Add torchvision::deform_conv2d translation (#16450)
* Initial commit

* Initial commit

* Cleanup

* Improve tests

* Make NodeContext const
2023-03-27 11:13:32 +02:00
Roman Kazantsev
bb9de29062 [TF FE] Add layer test for Bucketize (#16556)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-27 12:03:07 +04:00
cecilia peng
a1b8a6a941 [CPU] Disable ConvertNMSToNMSIEInternal (#16128) 2023-03-27 11:22:53 +04:00
dependabot[bot]
64e9dc32cd Bump awalsh128/cache-apt-pkgs-action from 1.2.4 to 1.3.0 (#16562)
Bumps [awalsh128/cache-apt-pkgs-action](https://github.com/awalsh128/cache-apt-pkgs-action) from 1.2.4 to 1.3.0.
- [Release notes](https://github.com/awalsh128/cache-apt-pkgs-action/releases)
- [Commits](https://github.com/awalsh128/cache-apt-pkgs-action/compare/v1.2.4...v1.3.0)

---
updated-dependencies:
- dependency-name: awalsh128/cache-apt-pkgs-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 11:09:21 +04:00
Ilya Lavrenov
2638014d00 Enable build with system version of snappy (#16549)
* Enable build with system version of snappy

* Create Snappy::snappy alia
2023-03-27 10:01:11 +04:00
Maksim Kutakov
0765fa108a [CPU] Debug Caps build fix (#16536) 2023-03-27 07:28:43 +02:00
Ilya Lavrenov
3f3bda592b Revert "[MO] remove deprecated: data_type, disable_nhwc_to_nchw, tensorflow_use_custom_operations_config (#16394)" (#16555)
This reverts commit 43ef89e625.
2023-03-27 09:04:41 +04:00
Sergey Shlyapnikov
ce67ac09d3 [GPU] Disable OneDNN primitive cache (#16525) 2023-03-26 23:29:47 +04:00
Maksim Kutakov
ab151fd357 [CPU] Temporal object access fix (#16546) 2023-03-26 22:36:14 +04:00
Mateusz Tabaka
1df14c6a6c Add docs for OPENVINO_FRAMEWORK_MAP macro (#14928)
* Add docs for OPENVINO_FRAMEWORK_MAP macro

Ticket: 98762

* Apply suggestions from code review

Co-authored-by: Piotr Krzemiński <piotrkrzeminski1234@gmail.com>

---------

Co-authored-by: Piotr Krzemiński <piotrkrzeminski1234@gmail.com>
2023-03-26 22:00:43 +04:00
Rajat U Krishna
6eb8f4b2b7 [Docs][PyOV] Fix broken link to section (#16553)
* [Docs][PyOV] Minor change to fix a broken link in code_examples.md
2023-03-26 21:58:52 +04:00
Pavel Esir
43ef89e625 [MO] remove deprecated: data_type, disable_nhwc_to_nchw, tensorflow_use_custom_operations_config (#16394)
* removed deprecated MO options: data_type, disable_nhwc_to_nchw, tensorflow_use_custom_operations_config

* fix layer_test_class.py

* data_type -> precision in layer_test_class.py

* typo fix

* corrected layer tests for compress_to_fp16 argument
2023-03-26 21:38:15 +04:00
Andrew Kwangwoong Park
2956717118 [GPU] Added shape agnostic TopK kernel (#16161)
* [GPU] Added shape agnostic TopK kernel implementation

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

* Update kernel to use internal buffers for shape agnostic kernel

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

* Add WA to compile_graph for shape agnostic arg_max_min_axis with non-const k input

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

* Fix is_dynamic pameter for FillCLKernelData with the case where the output is static shape

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

* Fix corner case where inbuf size becomes 0 when ops_size is 1

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

---------

Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-25 22:32:17 -07:00
guozhong wang
60ab7490bf Implement CTPUT in AUTO code logic (#16220)
* Implement CTPUT in AUTO code logic

* Add logic to handle device loading failure

* add some code comments

* fix warnning conversion from size_t to int

* Updated code according to comments of bell and wanglei

* the preferred device code path need to be updated with ctput also

* add fallback logic for CTPUT

* Modify the code logic according to bell suggestion

* Add prints for debugging bug

* throw exception when no device to run pipline task

* initialize idleWorkerRequest for CTPUT

* fix getting properties

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

refine

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

* fix warning

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

* fix illegal character on windows

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

* fix illegal character

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

add missing include

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

* more code refine

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

---------

Signed-off-by: fishbell <bell.song@intel.com>
Co-authored-by: fishbell <bell.song@intel.com>
2023-03-26 12:35:26 +08:00
Ilya Lavrenov
e66b837104 Properties improvements: part 2 (#16489)
* Properties improvements: part 2

* Accurate configs handling in HETERO / BATCH

* Align plugins in caching properties

* Fixed caching mock tests

* Added new TestNoCachingProperties test

* Fixed test

* Added ov::caching_properties to API 1.0 metrics as well

* Fixes for HETERO plugin

* Fixed tests

* Even more refactoring in HETERO plugin config management
2023-03-25 19:28:05 +04:00
Fang Xu
a96da994ec Update prebuilt oneTBB2021.2.1 (#16548)
*update prebuilt oneTBB2021.2.1

*modify tbb and tbb component installation

*modify the implementation of removing soft links

*update prebuilt oneTBB2021.2.1
macos: 11.4
windows: win10+visual studio 2019(MSVC 14.21)
https://github.com/open-mpi/hwloc/archive/refs/tags/hwloc-2.8.0.tar.gz
https://github.com/open-mpi/hwloc/archive/refs/tags/hwloc-2.8.0.zip
https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.2.1.tar.gz(commitid:96af5d3)
https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.2.1.zip(commitid:96af5d3)

before building oneTBB 2021.2.1, replace all strings "2_4" of the source code with "2_5"

for windows, after compilation, replace all strings
INTERFACE_COMPILE_DEFINITIONS "\$<\$<CONFIG:DEBUG>:TBB_USE_DEBUG>" to INTERFACE_COMPILE_DEFINITIONS "\$<\$<CONFIG:DEBUG>:TBB_USE_DEBUG>;__TBB_NO_IMPLICIT_LINKAGE=1"
in cmake file "%cd%\install\lib\cmake\TBB\TBBTargets.cmake"
2023-03-25 08:46:43 +00:00
Ilya Lavrenov
580b99c99b Align plugins in caching properties (#16528)
* Align plugins in caching properties

* Fixed caching mock tests

* Added new TestNoCachingProperties test

* Fixed test

* Added ov::caching_properties to API 1.0 metrics as well
2023-03-25 00:26:18 +04:00
Taylor Yeonbok Lee
6a25143045 [GPU] Prevent memory reset at runtime allocation for dynamic shape, fix wrong padding handling (#16351)
* Prevent memory reset at runtime allocation for dynamic shape

* Set default alloc to reset mem

* Additional fixes :
- If there is any convolution/deconvolution users which requires padded input, enqueue reset buffer when reuse buffer.
- Removed cl finish from gpu_buffer::fill. (Hopefully it should be waited only when needed. Otherwise sync is to be done by event)
- Removed buffer reset from on_execute of nonzero count, which is not needed any more.

* Remove unused API

* Fix tensor offset to project the padding

* Added unittest

* Applied review comment
2023-03-24 13:10:33 -07:00
Ekaterina Aidova
1ef94ec069 [PT FE]: support aten::linalng_vector_norm (#16109)
* [PT FE]: support aten::linalng_vector_norm

* more norm ops

* update tests
2023-03-24 21:00:17 +01:00
Ilya Lavrenov
18df64c135 More accurate hwloc finding in case of dynamic tbbbind (#16488) 2023-03-24 19:42:20 +01:00
Sebastian Golebiewski
81b4666632 Update tutorials (#16544) 2023-03-24 18:17:36 +01:00
Ekaterina Aidova
179403ddc9 [PT FE]: improve integration into mo.convert_model (#16243) 2023-03-24 16:55:07 +01:00
Karol Blaszczak
953a166a62 [DOCS] minor fix for content and config (#16538) 2023-03-24 14:33:04 +01:00
Ivan Tikhonov
5a8a195dad TransposeSinking: add support for Slice and Reshape ops (#16208)
* Resolve the performance issues in TransposeSinking transformation

* codestyle

* fix warning as error, fix tests failures

* fix ts for Concat and Reduce

* Fix TransposeReduceBackward

* fix the issue in TransposeFuse transformation

* fix TransposeReduce transformations

* Fix TransposeReduction, fix TransposeSinkingSplit, add unsqueeze support

* delete debug print

* Add additional validations

* fix node validation

* Fix validate for split, revert changes for concat, add BatchToSpace/SpaceToBatch

* Add SpaceToBatch/BatchToSpace

* fix TS for Interpolate + codestyle

* fix gna build

* Support TS for Interpolate, VariadicSplit, IsInf, IsNan, IsFinite + refactoring

* add the missed line

* add include

* TransposeSinking tests refactoring: part1

* TransposeSinking tests refactoring: part2

* Add limited support for StridedSlice op

* codestye

* TransposeReduction: skip the case when 2nd input for Squeeze is not provided

* Transpose sinking tests refactoring: part 3. + Revert changes in MOC.

* fix build

* codestyle

* Add tests for TS backward transformations, update TransposeSinkingFuse transformation, delete StridedSlice transformation prototype + tests refactoring

* fix unary tests

* Fix warning as error on Windows

* Add new tests for Unsqueeze/Squeeze; refactoring; remove debug code

* TransposeSinking: add support for Slice op

* Add descriptions to the transformations, add additional checks

* fix a warning

* TransposeSinking Rafactoring part2: move the transformations to a separate folder, align namespaces

* TransposeSinking refactoring: class names, namespaces

* codestyle

* resolve merge conflicts

* codestyle

* TSReduction refactoring, move Unsqueeze/Squeeze transformations to separate files, added limited support for Reshape op + tests

* fix minor mistakes

* fix warnings

* Added TSSlice transformation to TSGeneral, created TransposeSinkingGeneral alias in ov::pass namespace

* refactoring

* codestyle

* fix TSSqueeze/TSUnsqueeze transformations

* delete debug serialize

* remove TransposeSinking from MOC

* fix TSSqueeze/TSUnsqueeze transformations in case of Reshape op

* delete debug code

* codestyle

* fix unit tests, revert changes for TSSlice transformation

* fix TSSqueeze transformation

* resolve review comments

* codestyle
2023-03-24 17:01:15 +04:00
Georgy Krivoruchko
c5b348dd4f [POC][TF FE] Support SavedModel format (with compression) (#16317)
* Added Saved Model proto descriptors

* Included Google's protobuf repository

* Added wstring version of ov::util::directory_exists

* Added initial implementation of Saved Model iterator

# Conflicts:
#	src/frontends/tensorflow/src/frontend.cpp

* Added missing proto files to repository

* Implemented reading of variables index and data files

# Conflicts:
#	src/frontends/tensorflow/src/frontend.cpp

* Renamed class

# Conflicts:
#	src/frontends/tensorflow/src/frontend.cpp

* Fix for cross-platform directory_exists

* Fixed codestyle and simplified code

* CI fixes

* Separeted Saved Model iterator from Proto iterator

* Moved variables index into separate class

* Added initial implementation of reading a variables from
saved model

# Conflicts:
#	src/frontends/tensorflow/src/frontend.cpp

* Added external variable mapping

* Code cleanup

* Commit is for discussion purposes!!!
Implemented RestoreV2 with a workaround for strings
Not optimized, includes mem leak

* In progress...

* Added DT_STRING coverage into decoder_proto

* m_variables_index moved into underlying class

* Updated copyrgihts, added space between license and code

* Moved string constant to separate class

* Added AssignVariableOp operation

* Changed behavior of RestoreV2
Updated stubs for other ops

* Second working implementation, enabled:
Program-only models
Variables reading from data files

* Extended docs

* Fixed dynamic type

* Fixed naming

* Added Snappy submodule to support compression in TF FE

* Enabled Snappy Compression for TF FE

* Make static linkage of Snappy
Changing Warning as error behavior for 3rd party

* CI fixes

* Added Snappy copyright info

* Aligned behavior of StringConstant with UnsupportedConstant

* Added correct naming and removing unused inputs/outputs
2023-03-24 15:07:16 +04:00
Ilya Churaev
9eab122952 Disable QSpectre flag by default (#16526) 2023-03-24 13:55:42 +04:00
Ilya Churaev
077d0e43f2 Fixed Windows warnings for core (#16523) 2023-03-24 09:34:06 +00:00
Andrei Gorbachev
cabb917b1f [GPU] Fix warnings (#16516)
* fix a few warnings

* cast size_t to uint32_t
2023-03-24 13:26:24 +04:00
Maxim Vafin
86c4489aca [PT FE] Add telemetry extension support (#16438)
* Initial telemetry introduction in PyTorch frontend

* Add test

* remove obsolete checks from test

* Move statistics gathering into TranslateSession

* Fix code style

* Fix codestyle
2023-03-24 10:11:12 +01:00
Nadezhda Ageeva
65e5ed7dd7 [HETERO]: support caching properties (#16451)
* Fixed build

* [HETERO]: support caching properties

* Fix caching test

* Code style

* Change result type from map to vector

* Review comments

---------

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2023-03-24 12:25:55 +04:00
Luo Cheng
16933efc06 [CPU] Enable brgconv primitives with binary post-ops by default on AVX512+ ISA (#16286) 2023-03-24 11:31:00 +04:00
Shen, Wanglei
613b66ba35 include nireq during streams calculation (#16378)
* include nireq during streams calculation

* update description for comments

* update description
2023-03-24 15:27:13 +08:00
Roman Kazantsev
3f4b1e8205 [TF FE] Post leftovers to support the MUSE model in SavedModel format (#16520)
* [TF FE] Post leftovers to support the MUSE model in SavedModel format

It contains tests imitating a case with Tokenizer extension and raised problems:
setting custom type for body graph Parameter, named ports for RaggedTensorToSparse
and Unique operations.

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

* Update src/frontends/tensorflow/tests/convert_tricky_models.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-24 11:07:56 +04:00
Ilya Churaev
fbdd158615 Small fixes for template plugin developer documentation (#16521) 2023-03-24 10:29:09 +04:00
Fang Xu
025115f695 Update prebuilt tbbbind static library for Linux (#15832)
* update prebuilt tbbbind static library

* update LICENSE file

* update SHA256

* update prebuilt tbbbind static library for linux

cmake 3.23.2
centos7

https://github.com/open-mpi/hwloc/archive/refs/tags/hwloc-2.8.0.tar.gz
./autogen.sh
./configure --enable-static --disable-io --disable-libudev --disable-libxml2 --disable-cairo CFLAGS="-fPIE"
make -j$(proc)
make install prefix=$(pwd)/install

https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.7.0.tar.gz
sed -i "s/APPLE\s*OR\s*NOT\s*BUILD_SHARED_LIBS/APPLE/g" CMakeLists.txt
export HWLOC_DIR="${hwloc_root_dir}/hwloc-hwloc-2.8.0/install"
export PKG_CONFIG_PATH="${HWLOC_DIR}/lib/pkgconfig"
export CXXFLAGS="-I ${HWLOC_DIR}/include -L ${HWLOC_DIR}/lib"
~/cmake-3.23.2-linux-x86_64/bin/cmake -DTBB_TEST=OFF -DTBB_BUILD=OFF -DTBBMALLOC_BUILD=OFF -DBUILD_SHARED_LIBS=OFF
make -j$(nproc)

* remove changes for windows

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
2023-03-24 14:27:57 +08:00
Zlobin Vladimir
69cec4a5e2 py/benchmark_app: fix -hint (#16511)
* py/benchmark_app: fix -hint

Don't warn about values which are explicitly set in -hint.
That aligns C++ and Python implementations.

Ticket 106544

* Remove extra throw

* Fix code style
2023-03-24 10:24:08 +04:00
Kelvin Choi
8518a3a8e8 [GPU] Disable converting gather8 to 7 pass because GPU plugin supports gather8:nagative-index feature (#15868)
* Add GatherV7 and gatherV8 for convert_gather_0d pattern

* Add updating output_shape using reorder/reshape for scalar indice instead of using ConvertGather0D pass

* Add WA for NMS-gather8 pattern
2023-03-23 23:12:12 -07:00
Sergey Shlyapnikov
e434c320f5 [GPU] Update tuning params of shape agnostic version of fully_connected_bf_tiled kernel for dGPUs (#16482) 2023-03-24 09:08:09 +04:00
Georgy Krivoruchko
7601e8a874 Added compilation flag (#15436) 2023-03-24 07:09:29 +04:00
Tomasz Dołbniak
1b89ecdbae Interpolate v11 usage in ONNX FE (#16463) 2023-03-24 02:06:22 +00:00
Maxim Vafin
abaf61d059 Improve detectron2 support (#16011)
* Improve op support for detectron mask rcnn

* Initial commit

* Fix for reading processed list

* Format code

* Cleanup

* cleanup

* Cleanup

* cleanup test

* Add comment

* Add rt_info

* fix type

* More fixes for detectron

* Fix build

* Add tests for if

* Revert changes in index

* Add comment

* Fix test

* Fix get_axes_range

* Add tests and fix if type alignment

* Fix code style

---------

Co-authored-by: Mateusz <mateusz.mikolajczyk@intel.com>
2023-03-23 22:30:03 +00:00
Przemyslaw Wysocki
52b27d82c5 Upgrade ONNX to 1.13, protobuf to 3.20.3 and relax tensorflow (#14773)
* Bump ONNX version

* Bump protobuf

* Add xfails and skips

* Add tickets

* Skip ONNX Serialization tests

* Compile ONNX with C++17

* Force cpp17 - 2

* Use MSVC check

* Update tensorflow

* Minor change

* Bump onnx to 1.13.1

* Bump protobuf to 3.20.3

* Debug test tf

* Xfail tests in comp

* Update comp tests

* Update tf reqs

* Remove deprecated ONNX function

* Align PDPD FE protobuf req with 2.4.1

* Satisfy dependency review

* Attempt to fix dependency review

* Revert pdpd protobuf

* Skip pdpd tests

* Fix MO-TF-PB test

* Skip TF test case

* Add ticket numbers, rewrite reqs

* Fix requirements

* Minor change

* Set TF to 2.12

* Remove wrapt and skip test
2023-03-24 00:43:01 +04:00
Paul Youngsoo Ahn
74870f9b0b [GPU] Fix gpu dynamic model multistream test issue (#16510) (#16510) 2023-03-23 10:51:57 -07:00
Ilya Churaev
2755b32fb9 Changed Template plugin public property (#16496)
* Changed template plugin public property

* Add property documentation

* Fixed comments

* Fixed typo
2023-03-23 16:34:49 +01:00
Tomasz Dołbniak
de0a4e16fb TopK 11 exposed to Python (#16501) 2023-03-23 16:33:54 +01:00
Sebastian Golebiewski
44d6d97871 DOCS shift to rst - OpenVINO 2.0 Deployment (#16509) 2023-03-23 14:47:54 +01:00
Edward Shogulin
fb24e91416 [LPT] NNCF GroupConvolution 5D on weights support (#16336)
* [LPT] NNCF GroupConvolution 5D on weights support

* PullReshapeThroughDequantization rollback
2023-03-23 13:24:10 +00:00
Maksim Kutakov
8a246a8bf2 [CPU] Use Dnnl executor to avoid extra dnnl primitve desc query (#16372) 2023-03-23 16:25:39 +04:00
Nadezhda Ageeva
3b8d9c568c Allow skip LoadNetworkToDefaultDeviceNoThrow tests (#16507) 2023-03-23 16:09:13 +04:00
Irina Efode
448654ea65 [CONFORMANCE] Fix report gewneration in case of mixed reports: rel and abs (#16505) 2023-03-23 15:08:18 +04:00
Sebastian Golebiewski
c89da1aee2 DOCS shift to rst - Install OpenVINO on macOS, Raspbian (#16506) 2023-03-23 12:02:01 +01:00
Sofya Balandina
9d0749a5b7 [conformanceTests] Add key for manage pipeline after crashes (#16123)
* [conformanceTests] Add key for manage pipeline after crashes

* Move crash_handler to funcTestsUtils
2023-03-23 14:59:31 +04:00
Mateusz Bencer
a004601774 [ONNX FE] Fix Windows warnings (#16141) 2023-03-23 10:59:00 +01:00
Ilya Churaev
a3958d6ddf Use evaluation context for the inference (#16492) 2023-03-23 13:52:03 +04:00
Anastasia Kuporosova
982e1c1192 [PyOV] Fix issues with RTMap (#15636)
* [PyOV] Fix issues with RTMap

* update year

* some clean-up and items fix

* tests and small fixes

* Update src/bindings/python/src/pyopenvino/utils/utils.cpp

* undo changes

* fix serialization on python side

* rt_info as rt_map

* undo several changes in tests

* fix mo test

* sadd docstrings

* add tests

* fix codestyle

* try to fix win

* fix master

* apply comments
2023-03-23 10:29:32 +01:00
Edward Shogulin
087b10ff00 Snippets: precision propagation (#14996) 2023-03-23 13:16:04 +04:00
Sebastian Golebiewski
5fa95ff19d DOCS shift to rst - Protecting Deep Learning Model (#16474) 2023-03-23 10:12:13 +01:00
Sebastian Golebiewski
66ae71454a DOCS shift to rst - Install OpenVINO on Windows (#16502) 2023-03-23 10:09:43 +01:00
Roman Kazantsev
aaa4a4c210 [TF FE] Skip Assert operation and add test (#16484)
At the conversion stage we can't resolve Assert node because the condition
is computed only during inference time.

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-23 11:49:46 +04:00
Maciej Smyk
17174a3839 DOCS shift to rst - Troubleshooting (#16483)
* troubleshooting
* code-block fix
2023-03-23 08:39:46 +01:00
Jade Cho
a20b3631fb Support float64 data type as input of benchmark_app (#16435) 2023-03-23 13:55:55 +09:00
Ilya Churaev
a205c675db Fix leftovers after removing plugins.xml (#16487)
* Fixed comments

* Rename ie_plugins to ov_plugins

* Remove dependency from tests
2023-03-23 04:32:36 +00:00
Kelvin Choi
6bf2fe11ae [GPU] Need to exclude fused mem_dep from shape_infer_dep (#16300) 2023-03-22 13:00:29 -07:00
Tomasz Dołbniak
951c5fdae9 Interpolate 11 exposed to Python (#16465) 2023-03-22 18:12:16 +00:00
Yury Gaydaychuk
5290822f8b [CPU] Enabled BatchToSpace and SpaceToBatch with nonconstant inputs support (#16344) 2023-03-22 16:36:05 +00:00
Irina Efode
6ac5e42b62 [CONFORMANCE] Fix if impossible to remove log (#16485)
* fix_reporting

* w/a for remove

* Update merge_xmls.py

remove extra
2023-03-22 20:07:47 +04:00
Tomasz Dołbniak
8eb142ca6e Interpolate v11 -> v4 downgrade transformation (#16448) 2023-03-22 17:00:53 +01:00
Ilya Churaev
c23a1170ba Remove plugins xml (#16470)
* Update core_impl.cpp

Add first implementation of register_compile_time_plugins (needs to depend on the actual CMake configuration as a next step).

* Update core.cpp

Check for missing plugins.xml

* Update core_impl.cpp

Avoid exception for missing plugins.xml

* Update core_impl.hpp

Add register_compile_time_plugins function definition

* Plugin loading based on CMake configuration

* Remove debug output command

* Unify static/dynamic plugin loading

* Add CMake option for plugins.xml that defaults to off

* Move GENERATE_PLUGINS_XML option to features.cmake

* Add missing brace

* Remove unnecessary #ifdef check

* Prepare to resolve conflicts

* Fix compile error

* Activate generation of plugins.xml in OpenVINODeveloperPackageConfig.cmake

* Fix CMake installation

* Plugin loading logic implemented in ie_core.cpp as well

* Fix format

* Small fixes

* Fixed code style

* Skip if xml file wasn't found

* Added function to find compiled plugins

* Generalize plugins hpp

* Use new API

* Fixed old core

* Fixed static build

---------

Co-authored-by: CSBVision <bjoern.boeken@csb.com>
2023-03-22 15:51:07 +00:00
Jan Iwaszkiewicz
4561aa7109 [PyOV] OVDict class - new return value from inference (#16370) 2023-03-22 16:12:07 +01:00
Xuejun Zhai
8509d0dd82 [Deprecated API] remove version (#16426)
* [Remove version] Remove version from py openvino

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Modify caused by remove version

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix clang format issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Revert "Fix clang format issue"

This reverts commit 132787286f.

* Fix CI format issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix CI format issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix merge conflict error

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-22 16:09:14 +01:00
Ilya Lavrenov
1b72352f6f Fixed CVS-93736 (#16471) 2023-03-22 14:20:03 +04:00
Chen Xu
57c91e0c56 [CPU] Fix issue in reducing HW with small channel size in npsc layout (#16467) 2023-03-22 13:28:38 +04:00
Sebastian Golebiewski
90100451a3 DOCS shift to rst - Libraries for Local Distribution (#16469) 2023-03-22 09:43:44 +01:00
Sebastian Golebiewski
066ef694f5 DOCS shift to rst - Deploying Your Application with Deployment Manager (#16453) 2023-03-22 09:42:47 +01:00
Sebastian Golebiewski
2f69305aa3 DOCS shift to rst (#16445) 2023-03-22 09:41:59 +01:00
Sebastian Golebiewski
14e70e76fb DOCS shift to rst - Further Low-Level Implementation Details (#16444) 2023-03-22 09:39:32 +01:00
River Li
232c802e07 [CAPI] Add ov::hint::execution_mode property (#16466) 2023-03-22 12:18:40 +04:00
Sebastian Golebiewski
cbb25e9483 [DOCS] Proofreading developer documentation moved from wiki. (#15886)
Minor stylistic and grammar corrections. Fixing links

* Apply suggestions from code review

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2023-03-22 09:08:31 +01:00
hyunback kim
c14e6ef48e [GPU] Use 4dim directly for onednn in gemm (#16182)
* [GPU] Use 4-dim directly for onednn in gemm
   We were collapsing n-dim into 3d for onednn gemm, But it is not necessary, up to 4d.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-22 17:08:10 +09:00
Roman Kazantsev
0070e8d939 [TF FE] Fix problems with invalidation of decoders (#16464)
* [TF FE] Fix problems with invalidation of decoders

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

* Fix comment

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-22 12:02:59 +04:00
Ilya Churaev
f1c3356cfc Small Plugin DG changes (#16432) 2023-03-22 09:01:16 +01:00
Andrew Kwangwoong Park
04a2c4ce61 [GPU] Add shape agnostic optimized FullyConnectedIMAD kernel (#16417)
* [GPU] Added shape agnostic kernel for fully_connected_gpu_imad

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

* Add fully_connected_gpu_imad shape agnostic TCs for ov_gpu_unit_tests

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

* Apply comments

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

---------

Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-22 08:38:28 +01:00
Przemyslaw Wysocki
6cfea099d8 [PyOV] Align Python API's attributes and methods between its modules (#15889)
* Complete alignment

* Minor change

* Apply discussion results

* Apply discussion comments

* Clang

* Apply CR

* Code style
2023-03-22 10:22:44 +04:00
Min, Byungil
a71c83d366 [GPU] Resolve eltwise kernel build failure (#16458)
Signed-off-by: Min, Byungil <byungil.min@intel.com>
2023-03-22 15:15:02 +09:00
River Li
a204b04fae fix mem leak (#16456) 2023-03-22 09:45:03 +04:00
Xuejun Zhai
95636f7715 [Unicode API] Add wide char for compiler model APIs (#16180)
* [Unicode API] Add wide char for compiler model APIs

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Avoid duplicated func description

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix format issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Add unite test for wstring of complie model

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Clear code

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Add unite test for other compile model unicode APIs

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Clear log output

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Add parameter of device for compiled model unicode test

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-22 07:35:24 +04:00
Haiqi Pan
5e98696464 Fix Windows build warnings in template and core tests (#15967)
* fix C4305

* 1.0f

* Element

* fix c4244

* fix truncation from double to float in grn.cpp

* Revert "fix truncation from double to float in grn.cpp"

This reverts commit 5263b37cb2.

* fix grn.cpp

* add 4305

* fix low

* add TearDown

* revert softmax.cpp

* pragram

* fix conflicts

* fix conflicts

* size_t -> ov::label_t

* WIN32

---------

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-03-22 07:29:35 +04:00
River Li
d86d94edad [DOC][CAPI] document for remote tensor (#16408)
* [DOC][CAPI] document for remote tensor

* Update

* Update minor

* Update GPU_RemoteTensor_API.md

---------

Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com>
2023-03-22 01:55:51 +04:00
Tingqian Li
b70e56d110 [CPU] Support using BF16 in INT8 models (#15663) 2023-03-21 22:39:25 +04:00
Tomasz Dołbniak
234f36e9b7 TopK v11 usage in ONNX FE (#16449) 2023-03-21 17:23:29 +00:00
Pavel Esir
d8e7b39edb flush by recreating constant (#16430) 2023-03-21 18:05:11 +04:00
Ilya Churaev
85d9c11b97 Fixed build (#16442) 2023-03-21 17:13:20 +04:00
Tomasz Jankowski
0893efe073 [Core] Assure TensorVector comparison uniqueness (#16232)
* Assure TensorVector comparison uniqueness

* Add test

* Make the flow clear
2023-03-21 16:58:34 +04:00
Liubov Talamanova
d402b6ed3e [POT] Return Mul to ignored ops for transformers (except CPU_SPR) (#16407) 2023-03-21 14:53:01 +04:00
Ilya Lavrenov
24ff43aa5b Fixed comparison of iterators (#16428) 2023-03-21 14:16:07 +04:00
Sebastian Golebiewski
8926282ac5 DOCS shift to rst - Multi device execution article (#16400) 2023-03-21 10:57:48 +01:00
hyunback kim
05e54e9f3d [GPU] Update the latest onedNN3.1 (#16381)
- Fix group conv regression issue

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-21 18:56:41 +09:00
Min, Byungil
5d6cd626bc Fix unit test on dGPU (#16295)
* Resolve failed cases and queue-type issue
+ Resolved out_of_order queue-type issue
+ Added get_test_default_config for setting default config of onednn
+ Cleared failed case

Signed-off-by: Min, Byungil <byungil.min@intel.com>
Co-authored-by: tuxedcat <tuxedcat@gmail.com>
2023-03-21 18:55:06 +09:00
Wang, Yang
5af4a8e8d6 Take VPUX out of AUTO default candidate device list (#16037)
* 1. Add device blacklist for AUTO plugin.
2. Update the logic to parse out the device candidate list from the inputting config MULTI_DEVICE_PRIORITIES.
3. Update the corresponding mock test cases.
4. Ignore the GTEST warning for the test cases.

Signed-off-by: Wang, Yang <yang4.wang@intel.com>

* Update.

* Update.

* Update.

* Add description about blacklist.

* Apply suggestions from code review

Update.

Co-authored-by: yanlan song <bell.song@intel.com>

* Update.

* Apply suggestions from code review

Updated.

Co-authored-by: yanlan song <bell.song@intel.com>
Co-authored-by: River Li <river.li@intel.com>

* Update test case.

* Update test case.

* Update test case.

* Update.

* Update.

---------

Signed-off-by: Wang, Yang <yang4.wang@intel.com>
Co-authored-by: yanlan song <bell.song@intel.com>
Co-authored-by: River Li <river.li@intel.com>
Co-authored-by: Shen, Wanglei <wanglei.shen@intel.com>
2023-03-21 17:46:44 +08:00
Ilya Churaev
ec0a1e58d1 Fixed some leftovers for 2.0 dev api (#16421)
* Fixed some leftovers for 2.0 dev api

* Fixed build issue
2023-03-21 09:34:37 +00:00
Maxim Vafin
7d56c75d65 Fix MO Reader for Squeeze without axes (#16398)
* Fix MO Reader for Squeeze without axes

* Fix style

* Update tools/mo/openvino/tools/mo/utils/ir_reader/internal_ops/squeeze.py
2023-03-21 10:28:58 +01:00
Pawel Raasz
63797db257 Review ROIPooling class for shape inference aspects (#16403)
* Review ROIPooling class
- check interval shape and label propagation
- add template shape_infer
- add shape infer into cpu plugin
- add test with StaticShape

* Use get_output_roi instead of get_output_size

* Add missing includes
2023-03-21 09:02:37 +00:00
Roman Kazantsev
82a992b95d [TF FE] Fix leftovers from code review (#16422)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-21 08:31:10 +00:00
Ilya Churaev
60436dee5a Updated AsyncInferRequest documentation + leftovers (#16420) 2023-03-21 10:52:45 +04:00
Roman Kazantsev
5cb20f8858 [TF FE] Refactor StridedSlice translator and add layer test to precommit (#16376)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-21 08:54:48 +04:00
Vladimir Paramuzov
98237b06b5 [GPU] Update memory_statistics property impl (#16399) 2023-03-21 08:52:52 +04:00
Maxim Vafin
7f8786d9aa [PT FE] Make NodeContext constant inside conversion rules (#16165)
* Make NodeContext constant inside conversion rules

* Use shared_ptr

* Fix ptr

* Fix logical not
2023-03-20 22:08:24 +01:00
Karol Blaszczak
4ffecce63f {DOCS} shift to rst - benchmarks (#16354) 2023-03-20 19:22:55 +01:00
Tomasz Dołbniak
d9c70dbce3 Explicit scales for all axes in interpolate op test (#16404) 2023-03-20 16:50:47 +00:00
Ilya Churaev
9c69e2f694 Added documentation for RemoteTensor and RemoteContext (#16391)
* Added documentation for RemoteTensor and RemoteContext

* Fixed documentation build

* Fixed some build issues
2023-03-20 20:45:40 +04:00
Xuejun Zhai
73bedced87 Remove RunLocker class (#16387)
Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-20 20:26:51 +04:00
Przemyslaw Wysocki
1e512af105 Skip test_mixed_dynamic_infer on ARM devices (#16397)
* Skip test

* Minor fix

* Minor update
2023-03-20 15:23:12 +00:00
Daria Mityagina
1c7b6a7b2a [VPUX] - Tensor data with element type f16, is not representable as pointer to i16 (#16379)
* [VPUX] - Tensor data with element type f16, is not representable as pointer to i16

* [VPUX] - Tensor data with element type f16, is not representable as pointer to i16
2023-03-20 14:54:27 +00:00
Ekaterina Aidova
71167df234 [PT FE]: enable dtype in softmax and constant filling, extend logical ops support (#16276) 2023-03-20 14:12:12 +00:00
Roman Kazantsev
86f0285db2 [TF FE] Support dynamic type for all operation translators (#16380)
* [TF FE] Support dynamic type for all operation translators

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

* Add test of conversion with dynamic type

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

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-20 17:41:45 +04:00
Evgenya Stepyreva
ecc2f13dd2 CVS-105549 TFL OneHot renamed (#16388)
We rename one hot to fit the requirements of tensorflow common library.
2023-03-20 14:35:02 +01:00
Ilya Lavrenov
0c99135d44 Improved properties handling between Core and plugins (#16296)
* [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO

Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test

Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests

[HETERO][MULTI][AUTO] Make ov::device::properties regular property

[PYTHON] Update python BA with device properties

Update after rebase

Update src/plugins/auto/auto_executable_network.cpp

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>

Update src/plugins/auto/multi_executable_network.cpp

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>

Fix merge conflicts, apply some review comments

* Multiple improvements

* [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO

Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test

Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests

[HETERO][MULTI][AUTO] Make ov::device::properties regular property

[PYTHON] Update python BA with device properties

Update after rebase

Update src/plugins/auto/auto_executable_network.cpp

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>

Update src/plugins/auto/multi_executable_network.cpp

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>

Fix merge conflicts, apply some review comments

* Code style, bugfix after merging improvement

* More improvements

* Even more improvements

* Commit changes in core_impl.cpp

* Added parsing of any maps

* Fixed code-style

* Fixed AB mock tests build

* Fixed comparison

* Added new AB config key

* Improvements and fixes (#147)

* Fix BA, fix GetSupportedConfig call for virtual plugins (#148)

* Fix GPU tests (#149)

* Fix BA, fix GetSupportedConfig call for virtual plugins

* Fix GPU tests

* Code style

* Improvements 10

* Fixed incorrect tests

* Revert removal cache_dir

* Revert removal cache_dir

* Fixed clean

* Supported device ID in CPU

* More fixed tests

* clang-format

* Fix legacy GPU tests (#150)

* Removed clone_map

* clang-format

* Added clone_map back

---------

Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com>
Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 12:42:40 +00:00
Sebastian Golebiewski
8b31e3aafe DOCS shift to rst - Quantizing models article (#16260) 2023-03-20 13:13:05 +01:00
Sebastian Golebiewski
c5f65eea73 DOCS shift to rst - Tensorflow Frontend Capabilities and Limitations (#16392) 2023-03-20 12:46:11 +01:00
Sebastian Golebiewski
083596e285 DOC shift to rst - Optimize Inference article group (#16382) 2023-03-20 12:43:04 +01:00
Sebastian Golebiewski
0f4c96e96e DOCS shift to rst - Python API Exclusives (#16390) 2023-03-20 12:40:39 +01:00
Sebastian Golebiewski
76e60ff258 DOCS shift to rst - Performance Hints (#16386) 2023-03-20 12:39:31 +01:00
Maciej Smyk
350f8fd95b DOCS shift to rst - Media Processing and CV Libraries (#16343)
* rst shift
2023-03-20 12:37:08 +01:00
Pavel Durandin
4a4f06ba3b GPU documentation update (#16393)
* GPU documentation update

* GPU documentation update
2023-03-20 14:27:13 +04:00
Roman Kazantsev
997414c64d [MO][TF FE] Do not print TF FE message in case of fallback (#16384)
* [MO][TF FE] Do not print TF FE message in case of fallback

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

* Correct test model with Switch and Merge

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-20 10:06:45 +00:00
Ekaterina Aidova
f39684a7f8 [PT FE]: support mixed precision in floor divide (#16362)
* [PT FE]: support mixed precision in floor divide

* Update floordiv.cpp
2023-03-20 11:00:26 +01:00
Maksim Kutakov
4bf5a77ac9 [CPU] Lazy oneDNN memory object creation (#12972) 2023-03-20 13:56:28 +04:00
Mateusz Mikolajczyk
134ebb8889 [PT FE] Add aten::new_empty (#16312)
* Add new_empty

* Remove duplicated code for new_empty
2023-03-20 10:03:33 +01:00
Ilya Churaev
c472b020b7 Added documentation for InferRequest (#16350)
* Added documentation for InferRequest

* Updated documentation for methods

* Fixed doc
2023-03-20 13:02:15 +04:00
mei, yang
4411a6ea45 WA to resolve conflict between paddlepaddle and protobuf 3.20.3 (#16315) 2023-03-20 12:50:49 +04:00
Vladimir Paramuzov
a46fc47e6a [GPU] Enable tile with dynamic input (#16364) 2023-03-20 12:49:35 +04:00
Roman Kazantsev
3f06a9b6fb [TF FE] Test MatrixDiag translator in the pre-commit (#16377)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-20 12:20:13 +04:00
Chen Peter
bd62da9ffe Update prebuilt tbbbind static library for Windows (#16138)
Visual Studio 2019
MSVC version:"14.20.27508" 

https://codeload.github.com/open-mpi/hwloc/zip/refs/tags/hwloc-2.8.0
"hwloc.sln" configuration "ReleaseStatic" and platform "x64"

https://codeload.github.com/oneapi-src/oneTBB/zip/refs/tags/v2021.7.0

CMakeLists.txt line:226", modify the content "if (APPLE OR NOT BUILD_SHARED_LIBS)" to "if (APPLE)"

cmake -G "Visual Studio 16 2019" -A x64 -DBUILD_SHARED_LIBS=OFF
-DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON -DTBB_TEST=OFF -DTBB_BUILD=OFF
-DTBBMALLOC_BUILD=OFF -DTBBMALLOC_PROXY_BUILD=OFF
-DCMAKE_HWLOC_2_5_LIBRARY_PATH=hwloc-hwloc-2.8.0\contrib\windows\x64\ReleaseStatic
-DCMAKE_HWLOC_2_5_INCLUDE_PATH=hwloc-hwloc-2.8.0\hwloc-hwloc-2.8.0\include
-DCMAKE_HWLOC_2_5_DLL_PATH=hwloc-hwloc-2.8.0\contrib\windows\x64\ReleaseStatic
..

cmake --build . --config release

Signed-off-by: Chen Peter <peter.chen@intel.com>
Co-authored-by: Fang Xu <fang.xu@intel.com>
2023-03-20 11:56:46 +04:00
Ilya Churaev
7bce07a46e Introduce IRemoteContext (#16293)
* Intrioduce IRemoteContext

* Introduce template implementation remote tensor

* Change plugin API for abstracted remote context

* Added remote tests

* Fixed some comments

* Fixed comment

* Try to fix build

* Added core dev to plugin API

* Revert "Try to fix build"

This reverts commit 762276383d.

* Move make tensor logic to separate file

* Fixed code style

* Fixed blob allocation

* Fixed comments

* Fixed merge issue
2023-03-20 07:17:36 +00:00
Anastasia Kuporosova
8bfb6afd6a [PyOV] Remove deprecated API (#16361) 2023-03-20 10:47:06 +04:00
Chen Xu
a001f84cba [CPU] Gather node shape infer (#16168) 2023-03-20 10:30:02 +04:00
Ilya Churaev
2739a01d64 Update Variable State doc (#16358)
* Update Variable State doc

* Fixed build

* Try to fix build

* Remove error

* Fixed doc

* Fixed links

* Try to fix doc
2023-03-20 10:14:06 +04:00
Min, Byungil
bc15596c9e Remove redundant reorder (#15661)
+ Reorder 1d data
+ Reorder which only changes format

Signed-off-by: Min, Byungil <byungil.min@intel.com>
2023-03-20 14:58:09 +09:00
Oleg Pipikin
afa61ed3ec Fix ir10 inputs outputs serialization order (#16357)
* Change IRv10 serialisation to not reorder parameters and results

* Add tests

* Fix1
2023-03-20 06:57:19 +04:00
hyunback kim
4f49d0e07e [GPU] enable dumpgraph in unit-test (#15388)
Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-20 11:51:51 +09:00
Wang Wangwang
9c7f7b8338 Runtime fallback to other devices (#16015)
* Runtime fallback to other devices

* Update properties.hpp

* Update infer callback in AUTO

* Avoid some hang cases

* Add test cases for AUTO runtime fallback

* Replace mockExecutor with ImmediateExecutor

* Update the runtime fallback logic

* Update test case and support the case thar infer failed on CPU_HELP

* Update the test to detect whether to throw exception

* fix the error of CTPUT

* Add lock to AUTO executable network GetContext

* Update variable name in selectOtherDevice API

* Simplify variables and add testcase to improve test coverage

* Fix the issues when release CPU_HELP device and clean up the code

* Clean up code
2023-03-20 10:13:07 +08:00
Ilya Churaev
b2a2266f60 Implement VariableState support for the Template plugin (#16356)
* Implement VariableState support for the Template plugin

* Suppress some warnings

* Try to fix Windows
2023-03-17 22:10:47 +04:00
Ilya Churaev
e6ceed0bb9 Add documentation for compiled model (#16332)
* Files renaming

* Updated CompiledModel documentation

* Fixed typo

* Fixed comments

* Fix comments and try to fix the documentation

* Fixed execution devices
2023-03-17 21:59:39 +04:00
Tomasz Dołbniak
6889101415 Axes bugfix (#16365) 2023-03-17 17:49:46 +00:00
Sebastian Golebiewski
d189df169c Update tutorials (#16368) 2023-03-17 17:15:32 +01:00
Egor Duplenskii
a754473689 [CPU][TESTS] Use run_on_model instead of run_on_function (#16359) 2023-03-17 14:18:09 +00:00
Tomasz Dołbniak
a99a5057e2 TopK v11 -> v3 downgrade transformation (#16339) 2023-03-17 12:40:56 +00:00
Vladislav Golubev
249d57f37e [Transformations] CompressQuantizeWeights: fp16 weights support (#16323)
* [Transformations] CompressQuantizeWeights: fp16 weights support

* Code style fix

* Code style fix
2023-03-17 14:43:32 +04:00
bstankix
d7c88fd694 Rebuild graph rendering (#16321)
* Bugfix and restyle graphs rendering
2023-03-17 11:36:46 +01:00
Egor Duplenskii
e1e44d6bac [CPU] Move to oneDNN v3.1 (#15918) 2023-03-17 14:17:55 +04:00
Xuejun Zhai
a9bd5f741d Xuejun/remove api model (#15924)
* [Remove APIs] remove api m_transformation_callback

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove api run_on_function(), replaced by run_on_model()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove set_callback(), use get_pass_config() to configure transformation pipeline

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove api add_matcher()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix format issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] Fix review comments

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix formast issue

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix merge master error

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Fix CI compiler error

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Update ONNX Runtime from rel-1.8.1 to rel-1.14.0

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Revert "Update ONNX Runtime from rel-1.8.1 to rel-1.14.0"

This reverts commit e31a9e04b7.

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-17 10:44:28 +04:00
Vladimir Paramuzov
bb59672639 [GPU] Fixed shape agnostic scatter nd update kernel (#16319) 2023-03-17 09:57:25 +04:00
Wilson Seok
c5ccb3e954 add condition for activation ceil so it works when data type is fp32 or fp16 only (#16334) 2023-03-17 11:46:44 +09:00
hyunback kim
8d1139b61a Fix unet3d mlperf dump (#16253)
* Enable dump in unet3d_mlperf

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-17 10:51:40 +09:00
Pawel Raasz
cb241a8e4a [Core] Non constant support for b2s and s2b nodes (#16290)
* Fix inference for non-const inputs for operators:
- batch to space
- space to batch

* Evaluate of b2s, s2b supports all parameter inputs
- update template plugin test to use parameters instead constants
2023-03-16 20:22:03 +01:00
Irina Efode
0ee8c966b2 [CONFORMANCE] Fix API report (#16338) 2023-03-16 22:15:51 +04:00
Andrew Kwangwoong Park
e4500c7d61 [GPU] Fixes for dynamic model in dGPU (#16298)
Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-16 11:09:55 -07:00
Denis Orlov
6ffa8da922 Fix documentation (md and inline) for C++ and Python spech samples (#16185)
* Fix documentation (md and inline) for C++ and Python spech samples

* Fix clang-format

* Minor fix

* Fix clang-format

* Fix a typo

* Fix according to Mike's review

* Fix clang-format
2023-03-16 15:44:12 +00:00
Tomasz Dołbniak
6762fe692d Interpolate-11 spec + core op (#16162) 2023-03-16 14:37:57 +01:00
Tatiana Savina
8a7956e3cb DOCS shift to rst transformations (#16269)
* transformations to rst

* fix snippets

* fix links

* add sphinx directive

* change img path

* fix snippet path

* fix link

* fix anchor

* fix transformation image

* fix reference

* fix reference anchor

* fix matcher pass link
2023-03-16 13:57:18 +01:00
Marcin Kacprzak
91b9675bed [GNA] Replace log::warning() with THROW_GNA_EXCEPTION for unsupported Concat (#16144) 2023-03-16 12:41:38 +00:00
Xiuchuan Zhai
9229b4967e [CPU] optimize shape infer of stridedslice (#16069)
* optimize shape infer of stridedslice

* Update src/plugins/intel_cpu/src/nodes/strided_slice.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* Update src/plugins/intel_cpu/src/nodes/strided_slice.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* Update src/plugins/intel_cpu/src/nodes/strided_slice.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* fix accoding to comments

* re-use get_sliced_value func

* re-use get_sliced_value func

---------

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>
2023-03-16 12:27:14 +01:00
Karol Blaszczak
a72b9bac2f [DOCS] shift to rst - resources (#16256) 2023-03-16 12:10:27 +01:00
Jan Iwaszkiewicz
0372ca929a [PyOV] Constant/Tensor from scalars (#16270) 2023-03-16 11:15:19 +01:00
Tatiana Savina
c18f3824b0 DOCS shift to rst Custom operations (#16254)
* move to rst

* move to rst

* change intro

* fix_directive

* fix code snippets

* sphinx snippets fix

* change link

* align tab

* snippet path fix

* fix code snippet path

* fix code snippets

* fix hyperlink

* change format

* change intro

* fix list format
2023-03-16 10:55:39 +01:00
Wilson Seok
461cc2aee8 change activation position in reorder_data_bfyx_to_blocked_format kernel (#16307) 2023-03-16 17:48:23 +09:00
Ilya Churaev
790f74c01c Update building and plugin testing docs (#16333)
* Update building and plugin testing docs

* Fixed typo
2023-03-16 12:39:06 +04:00
Ilya Churaev
fbc420093d Fix Loaded from cache for new plugin API (#16301)
* Extend template plugin tests

* Fixed loaded_from_cache for new API

* Added const

* Added ov::loaded_from_cache as supported property of CompiledModel

* Remove loaded_from_cache from core

* Reverted logic for old plugins

* Fixed comments

* Fixed build
2023-03-16 12:29:56 +04:00
Xiping Yan
2194552dc5 [CPU] Fix crash issue: RuntimeError: Primitive descriptor was not found for… (#16186) 2023-03-16 10:17:06 +04:00
Andrei Gorbachev
2f3ae4518e [GPU] Fix warnings (#16196)
* fix 1

* fix 2-10

* fixed code style

* fixed win plugin

* fixed linux plugin

* fixed a part of tests

* fixed test fot linux

* fixed pooling_gpu_test fot linux

* fixed pooling_gpu_test fot linux

* fix after review and enable wd4267 in makefile

* fix after review

* errors of unit test are fixed
2023-03-16 09:29:16 +04:00
Xuejun Zhai
05866f05ea Update ONNX Runtime from rel-1.8.1 to rel-1.14.0 (#16184)
* Update ONNX Runtime from rel-1.8.1 to rel-1.14.0

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Upgrade Cmake to 3.24.0

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Revert "Upgrade Cmake to 3.24.0"

This reverts commit 04a00f60c0.

* Update CMake to version 3.24.0

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* Skip CApiTest.test_custom_op_openvino_wrapper_library test for tmp, will add back with the new ONNX Runtime version

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-16 07:14:51 +04:00
Karol Blaszczak
0e1df68263 DOCS-image-fix-fix (#16324) 2023-03-15 19:41:38 +01:00
Irina Efode
072acc1ea7 Fix win run (#16309)
* ix conformance on win

* fix summarizer

* try
2023-03-15 19:45:21 +04:00
Ilya Churaev
8189d18648 Revert ITensor leftovers (#16316) 2023-03-15 18:44:12 +04:00
Sebastian Golebiewski
0d5b5b187d [DOCS] Adding 'Scrollbox' - new sphinx directive (#15305) 2023-03-15 15:23:20 +01:00
yanlan song
6ff02f5e25 remove invalid cases (#16234)
Signed-off-by: fishbell <bell.song@intel.com>
2023-03-15 13:58:48 +00:00
Ivan Tikhonov
e1ee8f0ec8 TransposeSinking refactoring: part 2 (class names, folders, file names) (#16291)
* Add descriptions to the transformations, add additional checks

* fix a warning

* TransposeSinking Rafactoring part2: move the transformations to a separate folder, align namespaces

* TransposeSinking refactoring: class names, namespaces

* codestyle

* resolve merge conflicts
2023-03-15 17:18:39 +04:00
Vladimir Paramuzov
28d3e1087e [GPU] Fix strided slice kernel with begin/end/stride as inputs (#16302) 2023-03-15 16:25:45 +04:00
Maciej Smyk
d59d8ba3a2 DOCS shift to rst - Additional Configurations (#16284) 2023-03-15 12:21:16 +01:00
Sebastian Golebiewski
523c587d29 DOCS shift to rst - Troubleshooting Reshape and NoDynamicShapes (#16304) 2023-03-15 11:58:57 +01:00
Maciej Smyk
bd1b00d654 DOCS shift to rst - OpenVINO™ Security Add-on (#16251) 2023-03-15 11:57:54 +01:00
Tomasz Jankowski
0f9583c3cf [Transformations] Nop-eliminate 1D Reshape node (#16083)
* Nop-eliminate 1D Reshape node

* Don't eliminate checking Reshape node
2023-03-15 14:43:46 +04:00
Tingqian Li
fdc2664b24 fix special FQ node (#14594)
* fix special FQ with zero range in quantized models

* fix format & comments

* Add test case

* remove dot interval test case from smoke_LPT/FakeQuantizeTransformation.CompareFunctions

* Remove dot interval gpu test case because Pooling is also folded

* handle review comment

* fix code style

* update docs

* remove fold_zero_multiply
2023-03-15 10:13:29 +00:00
Katarzyna Mitrus
f0c153858b [ShapeInference] EmbeddingBag-Offsets/Packed-Sum shape infer improvements (#16072)
* shape_infer

* Register EmbeddingBagPackedSum shape_nfer for CPU

* Tests

* Merge shapes to preserve 2rd input info

* More label tests

* Add emb_table size check

* rename shape infer file

* Add more tests

* Update constexpr

* Use OV_EXPECT_THROW

* Style

* Reuse emb_table for dynamic rank

* Add common util to calculate emb output shape

* Update embd shape infer to use common util

* Update embedding shape infer util
2023-03-15 11:12:57 +01:00
Katarzyna Mitrus
69ba802e03 [ShapeInference] EmbeddingSegmentsSum shape infer improvements (#16119)
* Update shape_infer

* type prop tests

* Preserve interval and label from input

* Add more tests

* Add emb table scalar check

* Update to use OV_EXPECT_THROW

* Update constexpr

* Code refactor
2023-03-15 11:05:52 +01:00
Maciej Smyk
76f29f8532 DOCS shift to rst - Installing OpenVINO (#16311) 2023-03-15 10:57:03 +01:00
Pawel Raasz
bdf1923972 Review bucketize shape inference (#16136)
* Review bucketize shape inference:
- check interval dimension and label propagation
- check template shape_infer implementation
- minor refactoring and add tests

* Add missing using of namespaces
2023-03-15 10:19:57 +01:00
Karol Blaszczak
ab684036f4 DOCS-image-fix (#16308) 2023-03-15 10:16:55 +01:00
Sebastian Golebiewski
a3d53c0415 DOCS shift to rst - Heterogeneous execution (#16285) 2023-03-15 09:57:30 +01:00
Sebastian Golebiewski
85f80f2a03 DOCS shift to rst - Stateful Models and LowLatency articles (#16288)
Fixing directives for snippets and inline code blocks. Shifting to reST.
2023-03-15 09:56:37 +01:00
Karol Blaszczak
d774cc65a9 DOCS shift to rst - cpu n gna (#16252) 2023-03-15 09:39:09 +01:00
Georgy Krivoruchko
36c18e29a8 [TF FE] Added Tensorflow CTCLoss layer test (#13644)
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-03-15 08:18:29 +00:00
Maciej Smyk
4b7b3fb0ae DOCS shift to rst - Openvino Ecosystem article update (#16050)
Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2023-03-15 08:51:49 +01:00
Daria Ilina
e4f44b19fd Mark all failed ONNX layer tests as skip (#16188)
* Mark all failed ONNX layer tests as XFail

* Add additional xfailed marks

* Add one more failed tests into XFail

* Add conditions for CPU/GPU failures

* Revert "Add conditions for CPU/GPU failures"

This reverts commit 790524c59c.

* Add failures separation for CPU/GPU

* Replace all xfail with skip
2023-03-15 12:22:32 +06:00
Vladimir Paramuzov
e44fd03d2a [GPU] Shape agnostic concat kernel + refactoring (#16170) 2023-03-15 09:47:31 +04:00
Ilya Churaev
4b7d1d9f50 Remove redundant clone from Serialize pass (#16277)
* Remove redundant clone from serialize pass

* Revert padding changes in serialize pass

* Provide a class for local copy of nodes with paddigs

* Fixed comments
2023-03-15 07:23:54 +04:00
Eddy Kim
e348481849 [GPU] Transformed IR serialization for dynamic models (#16169)
* IR serialization for dynamic models

* added ShapeOf1To3 transformation pass

* fixed input output type mismatch

* removed unnecessary codes

* moved ConvertShapeOf1To3 from common to GPU plugin

* updated copyright year

* fixed build errors
2023-03-14 11:03:02 -07:00
Mateusz Tabaka
8477bc8897 Reduce the number of validate and infer types in ConvertPrecision (#15277)
* Reduce the number of validate and infer types in ConvertPrecision

Currently, ConvertPrecision pass frequently runs validate and infer types.
This is due to the fact that it iterates over every precision pair, then over
the whole model followed by validate and infer types.
The proposed solution is to iterate over the model: for each node iterate
over precisions array, update the node if required followed by validate and
infer types.

Ticket: 81311

* use map

* clang format

* move enum hasher

* fix gpu

* revalidate

* reinvalidate if node has changed

* remove validate for input prec changes

* fix gpu

* review

* find

* fix pytorch case

* revalidate

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-03-14 21:45:24 +04:00
Maciej Smyk
7578c636b9 DOCS shift to rst - OpenVINO Security (#16280) 2023-03-14 17:23:34 +01:00
Ilya Churaev
95faa573ed Introduce ITensor instead of Blob (#16048)
* Introduce ITensor

* Added new allocator

* Hide ITensor from dev api

* Changed some python tests

* Remove deprecated API from sample

* Fixed warnings

* Skiped unsupported tests

* Fixed exception message

* Fixed template func tests

* Fixed incorrect tests

* Fixed comments and move ITensor to developer API

* Fixed CI issue

* Fixed allocated tensor

* Fixed docs and windows warning

* Fixed set shape for strided tensors

* Fixed build and some comments

* Introduce remote tensor

* Fixed code style

* Fixed build

* Remove static assert method

* Remove fail type

* Added device name API

* Try to fix GPU remote tests

* Added debug output

* Try to fix GPU tests

* Fixed comments

* Fixed build

* Added additional element type check

* Revert some comment changes
2023-03-14 19:12:27 +04:00
Ivan Tikhonov
596036a2db Transpose Sinking: refactoring (#16283)
* Add descriptions to the transformations, add additional checks

* fix a warning
2023-03-14 13:55:25 +00:00
River Li
0ca3ccb7fb [CAPI][TEST] remove testdata repository dependency (#16259)
* [CAPI][TEST] remove testdata repository dependency

Change-Id: I93798d47bcf4abf69562f76aab1469498b4e9ee1

* SCI issue

Change-Id: Ifb422fafdefe26be85a0ae8efdc1530f7f032079

* Apply TEST SUIT for C API tests

Change-Id: Ic716cdb357060e1cbf989871ae39d006f2878632

* Fix issue for static build

Change-Id: I5d33f23b48dcda4baf260553aa8d34e62c13c128
2023-03-14 12:34:33 +00:00
Tomasz Jankowski
0145e538f5 TopK v11 reference implementation (#16137)
* Stabilize ascending comparison of ref impl

* Use reference to gtest param

* Create ref impl tests

* Fix descending by index sorting

* Sort by index both ways

* Make sort by index always ascending (revert)
2023-03-14 12:13:53 +00:00
Sebastian Golebiewski
497b7885da DOCS shift to rst - Model Creation in OpenVINO RUNTIME (#16278) 2023-03-14 09:42:44 +01:00
Sebastian Golebiewski
a8be566e24 DOCS shift to rst - Configuring Devices (#16247) 2023-03-14 09:41:35 +01:00
hyunback kim
164db3def9 [GPU] Fix twin tranformer functional regression. (#16111)
* [GPU] Fix twin tranformer functional regression.

gemm/FC select_preferred_format select simple format depends on out rank size.

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-14 17:34:41 +09:00
Sebastian Golebiewski
1268bfdca2 DOCS shift to rst - Shape Inference and Preprocessing (#16213) 2023-03-14 09:31:44 +01:00
Taylor Yeonbok Lee
3a96e06d4c Minor fixes (#16275)
- Fix are_data_types_suitable_for_onednn not to invalidate output layout
- Fix seg fault of printing resample node info
2023-03-14 08:09:54 +00:00
Fang Xu
ae37ca671c [CPU] Fix core dump issue for ENABLE_DEBUG_CAPS (#16229) 2023-03-14 10:32:57 +04:00
Roman Kazantsev
dcc8a36d88 [TF FE] Test Switch and Merge support by TF FE (#16255) 2023-03-14 00:50:47 +04:00
Roman Kazantsev
3b71286f1d [TF FE] Test low-level While support by TF FE (#16257) 2023-03-14 00:50:22 +04:00
Taylor Yeonbok Lee
f0f1c47063 Fix concat to use ngraph shape infer (#16226)
Fix crop to return shape of original rank
2023-03-13 20:25:23 +00:00
Anastasiia Pnevskaia
9462b3ea16 Fixed clearing of pipeline config params and TF session in convert_model() (#16191)
* Fixed pipeline config params clearing.

* Added clearing of TF session. Added tests.
2023-03-13 20:03:02 +04:00
Georgy Krivoruchko
ca6ad433e4 Updated reading file (#16203) 2023-03-13 19:49:57 +04:00
Zlobin Vladimir
fbc9516662 Update Open_model_zoo submodule (#16218) 2023-03-13 15:28:07 +00:00
Tomasz Adamowicz
5311ab0938 [GNA] Refactor memory alignment macro usage (#15749)
* Add possibility to use memory alignment different than 64B

* update tests for new memory api

* Remove ineffective code

* [FIX] Fix memory alignment issues for graph compiler primitives

* Update after review
2023-03-13 15:22:58 +00:00
Tingqian Li
625890c666 [CPU] Flush denormals to zero only when DAZ is off (#12315) 2023-03-13 16:04:12 +01:00
Ilya Lavrenov
f080a0d9cf Added NCC style for frontends sources (#16200)
* Ability to provide several source dirs for ncc-style checks

* Fixed include headers; added NCC to TF common

* Fixed NCC for frontends

* Fixed NCC for frontends

* Extra fixes

* Fixest push --f

* Clang-format

* Apply comments

* Add an option to specify required clang-format version

* Update src/frontends/tensorflow/src/decoder_proto.cpp

* Update src/frontends/tensorflow/src/decoder_proto.cpp
2023-03-13 14:54:00 +00:00
Sebastian Golebiewski
a84f87e9dc DOCS shift to rst - Preprocessing article (#16250) 2023-03-13 14:50:44 +01:00
Sebastian Golebiewski
bf8c7fe668 DOCS shift to rst - Preprocessing API - details article (#16241) 2023-03-13 14:50:16 +01:00
Pawel Raasz
72566cde0d Review pooling classes for shape inference aspects (#16114)
* Review adaptive avg pool shape inference

* Review adaptive max pool shape inference

* Review AvgPool and MaxPool

* Minor improvement for StaticShape

* Update ShapeInferBaseWithPadding's infer
to be compatible with interface after rebase

* Fix build issues

* Set default pads before checks

* Fix include openvino headers
2023-03-13 12:48:44 +00:00
Ilya Churaev
63338b6e08 Introduce openvino ExecutionNode (#16242) 2023-03-13 15:45:08 +04:00
Sebastian Golebiewski
e19ba8b3e2 DOCS shift to rst - Layout API Overview article (#16244)
* shift-to-rst
2023-03-13 12:13:49 +01:00
Roman Kazantsev
0ffa4eb507 [Core] Allow ScatterND inputs type to be dynamic (#16236)
* Allow ScatterND inputs type to be dynamic

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

* Update src/core/src/op/util/scatter_nd_base.cpp

Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>

* Update src/core/src/op/util/scatter_nd_base.cpp

Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>

* Update src/core/src/op/util/scatter_nd_base.cpp

* Apply code-style

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
2023-03-13 10:36:00 +00:00
Irina Efode
df6cd3303a [CONFOMANCE] Add handling crashes (#16214)
* [CONFOMANCE] Add handling crashes

* Fix win paths
2023-03-13 14:23:26 +04:00
Ivan Tikhonov
8da01d4c2d TransposeSinking transformation: support new ops and fix performance issues (#15660)
* Resolve the performance issues in TransposeSinking transformation

* codestyle

* fix warning as error, fix tests failures

* fix ts for Concat and Reduce

* Fix TransposeReduceBackward

* fix the issue in TransposeFuse transformation

* fix TransposeReduce transformations

* Fix TransposeReduction, fix TransposeSinkingSplit, add unsqueeze support

* delete debug print

* Add additional validations

* fix node validation

* Fix validate for split, revert changes for concat, add BatchToSpace/SpaceToBatch

* Add SpaceToBatch/BatchToSpace

* fix TS for Interpolate + codestyle

* fix gna build

* Support TS for Interpolate, VariadicSplit, IsInf, IsNan, IsFinite + refactoring

* add the missed line

* add include

* TransposeSinking tests refactoring: part1

* TransposeSinking tests refactoring: part2

* Add limited support for StridedSlice op

* codestye

* TransposeReduction: skip the case when 2nd input for Squeeze is not provided

* Transpose sinking tests refactoring: part 3. + Revert changes in MOC.

* fix build

* codestyle

* Add tests for TS backward transformations, update TransposeSinkingFuse transformation, delete StridedSlice transformation prototype + tests refactoring

* fix unary tests

* Fix warning as error on Windows

* Add new tests for Unsqueeze/Squeeze; refactoring; remove debug code

* codestyle
2023-03-13 14:18:02 +04:00
Piotr Krzemiński
2eef025773 [PYTHON] Introduce Json Statistics Report aligned with C++ version (#15692)
* [PYTHON] Introduce Json Statistics Report aligned with C++ version

* [PYTHON] Update README with new json_stats flag

* [PYTHON] Fix missing StatisticsReportConfig compilation error

* [PYTHON] Fix README formatting

* [PYTHON] Fix indent, fix pcsort error thrown for timedelta/int type mismatch, fix some compilation errors

* [PYTHON] Apply Pythonization ideas & fix JSON report showing incorrect category results

* Update tools/benchmark_tool/openvino/tools/benchmark/utils/statistics_report.py

Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>

* [PYHON] Align multiple-iterations behavior for reports

---------

Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2023-03-13 13:58:40 +04:00
Sebastian Golebiewski
1e757de195 [DOCS] shift to rst - OpenVINO Inference Request 2023-03-13 10:04:54 +01:00
Ilya Churaev
087c3bd0af Fixed typo in core tests (#16235) 2023-03-13 07:15:54 +00:00
Paul Youngsoo Ahn
e8b108ac6b [GPU] Change lws to avoid synchronization issue in nonzero_count (#16116)
* [GPU] Change lws to avoid synchronization issue in nonzero_count (#16116)

* [GPU] Add unit test (#16116)

* [GPU] update count_nonzero_ref kernel(#16116)
- Support the case total data size exceed max work group size
- Add dynamic shape test case

* [GPU] Change input indexing calculation and add random input generator in unit test (#16116)

* [GPU] update random generation input funciton in nonzero_count (#16116)

* [GPU] update unit test (#16116)

* [GPU] cldnn unit test: update random generation function for other test failure (fusings_gpu/conv_fp32_multi_eltwise_quantization.basic/0) (#16116)
2023-03-12 23:32:20 -07:00
Zlobin Vladimir
0e91b07422 Prohibit FP16 FP32 values for cpp benchmark_app (#16217)
Ticket 100990

Python benchmark_app already prohibits FP16 and FP32.
2023-03-13 09:27:52 +04:00
Roman Kazantsev
32ac952e5f [TF FE] Convert a model with Framework nodes (#16053)
* [TF FE] Convert a model with Framework nodes

Now the conversion pipeline will convert all unsupported operations to Framework nodes
It is done with a hope that sub-graphs with Framework Nodes will be cut in later stages
like auto-pruning.

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

* Fix build issue

* Fix dynamic element type for FusedBatchNorm

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

* Fix build issue

* Fix build issue

* Continue translation in case translator limitation

* Change undefined to dynamic type

* Have one more change to dynamic type

* Change undefined to dynamic in Const translator

* Expect MO to handle dynamic type

* Exclude TransposeSinking pass if model contains Framework nodes

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-12 01:42:34 +00:00
Ilya Lavrenov
1874c072b2 switched public Azure Linux build to clang (#16198)
* switched public Azure Linux build to clang

* Fixed GNA compilation

* Suppressed warning in GNA tests

* switched public Azure Linux build to clang

* Fixed GNA compilation

* Suppressed warning in GNA tests

* More fixes

* Skip test on CPU
2023-03-11 11:01:27 +04:00
Sebastian Golebiewski
a1a35e9211 issue-15090 (#16207)
Add command for installation of prerequisites on Linux.
2023-03-11 00:04:59 +04:00
Sebastian Golebiewski
8446f38924 DOCS shift to rst - Inference Pipeline article (#16224) 2023-03-10 18:13:15 +01:00
Ilya Churaev
75314c2c53 Rename OPENVINO_UNREACHABLE to OPENVINO_THROW (#16201)
* Changed some exceptions to OPENVINO_THROW

* Changed samples throw exception

* Fixed some comments

* Remove OPENVINO_UNREACHABLE
2023-03-10 20:23:13 +04:00
Maciej Smyk
4e89150a7c DOCS shift to rst - OpenVINO™ integration with TensorFlow (#16221) 2023-03-10 16:31:52 +01:00
Sebastian Golebiewski
63041ca559 234 update (#16211)
Adding notebook 234-encodec-audio-compression
2023-03-10 16:29:26 +01:00
Sebastian Golebiewski
4d8a4d3957 DOCS shift to rst - Dynamic Shapes article (#16215) 2023-03-10 16:20:06 +01:00
Maciej Smyk
5e406a80d3 [DOCS] OpenVINO Wiki links update - master (#16219)
* wiki links
2023-03-10 16:16:14 +01:00
Irina Efode
da8d5ba056 Fix generation of report in CI (#16209) 2023-03-10 14:02:43 +01:00
Karol Blaszczak
fa2ffc3bb4 Update prerelease_information.md (#16206) 2023-03-10 12:51:45 +01:00
Roman Lyamin
b8e1dea345 [GPU] Fix binary_convolution non-constant weights (#15898)
* [GPU] Fix binary_convolution non-constant weights

* [GPU] Remove unused checks related to allowInputReordering
2023-03-10 14:36:12 +04:00
Xiping Yan
198e90944f JIRA 93714 change bfloat16 to trivial for ov::core (#15922)
* Update bfloat16 to trivial type.
Remove "pragma GCC diagnostic ignored "-Wclass-memaccess""

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* float16 also need to be transferred to Trivial.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2023-03-10 09:53:28 +00:00
Ilya Churaev
7a0beb5f1d Template plugin class doc (#16152)
* Update template plugin main documentation pages

* Update plugin documentation

* Add more documentation for method

* Register new doxygen groups

* Updated group

* Added ie group

* Fixed comments

* Reuse new implementation inside the old one

* Try to fix titles

* Fix class fields level
2023-03-10 13:42:26 +04:00
Sebastian Golebiewski
3c8bb1492e [DOCS] Align tabs in 'Install from PyPI' article - for master (#16085)
* align tabs

* Update installing-openvino-pip.md

* Update installing-openvino-pip.md

* Update installing-openvino-pip.md
2023-03-10 13:03:42 +04:00
Ilya Lavrenov
fa9677a6ee Removed visibility settings from samples (#16192) 2023-03-10 12:58:15 +04:00
Daria Mityagina
34bab897d6 [VPUX] - benchmark app issue fix - PERFORMANCE_HINT: UNDEFINED (#16065)
* [VPUX] - benchmark_app issue

* [VPUX] - benchmark_app issue - review
2023-03-10 12:46:51 +04:00
Karol Blaszczak
670668e593 DOCS shift to rst - devices and ARM (#16193) 2023-03-10 09:25:33 +01:00
Karol Blaszczak
0f19e9c0d2 shift to rst - GPU articles (#16175)
Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com>
2023-03-10 08:34:27 +01:00
Ilya Churaev
45bdbf7486 Changed throw ov::Exception to macro (#16150)
* Changed throw ov::Exception to macro

* Fixed code style

* Revert myriad headers

* CPPlint fixes

* Fixed typo
2023-03-10 11:14:50 +04:00
Maxim Vafin
ec8a4abf6d Support more complicated cases of list concatenation (#16139)
* Support more complicated cases of list concatenation

* Fix codestyle

* Add tests
2023-03-10 07:51:10 +01:00
Chenhu Wang
a1510a5e5f fix warnings of overloaded virtual function (#16195) 2023-03-10 10:35:51 +04:00
Sofya Balandina
8e24483f5c Add missing ov_executable_network tests for teamplte plugin (#16190) 2023-03-10 10:28:37 +04:00
Maciej Smyk
da9b014c83 [DOCS] Moving How to build documentation from wiki to md docs - master (#16063)
* conditional_compilation

* how-to-build-2

* Update local-distribution.md

* Update build.md

* Update build.md

* Update docs/dev/build.md

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

* Update docs/dev/build.md

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

* Update docs/dev/static_libaries.md

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

* Update docs/dev/building_documentation.md

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

* Changes after review

* Update docs/dev/building_documentation.md

* Update docs/dev/static_libaries.md

* building articles update

---------

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
2023-03-10 10:24:56 +04:00
Ilya Lavrenov
6586742204 Disable sentencepiece extension in static build (#16194)
* Disable sentencepiece extension in static build to prevent double linking of protobuf

* Update .ci/azure/windows.yml
2023-03-10 09:35:36 +04:00
Mykhailo Hnap
d5e98cbdce [GPU] IsFinite, IsInf, IsNaN operations (#15979)
* [GPU] Enabled ComparisonLayerTest in single layer tests.

It seems that before, these tests were disabled cause of some failures. Now I cannot see any errors, so I just enabled all of them.

* [GPU] Run clang format for comparison single layer tests.

* [GPU] Added handling of f16 type to IsInfLayerTest.

* [GPU] Added single-layer tests for IsFinite and IsNaN operations.

* [GPU] Added single-layer test for IsInf operation.

* [GPU] Implemented IsFinite, IsInf, and IsNaN operations as activation functions.

But notice that currently, the activation kernel support only the same output data type as the input data type. So an additional reorder would be needed to convert to the correct output data type for these ops. Also worth noting is that activation functions are fused in reorder kernel. But for now, it's not working for these ops because in reorder activation call, there is a hard conversion of input data to output data type before activation. I don't know why it's added there, but it breaks fusion. So need to fix this activation fusion or disable this fusion for these ops.

* Revert "[GPU] Implemented IsFinite, IsInf, and IsNaN operations as activation functions."

This reverts commit 3f9ffe617ecddce6dbbcdeab9584a7ddeb6d1845.

* [GPU] Implemented IsFinite, IsInf, and IsNaN operations as eltwise op.

* [GPU] Changed CLDNN_ERROR_MESSAGE to OPENVINO_ASSERT in check_inputs_count method.
2023-03-09 16:10:48 -08:00
Andrew Kwangwoong Park
3ec386a741 [GPU] Minor fixes for dynamic BERT models (#16158)
* [GPU] Minor fix for dynamic bert-base-uncased-qqp

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

* Fix to check full tensor only for static shape during creating onednn gemm

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

---------

Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-09 14:48:08 -08:00
Taylor Yeonbok Lee
dff7f2451b Revert PR15386's change (#16172)
- Previously, PR15386 changed allocation of memory of primitives which are to be used as shape infer dep to host memory, for better shape infer perf.
- However this causes cache coherence issue in dGPU.
- Reverting this change so that the memory will be allocated to devicet
2023-03-09 22:44:32 +00:00
Mateusz Mikolajczyk
31489931cf [PT FE] Fix failing translation of aten::index_put_ (#16140)
* Initial commit

* Fix for reading processed list

* Format code

* Cleanup

* cleanup

* Cleanup

* cleanup test

* Add comment

* Add rt_info

* fix type

* Update src/frontends/pytorch/src/transforms/aten_index_put_replacer.cpp

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

---------

Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-03-09 20:14:58 +00:00
Alina Kladieva
654f3d988f Revert "Update open_model_zoo submodule (#16181)" (#16189)
This reverts commit a9cc52b462.
2023-03-09 20:10:47 +04:00
Roman Kazantsev
326aedb5f8 [TF FE] Support EmptyTensorList and TensorListPushBack operations (#16183)
* [TF FE] Support EmptyTensorList and TensorListPushBack operations

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

* Rename a script to generate the test model

* Correct test model generating script

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-09 19:06:16 +04:00
Ryszard Jezierski
1051226fc9 Updated GNA lib version to 1906 (#16122) 2023-03-09 14:58:46 +00:00
Zlobin Vladimir
a9cc52b462 Update open_model_zoo submodule (#16181) 2023-03-09 17:06:19 +04:00
Pavel Esir
e43f606750 [LoadTime][MO] flush fp32 subnormals to zero at offline phase (#15929)
* flush fp32 subnormals to zero in IR

* style fix in test_offline_api.py

* simplified call of FlushFP32SubnormalsToZero: is called form offline_transformations.cpp

* reverted offline_transformations.py

* use fpclassify

* style-fix

* Update src/common/transformations/tests/common_optimizations/flush_fp32_subnormals_to_zero_test.cpp

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-03-09 16:21:28 +04:00
Maksim Proshin
f04507f56c Added "accuracy" value for "preset" parameter (#16016)
Added "accuracy" value for "preset" parameter
2023-03-09 14:59:29 +04:00
Karol Blaszczak
94b533b284 Update OV_2023_models_supported.pdf (#16179) 2023-03-09 11:57:41 +01:00
River Li
474ea8a8e2 Fix minor build error in ubuntu 22.04 (#16171)
Change-Id: I15180787f3196001d00137664e22d71aff4d0b32
2023-03-09 10:02:36 +00:00
Ilya Churaev
5040f59c96 Use new CPUStreamsExecutor inside the old one (#16164) 2023-03-09 13:41:38 +04:00
Sungeun Kim
0365ebf5ad disable test case: fusings_gpu/lrn_fp16_eltwise_activation.basic/7 (#16149) 2023-03-09 08:38:33 +00:00
Ilya Lavrenov
cc8295f27e Fixed PT FE compilation with clang on macOS (#16173) 2023-03-09 12:32:02 +04:00
Mateusz Bencer
c7e479ff78 [ONNX FE] Improved a method of operators registration (#15990)
* initial version of implementation

* styles applied

* fixed and registration

* add more unit tests

* fixed and in legacy opset

* review remarks

* refactor of version name range
2023-03-09 07:22:06 +01:00
Jade Cho
aaeace9740 [GPU] Fix stable diffusion failure (#16052)
* [dGPU] Enable stable diffusion

+ Prevent to fuse swish into oneDNN reorder.
+ Makes concat explicitly if batch size is greater than 1 and the siblings are oneDNN impl.
2023-03-09 14:35:31 +09:00
Andrew Kwangwoong Park
b7ff3a1d64 [GPU] Added shape agnostic Pad kernel implementation (#16160)
Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-08 15:36:43 -08:00
Ilya Lavrenov
3d52fc843a Fixed RelWithDebInfo build (#16159) 2023-03-08 20:00:30 +04:00
Edward Shogulin
75c73a38f8 [nGraph] VisualizeTree cclang quick fix (#16155) 2023-03-08 19:36:25 +04:00
Ilya Lavrenov
c3b22af3f7 CoreImpl small refactoring (#16145)
* Small CoreImpl refactoring

* Removed cache_dirhandling from CPU plugin

* clang-format

* Fixed python tests

* Fix

* Fixed bugs in HETERO case

* Fixed clang-format and warnings in auto plugin

* Added import_export as capability for TEMPLATE plugin

* Commented throw exception from loaded_from_cache

* Fixed clang-formatof ro template plugin
2023-03-08 19:19:52 +04:00
Roman Kazantsev
f3e7e55968 [TF FE] Support multioutput body graph nodes (#16142)
This is a corner case because body graph nodes have named output ports.
This allows to support custom RetinaNet model.

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-08 17:29:42 +04:00
Karol Blaszczak
3dbea43ef1 [DOCS] remove mentions of myriad throughout docs (#15690)
* remove ov::device::thermal

ov::device::thermal was only supported on myriad

* additional cleanup

* remove myriad from AUTO and MULTI

auto n multi n hetero

+ remove mentions of listing myriad devices

* two final fixes

* Update ov_auto.py

---------

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2023-03-08 17:29:08 +04:00
Vladimir Paramuzov
75b48f2153 [GPU] Changed impls cache key type to avoid hash collisions (#16130) 2023-03-08 16:09:55 +04:00
Tomasz Dołbniak
e5ef0fee8e TopK base class cleanup (#16154) 2023-03-08 11:33:38 +00:00
Mateusz Bencer
50b76873e2 [ONNX] Fix external weights loading for the current dir path case (#16124) 2023-03-08 12:12:23 +01:00
Chenhu Wang
0786a963ab [CPU] Remove unused emitter parameters and API (#16117) 2023-03-08 14:15:44 +04:00
Ekaterina Aidova
6514b7600a [PT FE]: add translation for aten::cumsum (#16092)
* [PT FE]: add translation for aten::cumsum

* handle out and prim::dtype
2023-03-08 11:07:29 +01:00
Pawel Raasz
cd8999d43b Fix tile shape inference when repeats got dynamic shape (#15792)
* fix shape infer when repeats got dynamic shape

* Dynamic output shape when repeats dim is dynamic
2023-03-08 11:21:58 +04:00
Ilya Churaev
7c8dc76223 Rename template config and move transformations to code snippets (#16133)
* Rename template config and move transformations to code snippets

* Fixed documentation

* Rename template config
2023-03-08 07:12:05 +00:00
Xiping Yan
68b8d41c43 [CPU]JIRA 93714 fix CPU plugin warning after remove wd4309 wd4018 (#15961)
* Remove warning suppression: wd4018, wd4309

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Remove linux warning suppression no-sign-compare

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* ov::intel_cpu::VectorDims base value type is size_t;
dnnl::memory::dims base value type is int64_t;

All compare data up to int64_t can fix warning and there is potential issue.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* channelAxis maybe == -1; means: no exist any more.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix recursive macro: "one_of", "everyone_is" sign-compare warning.
Must pass same value type.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix Windows sign unsign compare warning

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* There are 2 instances:

using ov::Dimension::value_type = int64_t
using ov::intel_cpu::StaticDimension::value_type = size_t

All up to int64.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* linux have too many sign-compare issue.
Complete windows sign-compare firstly.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix clang issues.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning.
Because instantiate T1=unsigned int, T2=int

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning for tests unit reorder_node_test.cpp

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning : ASSERT_GE(step, 1u);

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix tests: warning C4018

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Remove auto, using int64_t is more reasonable.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
2023-03-08 10:41:00 +04:00
hyunback kim
a9cbccd829 Broadcast for post ops enable enable onednngemm (#16074)
* [GPU] Add data broadcasting for OneDNN binary ops for Gemm primitive
* Based on https://github.com/openvinotoolkit/openvino/pull/15790 and enable onednn gemm from support multiple users and non constant input.

--------

Signed-off-by: hyunback <hyunback.kim@intel.com>
Co-authored-by: Sergey Shlyapnikov <sergey.shlyapnikov@intel.com>
2023-03-08 13:55:51 +09:00
Roman Lyamin
681faadce3 [GPU] Added shape agnostic kernels for GatherElements and Tile (#15798)
* [GPU] Added shape agnostic kernel for GatherElements

* [GPU] Added shape agnostic kernel for Tile
2023-03-08 08:34:24 +04:00
Mateusz Mikolajczyk
b907bfab3b [PT FE] Fix for prim::Constant tensor with int/float values (#16029)
* Fix constant

* Change

* Remove duplicated code

* Add tests
2023-03-07 20:54:18 +00:00
Sebastian Golebiewski
1bd1eca8d9 [DOCS] Integrate OpenVINO with your application article - add TF Lite (#16020)
* fix snippets

* add tflite

* update tab directives

* Update integrate_with_your_application.md
2023-03-07 23:01:56 +04:00
Maxim Vafin
feb448cc89 Fix MO IR Reader for Eye op (#15996)
* Fix MO IR Reader for Eye op

* Fix eye value infer

* Remove debug output

* Add test for eye value infer

* Fix bom tests

* Fix alphabetical order
2023-03-07 20:30:14 +04:00
Mateusz Mikolajczyk
6358974c1a [PT FE] Add prim::PythonOp (#15714)
* Add PythonOp

* Fix deprecation & cleanup

* Apply suggestions from code review

* Fix dtype

* Apply suggestions from code review

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

* Update to new tensor names handling

* Fix negation

* Apply changes from code review

* Remove unnecesary imports

* Update src/frontends/pytorch/src/op/pythonop.cpp

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-03-07 17:20:13 +01:00
Szymon Irzabek
e79636bfbb [GNA] Add 3.6 and 4.0 targets (#15735) 2023-03-07 17:14:59 +01:00
Tatiana Savina
cf7dfff35f delete dlwb imgs (#16066) 2023-03-07 16:05:32 +01:00
Maxim Vafin
82584543ba [PT FE] Support set/get element type, shape and value in PyTorch FE InputModel (#16100)
* Support setting and getting element type, shape and value in PyTorch FE InputModel

* Fix code style

* Fix code style

* Fix rsub layer test

* Fix py style

* Apply review feedback

* Fix code style

* Fix initial values of input and output flags in Place
2023-03-07 15:45:29 +01:00
Liubov Talamanova
e6ad0a5154 [POT] Removed Multiply from ignored ops for transformers (#15600)
* [POT] Removed Multiply from ignored ops for transformers

* Add VPU to change_configurations_by_model_type
2023-03-07 14:37:29 +00:00
Ilya Lavrenov
15e43e0cc2 Removed explicitl handling for cache_dir from GNA (#16134) 2023-03-07 13:42:56 +00:00
Vladimir Paramuzov
a1eb76ad06 [GPU] Move is_local_block_io_supported WA to kernel selector (#15235) 2023-03-07 15:12:08 +04:00
Zhang Yi
6fbaf4745a [CPU ]Fix bf16 marking logic & remove useless convert (#15404) 2023-03-07 10:02:14 +00:00
Ilya Churaev
4cea80915d Added CI documentation (#16129) 2023-03-07 12:55:36 +04:00
Nadezhda Ageeva
0dad7749b5 Fix RTInfo for ReduceL2Decomposition (#16107)
* Fix RTInfo for ReduceL2Decomposition

* Review comments
2023-03-07 10:24:55 +04:00
Min, Byungil
87b18a21c1 [GPU] Optimize eltwise kernel for blocked format (#15717)
* [GPU] Optimize eltwise kernel for blocked format

+ Optimize etlwise_blocked_opt
+ Replace deprecated kernels with eltwise_blocked_opt
+ Remove eltwise_b_fs_yx_fsv16, b_fs_yx_fsv4 kernels
+ Add test-cases in eltwise_gpu_test

Signed-off-by: byungilm <byungil.min@intel.com>
2023-03-07 14:21:09 +09:00
Vladimir Paramuzov
eff0bce7e3 [GPU] Move some op parameters from node to primitive class (#16070)
* [GPU] Move parameters of conv and quantize primitive from node to primitive

---------

Co-authored-by: Eddy Kim <eddy.kim@intel.com>
2023-03-07 08:56:00 +04:00
Mateusz Bencer
e77adca01f Fix sign-compare warnings in ONNX FE (#16125)
* editor.cpp

* fix scan.cpp

* fix place.cpp

* fix tensor_external_data.cpp

* fix editor.cpp

* remove no-sign

* add sign-comare in os_flags.cmake

* fix place.cpp

* fix tensor_external_data.cpp

* remove sign-compare

* fix onnx_transformations.cpp

* fixed get_input_port + refactor

---------

Co-authored-by: haiqi <haiqi.pan@intel.com>
2023-03-07 08:15:56 +04:00
Wang, Yang
4d3dcfc5d4 Enable AUTO to support execution mode hint. (#15595)
* Enable AUTO to support execution mode hint.

Signed-off-by: Wang, Yang <yang4.wang@intel.com>

* Add test case.

* Set default value "PERFORMANCE" for ov::hint::execution_mode.

* Update.

* Update.

* Correct default ov::hint::execution_mode value for the default value checking test case.

* Update.

* Delete obsolete config.hpp file.

---------

Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2023-03-07 11:58:14 +08:00
River Li
4d7bffa593 [UT][AUTO_BATCH]auto batch plugin unit test (#15211)
* Init auto_batch plugin unit test

* Add more mock test

* Add to ci yml file

* Fix clang issue

* Resolve compilation issue

* Fix symbol multiple definition in static build

* Add test cases for AutoBatchInferRequest

* Add test cases for AutoBatchAsyncInferRequest

* qFixed build error after PR-15229

* Resolve blocked issue when call StartAsync test cases

* add more test for auto batch async inference

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
2023-03-07 11:55:26 +08:00
Wang Wangwang
83b57e2a64 AUTO cumulative throughput mode ignore candidate device that fail to … (#15420)
* AUTO cumulative throughput mode ignore candidate device that fail to load device

* Simplify the judgement logic of whether Auto set to Multi

* Add description about _AutoSetToMulti variable

* Update variable name to _AutoCallMulti

* Refine logic of AUTO execution_devices

* Add loading error massage

* Add test case

* Add filter to execution_devices of MULTI

* Add execution_devices test in load fail sitution

* Simplify the logic of execution_devices

* Update auto_executable_network.cpp

* Update src/plugins/auto/multi_executable_network.cpp

Co-authored-by: yanlan song <bell.song@intel.com>

* Update src/plugins/auto/auto_executable_network.cpp

Co-authored-by: yanlan song <bell.song@intel.com>

* Update test case

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
Co-authored-by: yanlan song <bell.song@intel.com>
2023-03-07 11:52:25 +08:00
Chenhu Wang
6e7bef529f [CPU] Single place to fill tails of load emitter (#14846) 2023-03-06 21:31:39 +04:00
Alexandra Sidorova
5269cb37d8 [Snippets] Fixed potential constants getter for FQ (#15892) 2023-03-06 21:19:26 +04:00
Andrew Kwangwoong Park
7123e8879e [GPU] Added shape agnostic optimized SoftMax kernel (#15834)
* [GPU] Added shape agnostic optimized SoftMax kernel

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

* Update SoftmaxKernelBaseBF::Validate policy for shape agnostic kernel

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

* Add softmax_gpu_bf shape agnostic TC for ov_gpu_unit_tests

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

* Fix failed TCs for ie-tests-linux-ubuntu20-gpu

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

* Update to use stack array instead of global buffer

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

* Remove global buffer usage completely

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

* Add #undef directive

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

---------

Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-06 09:10:29 -08:00
Tatiana Savina
41fd836196 [DOCS] Fix Frontend Extensions snippets (#16120)
* move fe to rst

* fix code snippets

* add more line breaks

* fix tabsets

* fix link

* fix anchor

* test

* fixing link

* change tab directive

* fix tabs

* align code tabs

* fix link

* fix snippets
2023-03-06 17:43:49 +01:00
Tatiana Savina
3faf4fcb3e [DOCS] Add OTX page to Ecosystem (#16118)
* add otx page

* change ecosystem page

* add ote img

* move ote page to rst

* fix path

* add path

* img test

* otx page

* add docs to ecosystem page
2023-03-06 16:58:26 +01:00
Edward Shogulin
cf8dccaedb [nGraph] VisualizeTree displays tensors (#16093) 2023-03-06 14:06:54 +00:00
Tomasz Jankowski
b8348cda2e Add AbsSubMul PReLu fusion (#16086) 2023-03-06 12:56:22 +00:00
Andrew Kwangwoong Park
4ce35fd851 [GPU] Minor fixes for dynamic model (#16075)
Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-03-06 15:50:38 +04:00
Irina Efode
54d3641baa Fix reportgeneration in CI (#16113) 2023-03-06 12:05:47 +01:00
Xiping Yan
e6a65f406d [CPU] Fix warning: sequence point strict aliasing (#15989)
* Remove sequence-point and strict-aliasing

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Replace reinterpret_cast with memcpy to fix warning of -Wstrict-aliasing

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning: -Wsequence-point

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix functional test warning: -Wstrict-aliasing

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Lost ft1 declare.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warnging: strict-aliasing.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warnging: strict-aliasing. ie_test_utils

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* fix float name error.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Update src/plugins/intel_cpu/src/nodes/unique.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* Update src/plugins/intel_cpu/src/nodes/unique.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* 1: Maybe uint16_t is more reasonable;
2: Replace int16_t with bfloat16_t;

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* fix build error.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>
2023-03-06 10:57:12 +01:00
Sebastian Golebiewski
20c0927ff9 [DOCS] Better statement about MO extensions as internal API [Recreating #14062] (#15679)
Recreating #14062
2023-03-06 10:27:42 +01:00
Maksim Kutakov
b9a48f12c8 [CPU] Prevent out of bounds read inside Graph::InferDynamic (#16067) 2023-03-06 12:52:37 +04:00
Xiping Yan
8b66b35bf7 [CPU]Remove C4250 warning suppress, and fix the corresponding warning. (#15966) 2023-03-06 12:43:53 +04:00
Tomasz Dołbniak
4486470e02 TopK v11 core operator (#15910) 2023-03-06 08:31:18 +01:00
Xuejun Zhai
9b97235902 Xuejun/remove api in ov any (#15667)
* [Remove APIs] remove ov::any api  &

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any api

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove interfaces in ov::any  Base* operator->() & const Base* operator->()

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any interfaces Base* get() & const Base* get()

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] remove ov::any interfaces call(const Any& any) & dynamic_pointer_cast(const ::ov::Any& any) & static_pointer_cast(const ::ov::Any& any)

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] fix code format issues in ov::any

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] fix review issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] clear code

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix review issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix compiler issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* Fix variant error

Signed-off-by: xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>
Signed-off-by: xuejun <xuejun.zhai@intel.com>
2023-03-06 10:24:08 +04:00
Ilya Lavrenov
79d3ff352e Migration to latest versions of submodules (#16103) 2023-03-06 10:22:34 +04:00
Shen, Wanglei
e605a4c344 Create streams info table based on processor type table (#15571)
* enable streams info table based on CPU mapping

* add detail processor info for mix stream

* fix code style issue

* fix typo

* fix code style issue for Android build

* update description of streams info table

* move streams info related function to new file

* remove duplicated definition

* add description for parameters of get_streams_info_table()

* update test case file

* fix windows build issue

* fix windows build issue

* fix windows build issue

* fix typo

* update latency mode for hybrid platform

* update limit threads for latency

* update latency mode for 2 sockets platform
2023-03-06 14:06:41 +08:00
Piotr Krzemiński
0860db0dc3 [PT FE] Add aten::ArgSort & aten::Sort (#15769)
* [PT FE] Add aten::argsort implementation & tests

* [PT FE] Fix formatting

* [PT FE] Fix incorrect node type for Gather

* [PT FE] Fix Reshape missing argument

* [PT FE] Simplify syntax, fix int/int64 conversion error

* [PT FE] Fix argsort incorrectly sorting negative dimension, fix tests

* [PT FE] Revert modify test class

* [PT FE] Fix formatting of argsort

* [PT FE] Fix define macro style

* [PT FE] Add missing EOF

* [PT FE] Add stable==false check, add support for different constructor calls

* [PT FE] Add aten::sort implementation & tests

* [PT FE] Apply style changes, add XFail test for stable sorting

* Update sort.cpp

* Update sort.cpp

* [PT FE] Apply style changes from aten::sort t PR

* Update test_argsort.py

* [PT FE] Apply suggested modifications

* Update test_argsort.py

* [PT FE] Apply review suggestions, add tests and extract sort method to utils

* [PT FE] Use utils sort function to implement argsort

* [PT FE] Fix input size check 4->5

* [PT FE] Implement improved tests

* [PT FE] Implement improved tests

* [PT FE] Add xfail to not yet supported tests

* [PT FE] Merge 2 implementations of sort and argsort into a single file

* [PT FE] Remove redundant sort_elements from utils

* [PT FE] Add num_inputs_check

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-03-05 20:12:32 +01:00
Ilya Lavrenov
e1fbb7d768 Fixes for multi-config generators (#16097) 2023-03-05 10:46:53 +04:00
Ilya Lavrenov
9c4c559909 Fixed compilation on Debian 11 with gcc 12.2 (#16096) 2023-03-04 20:45:04 +04:00
mei, yang
32b177e9eb remove python dependency gast in paddle test (#16017) 2023-03-04 20:41:39 +04:00
Ekaterina Aidova
a1cde2e790 [PT FE]: fix padding vaqlue dtype (#16087) 2023-03-04 11:08:56 +00:00
Ekaterina Aidova
0edbc5ca60 [PT FE]: fix arange dtype if it is not provided (#16084) 2023-03-04 10:17:09 +01:00
Andrei Kochin
6a39d466a4 [MO] Update reminder message for 2023.0 (#16094) 2023-03-04 13:13:11 +04:00
Sebastian Golebiewski
de50251ceb notebooks update (#16090)
20230302220806
2023-03-03 18:23:22 +01:00
Anastasia Kuporosova
b130b73f80 [Docs][PyOV] Add docstrings for transformations + python examples for stateful model (#15978)
* [Docs][PyOV] Add docstrings for transformation + python examples for stateful

* add snippets + small improvements
2023-03-03 17:07:34 +01:00
Irina Efode
190b64a0af [CONFORMANCE] Add check the crash or non zero status in python runner (#16081)
* [CONFORMANCE] Add check the crash or non zero status in python runner

* Update run_parallel.py
2023-03-03 15:23:23 +04:00
Irina Efode
3b6bb06f1d Update merge script to work with outdated reports (#16078)
* Update merge script to work with outdated xml

* change report name
2023-03-03 11:02:04 +00:00
Chen Xu
35dacb370a [CPU] Fix issue about overwriting register names (#15815) 2023-03-03 10:50:33 +00:00
Irina Efode
4e8590bf9b Add correct handling of conformance processes (#16031)
* Update run_parallel.py

* Add correct handling of conformance processes

* remove extra

* Update run_parallel.py
2023-03-03 12:18:53 +04:00
Fang Xu
7deb9090bf [CPU] Enable conditional compilation for graph optimizer (#15478) 2023-03-03 11:55:39 +04:00
Mateusz Tabaka
84a42cde61 [CPU] Add support for dynamic shapes in RDFT (#14458) 2023-03-03 10:43:29 +04:00
Anastasiia Pnevskaia
9efdb38b96 convert_model() legacy extensions fix (#15742)
* Fixed legacy extensions passing to MO tool.

* Added tests.

* Corrected test.

* Add debug print.

* Moved tests to layer tests.

* Added comment.

* Moved legacy ext tests to separate file. Fixed tmp .pb file cleaning.

* Small correction.

* Run MO Python API tests directory in CI.

* Small fix.

* Fix for case of splitted output.

* Corrected imports.

* Corrected imports.

* Added run of legacy extensions tests from subprocess.
2023-03-03 09:59:30 +04:00
Maksim Kutakov
fc98454174 [CPU] Internal dynamism support for extensions (#15795) 2023-03-03 09:00:56 +04:00
yanlan song
33e0b8caeb rework the config and better follow new api (#15920)
* rework the config to follow new api

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

* fix tests

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

* clean up code

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

* fix missing property

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

* fix case failure caused by name compliance

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

* clean up code

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

* workaround negative values with unsigned type

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

* fix wrong exception type

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

* refactor config/metric

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

* apply review comments

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

---------

Signed-off-by: fishbell <bell.song@intel.com>
2023-03-03 10:04:28 +08:00
Steve Yoo
a16f1923d7 Added recalculating processing order if it is not correct (#15987) 2023-03-02 14:40:15 -08:00
Kelvin Choi
6979c06ca1 [GPU] Support non constant input for Pad (#15697)
* [GPU] Support non constant input for Pad

* Refactor by comments
2023-03-02 10:38:43 -08:00
Ilya Lavrenov
392e0fda34 Added missed licenses to openvino-dev (#16057) 2023-03-02 21:18:39 +04:00
Karol Blaszczak
c98591f8a8 Update prerelease_information.md (#16056) 2023-03-02 18:13:30 +01:00
Ilya Lavrenov
4d925e0a3d Test GPU plugin arm64 build via Android precommit (#16055) 2023-03-02 21:06:36 +04:00
Ilya Lavrenov
0a31bdc112 Fixed OpenMP + debian package code-path (#16058) 2023-03-02 21:06:15 +04:00
Ilya Lavrenov
df03f8bfce Removed fetch depth from Azure Pipelines (#16059) 2023-03-02 21:05:54 +04:00
Przemyslaw Wysocki
8cbd8b8e03 Remove setuptools upperbound (#16054) 2023-03-02 20:58:39 +04:00
Zhang Yi
0e9b133de5 [CPU] StridedSlice fix execution for empty output tensor (#16045)
* stridedslice skip execution with 0 dims

* use isExecutable & add subgraph tests

* remove useless code
2023-03-02 15:56:25 +00:00
hyunback kim
cb7eeadd62 [GPU] Integration oneDNN3.1 (#15804)
* [GPU] Integration oneDNN3.1
* [GPU] Add os_iyx_osv8 format

Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-03-03 00:18:42 +09:00
bstankix
226bc301dc Graph builder modal (#16061)
* Bugfix and restyle Graph Builder

* Add disclaimer box to modal footer

* Change color gradient for pracision graphs

* Add default preselections to graph settings
2023-03-02 15:34:05 +01:00
Vladislav Golubev
57cf23857a [CPU] Split: dynamic split_lengths values support (#15914) 2023-03-02 14:19:45 +00:00
Ilya Lavrenov
7be7f25566 Added TF / TF Lite in API reference docs (#16023) 2023-03-02 16:45:18 +04:00
Anastasiia Pnevskaia
6185114bc4 Clearing of CustomReplacementRegistry.registry in convert_model() (#15893)
* Clearing of CustomReplacementRegistry.registry.

* Added test.
2023-03-02 14:49:45 +04:00
Vitaliy Urusovskij
18763f66ac Detect loops in topological_sort (#15688) 2023-03-02 13:21:52 +04:00
Ilya Churaev
65a45a6232 Fix coverity uninialized variable (#16039) 2023-03-02 13:20:14 +04:00
Ilya Lavrenov
0d798b7431 Building GPU plugin for Linux ARM64 (#16008)
* Building GPU plugin for ARM64

* changed order of headers

* Fixed clang-format
2023-03-02 12:43:33 +04:00
Roman Lyamin
24b0baa0d1 [GPU] Added support mixed input formats for Select (#16009) 2023-03-02 09:19:02 +04:00
Vladimir Paramuzov
27ac7d9092 [GPU] backend independent code for fuse params in program_node (#16028) 2023-03-02 09:18:29 +04:00
Wang, Yang
99a1800901 Fix the AUTO loadnetwork failure triggered by AUTO:-xxx (#15747)
* Check if the device is supported when AUTO retrieves the device list based on the ov::device::priorities.

* Update the logic to handle the situation like -d AUTO:-CPU to benchmark APP.

* Remove MYRIAD and add NVIDIA for AUTO supported devices.

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
Co-authored-by: Shen, Wanglei <wanglei.shen@intel.com>
2023-03-02 13:16:12 +08:00
Liubov Talamanova
c09b2ff8b1 [POT] Fix POT version in setup.py (#16021) 2023-03-01 22:30:26 +00:00
Ilya Lavrenov
5422242e86 Fixed compilation with gcc-7 (#15876)
* Fixed compilation with gcc-7

* Update src/core/reference/include/ngraph/runtime/reference/eye.hpp

Co-authored-by: Katarzyna Mitrus <katarzyna.mitrus@intel.com>

* returned f16 and bf16

---------

Co-authored-by: Katarzyna Mitrus <katarzyna.mitrus@intel.com>
2023-03-01 23:08:10 +04:00
Ilya Lavrenov
3c67509fc8 Removed custom cmake message (#16030) 2023-03-01 19:25:37 +04:00
Ilya Lavrenov
2e12af27e4 Improved GA precommit to track docs regressions (#16027) 2023-03-01 18:08:29 +04:00
Haiqi Pan
8307019380 fix benchmark_app python to support YES and NO values for -pin parameter (#15963)
* support YES and NO for -pin

* add if property_name == 'AFFINITY'
2023-03-01 17:31:04 +04:00
Maksim Kutakov
6ae024f86e [CPU] Fix OMP build (#16006)
* Fix OMP build

* Apply comments
2023-03-01 17:07:48 +04:00
Anastasia Kuporosova
4c0d28f26d Try to update minimum setuptools req (#15971)
* Try to update setuptools req

* suppress output from setup
2023-03-01 17:05:51 +04:00
Ilya Lavrenov
ba19d945ac Fixed clang-format for C API (#16024) 2023-03-01 16:36:20 +04:00
Vladimir Paramuzov
c5c7e4ff65 [GPU] Cleanup tuning cache methods (#16000) 2023-03-01 16:30:47 +04:00
Ilya Lavrenov
bde65c25c4 Fixed typo in docs (#16022) 2023-03-01 15:36:37 +04:00
Vladislav Golubev
84285ac317 [CPU] ConvertMatMulToFC fix (#15933) 2023-03-01 14:15:19 +04:00
Vladimir Paramuzov
3de00347f3 [GPU] Code cleanup (#16014)
* [GPU] Improve exception message for program build

* [GPU] Code cleanup
2023-03-01 14:05:59 +04:00
Vladislav Golubev
f0e12cf38b [CPU] Select via Eltwise implementation (#15740) 2023-03-01 14:03:47 +04:00
Ilya Churaev
113aefa3ff Move internal api to ov (#15964)
* Move cpu streams executor to new API

* Remove legacy headers from new dev API

* Fixed build issues

* Fixed build

* Fixed typo

* Fixed typo

* Fixed build

* Fixed code style

* Add exception for template constructor of SoPtr
2023-03-01 14:00:55 +04:00
Sebastian Golebiewski
21ac61fef5 [DOCS] Tensorflow models support in 23.0 update (#15974)
* tensorflow support update
adding tensorflow to main snippet

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-03-01 10:16:09 +01:00
Maxim Vafin
b1d0e152e3 Use i32 across all PyTorch frontend (#15896)
* Use i32 across all PyTorch frontend

* Fix corner cases

* Fix tests
2023-03-01 09:50:34 +01:00
Mateusz Mikolajczyk
112c763256 [PT FE] Add prim::device and prim::type, improvements to aten::to, aten::eq, aten::ne (#15881)
* Add device, improve to and equal

* Rename and remove unused import

* Apply fixes from code review

* Fix decoder.py

* Load prim::device using prim::Constant

* Remove throwing exceptions

* Apply suggestions from code review

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-03-01 09:46:55 +01:00
Egor Duplenskii
051a1c661e [CPU][TESTS] Add options to manage test targets and scope (#14576)
- by using ENABLE_CPU_SUBSET_TESTS_PATH cmake variable
  one can specify list of relative paths to functional test
  which will be included into target ov_cpu_func_tests_subset

  Target was renamed from cpuDebugFuncTests to
  ov_cpu_func_tests_subset

- by using ENABLE_CPU_SPECIFIC_TARGET_PER_TEST=ON one can
  trigger generating specific target for each test file, i.e.
  - ov_cpu_func_slt_convolution
  - ov_cpu_func_subgraph_mha
2023-03-01 11:39:53 +04:00
Alexandra Sidorova
7f83c2c72d [Snippets] Added broadcast support for FQ weights calculation (#15837) 2023-03-01 11:14:58 +04:00
Katarzyna Mitrus
a7bb54da2d [ShapeInference] DeformablePSROIPooling shape infer (#15766)
* Add shape infer function

* Update shape_infer and usage

* Add setters

* Register shape_infer for CPU

* Tests

* Style

* Add cast for dim type

* Add precision

* Update input size check

* Move setters to cpp
2023-03-01 08:13:24 +01:00
Alexandra Sidorova
63d282fd73 [CPU] Added support of negative paddings for Pad (#15935) 2023-03-01 10:49:03 +04:00
Xuejun Zhai
51a3a02115 Xuejun/remove api result related (#15806)
* [Remove APIs] remove api Result(const Output<Node>& arg, bool), set_needs_default_layout(bool) & needs_default_layout()

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove const AutoBroadcastSpec NUMPY & NONE

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] clear code

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-03-01 07:43:48 +04:00
Ilya Churaev
e534efd4a8 Moved template backend to new API (#15878)
* Moved template backend to new API

* Fixed compilation

* Fixed some comments

* Fixed ov_core_unit_tests

* Fixed some tests

* Fixed ONNX Frontend tests

* Fixed transformation tests

* Fixed dynamic tests

* Fixed sporadic in CPU tests

* Added WA for plugin

* Fixed copy_to for scalar tensors
2023-03-01 07:12:33 +04:00
Maxim Vafin
87e714eb5c Add support for concatenation in Loop (#15899)
* Add support for concatenation in Loop

* Apply suggestions from code review

* Fix win build

* Fix issues with propagation shapes and types in Loop

* Fix einsum

* Set type and shape of count in frontend
2023-02-28 21:31:33 +01:00
Mateusz Tabaka
62ff31df8a ReverseInputChannelsFusion - no reverse input channels -> return (#15784)
* ReverseInputChannelsFusion - return early if there is no reverse input channels

Ticket: 98067

* run_passes

* fix unnecessary validate calls
2023-02-28 17:56:21 +00:00
Ilya Lavrenov
0988c2b813 Fixed compilation of docs snippets (#16004) 2023-02-28 20:53:31 +04:00
dependabot[bot]
07f287e362 Bump awalsh128/cache-apt-pkgs-action from 1.1.3 to 1.2.2 (#14999)
* Bump awalsh128/cache-apt-pkgs-action from 1.1.3 to 1.2.2

Bumps [awalsh128/cache-apt-pkgs-action](https://github.com/awalsh128/cache-apt-pkgs-action) from 1.1.3 to 1.2.2.
- [Release notes](https://github.com/awalsh128/cache-apt-pkgs-action/releases)
- [Commits](https://github.com/awalsh128/cache-apt-pkgs-action/compare/v1.1.3...v1.2.2)

---
updated-dependencies:
- dependency-name: awalsh128/cache-apt-pkgs-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Update .github/workflows/build_doc.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-02-28 19:54:33 +04:00
Karol Blaszczak
f9a8d9132d update NV12 (#15370)
* update NV12 docs and snippets

add single-plane input information
create single-plane cpp snippet
menu fix
update formatting for sphinx directives

Co-Authored-By: Ilya Churaev <ilyachur@gmail.com>
Co-Authored-By: Vladimir Paramuzov <vladimir.paramuzov@intel.com>

* additional snippet fixes

---------

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
2023-02-28 17:58:08 +04:00
Zhang Yi
4dff2d1c60 [CPU] Enable dnnl cache (#15665)
* enable dnnl cache

* revise cmake comments
2023-02-28 13:23:37 +01:00
Vitaliy Urusovskij
5e48941f53 Apply Apivalidator to extra TBB libs (#15938) 2023-02-28 15:34:14 +04:00
Ilya Lavrenov
f7ccfd9b6e Install libtbb2 instead of libtbb12 on U22.04 (#15992) 2023-02-28 15:32:53 +04:00
Irina Efode
7aaf966039 [CONFORMANCE] Add relative weights for conformance (#15799)
* Add Weights by ops

* Upgrade conformance tools

* api_conformance

* Change prefix

* Reorg meta info

* Chnage base algo

* fix all other

* return summary

* Update the report

* wa

* review
2023-02-28 10:11:48 +01:00
dependabot[bot]
b748395f7d Bump paddlepaddle from 2.4.1 to 2.4.2 in /src/frontends/paddle/tests (#15809)
Bumps [paddlepaddle](https://github.com/paddlepaddle/paddle) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/paddlepaddle/paddle/releases)
- [Changelog](https://github.com/PaddlePaddle/Paddle/blob/develop/RELEASE.md)
- [Commits](https://github.com/paddlepaddle/paddle/compare/v2.4.1...v2.4.2)

---
updated-dependencies:
- dependency-name: paddlepaddle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-02-28 12:14:31 +04:00
Roman Lyamin
1070a3b6c1 [GPU] Added fp16 support for GatherTree (#15983) 2023-02-28 09:54:56 +04:00
guozhong wang
913f616964 Guozhong/improve auto infer request line coverage (#15511)
* find test case for MultiDeviceInferRequest::SetBlob

* improve line coverage of infer_request

* add test cases for queryState and exception test case for perf count

* fix querystate running fail

* add test case to memory_states.cpp

* rename name of test case

* add memory_states.cpp to CMakeLists.txt

* Use _LogTag to judge whether MULTI

* clang-format intel_gna/memory_states.cpp

* Modify the position of the macro ENABLE_INTEL_CPU in the test case

---------

Co-authored-by: Chen Peter <peter.chen@intel.com>
2023-02-28 12:51:37 +08:00
Anastasia Kuporosova
45dff75356 Check Node in Model creation (#15943)
* Check Node in Model creation

* apply fixes
2023-02-28 08:27:32 +04:00
Ilya Churaev
e5f2903c83 Changed template plugin namespace (#15962)
* Changed template plugin namespace

* Fixed documentation
2023-02-28 02:27:12 +04:00
Roman Kazantsev
68b7b8e69b [TF FE] Mark-up xfailed layer tests on GPU in nightly (#15981)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-27 21:14:21 +00:00
Wilson Seok
93a1be3607 Skip set_selected_impl() of post_optimize_weight when target generic layer is already created (#15852) 2023-02-27 11:24:53 -08:00
Eddy Kim
d2a5be0ab8 enabled exec_graph and pc in deserialized model (#15975) 2023-02-27 10:14:04 -08:00
Maxim Vafin
2ced2ad929 Add removing dangling results in MultiSubGraphOp transformation (#15862)
* Add removing dangling results in MultiSubGraphOp transformation

* Add recursive call for nested subgraphs

* Fix frontend build

* Add tests

* Add more tests and fix special port

* Add more tests, fix LSTM tests

* Preserve merged inputs

* Fix code style

* Fix paddle tests

* Fix special output
2023-02-27 14:31:53 +01:00
Xiping Yan
b30b283f0d [CPU] Fix all warnings or errors after removing "-Wno-class-memaccess" in cpu plugin CMakeLists.txt (#15780)
* Remove -Wno-class-memaccess

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* fix warnings for memset.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Change bfloat16_t implementation to trivial.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* memset warning can be fixed via changing bfloat16_t to TRIVIAL.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Revert "memset warning can be fixed via changing bfloat16_t to TRIVIAL."

This reverts commit 28a37af5c8.

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
2023-02-27 10:11:55 +01:00
dependabot[bot]
a7443e13fa Bump actions/cache from 1 to 3 (#15965)
Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 10:46:37 +04:00
Ilya Lavrenov
713b37cb25 Detection of WoA ARM64 in all places (#15960) 2023-02-27 10:29:14 +04:00
Ilya Churaev
957ff6edd8 Fixed some leftovers after plugin API merge (#15932) 2023-02-27 05:35:38 +01:00
Xiuchuan Zhai
2d91c36d32 Support paddle slim (#14834)
* support paddle slim

* fix scale shape issue in dequantize_linear

* fix node implicit construct failed in yolov5 and yolov7

* correct the round mode

* improve the accuracy of slim

* support paddle slim

* fix scale shape issue in dequantize_linear

* correct the round mode

* refactor some tests

* fix according to comments

* support zero_point and fallback round_mode
2023-02-27 08:23:44 +08:00
Ilya Lavrenov
5526969eba Turn off apiValidator for ARM64 WoA hosts (#15958) 2023-02-26 22:51:37 +04:00
Roman Kazantsev
5317b909f7 [TF FE] Test Nested While in the pre-commit (#15955)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-26 11:28:51 +00:00
Maxim Vafin
4fac7eabc0 Use shared constant in pytorch decoder (#15917)
* Use shared constant in pytorch decoder

* Fix contigious array

* Support scalars

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>

---------

Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>
2023-02-26 11:39:27 +01:00
Andrew Kwangwoong Park
39e63ace67 [GPU] Minor fix for dynamic mobilebert (#15909)
Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-02-25 20:22:44 -08:00
Taylor Yeonbok Lee
fabf67ee5e [GPU] Enable crop for shape agnostic kernel (#15866)
* Enable crop shape agnostic kernel

* Added unit test

* Added new scalar argument for crop (eltwise) for being used as runtime input offset in shape agnostic kernel

* Fix eltwise to have runtime offset only for crop

* Fix unittest error

* Applied review comment
2023-02-25 15:49:46 -08:00
Ilya Lavrenov
15990afea2 Prevent infinite recursion (#15953) 2023-02-25 23:32:45 +04:00
Ilya Lavrenov
c0ef9a862e Fix for apiValidator when more than 1 target needs to be checked (#15950) 2023-02-25 16:33:08 +04:00
Artyom Anokhov
bd8c7506f0 requirements-dev: top-limited setuptools with 65.7.0 (#15946) 2023-02-25 14:54:50 +04:00
Taylor Yeonbok Lee
9822568194 Fix build error in clang++ (#15948) 2023-02-25 06:48:12 +04:00
Andrew Kwangwoong Park
46e8aad4bb [GPU] Fix output format not changing at runtime (#15887)
* [GPU] Fix output format not changing at runtime

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

* Add remove_redundant_reorders pass TC for ov_gpu_unit_tests

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

---------

Signed-off-by: Andrew Park <andrew.park@intel.com>
2023-02-24 14:26:54 -08:00
Eddy Kim
30939f5021 updated to share constant data memories across multiple streams (#15915) 2023-02-24 14:26:10 -08:00
Pawel Raasz
f13b1e9681 Review space to and shuffle channels operators for shape inference aspects (#15711)
* Review label and interval shape propagation for:
- space to batch
- space to depth
- shuffle channels
- depth to space
- batch to space

* Review template implementation of shape_infer for:
- space to batch
- space to depth
- shuffle channels
- depth to space
- batch to space

* Apply clang-format

* Update src/core/shape_inference/include/batch_to_space_shape_inference.hpp

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>

* Update src/core/shape_inference/include/space_to_batch_shape_inference.hpp

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>

* Shuffle channels remove label from channel dim

---------

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
2023-02-24 22:17:47 +00:00
Ilya Lavrenov
6d7b94b8cd Improved API validator logic (#15942) 2023-02-25 01:11:50 +04:00
Jan Iwaszkiewicz
6c0e2686ad [PyOV] Fix passing of the key in data dispatcher (#15941) 2023-02-24 23:07:59 +04:00
Ilya Lavrenov
57cb7015f0 Fixed samples build on Debian 10 with cmake 3.13 (#15940) 2023-02-24 22:28:45 +04:00
Alexandra Sidorova
8dd9ade211 [Snippets] Added matcher_name in ConvertConstantsToScalars pass (#15883) 2023-02-24 22:20:23 +04:00
Karol Blaszczak
5e6398a2d8 [DOCS] prereleasenotes update (#15944) 2023-02-24 17:07:46 +01:00
Irina Efode
e21c71dd48 Fix error with incorrect symbol in ParallelRunner (#15934)
* uncomment run

* Fix error with incorrect symbol in ParallelRunner

* Remove extra
2023-02-24 17:53:24 +04:00
Ekaterina Aidova
5c6ef54127 [PT FE]: support aten::index (#15544)
* [PT FE]: support aten::index

* bool indexing testing

* more tests, fix nonzero case

* apply code review
2023-02-24 14:33:00 +01:00
Pawel Raasz
ba45c993ac Review scatter elements update class for shape inference aspects (#15891)
* Review interval shape and label propagation

* Review template implementation of shape_infer
- add tests for default ctor
- expand test for static shape

* Add upper, lower and label evaluate
2023-02-24 13:38:51 +01:00
Roman Kazantsev
ad4bd6f752 [TF FE] Simplify FakrQuantWithMinMaxVars translator and add layer test (#15927)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-24 12:13:46 +00:00
Sebastian Golebiewski
d60e3812ca [DOCS] Structure change for 'AUTO Device Selection' article - post merge fix for master (#15890)
Fixing the direcives for code snippets
2023-02-24 12:21:17 +01:00
Ilya Churaev
a730ef18eb Moved Task, Streams, CPUStreams Executors to new API (#15913)
* Moved Task, Streams, CPUStreams Executors to new API

* Fixed some build issues

* Fixed new build issues

* Try to fix tests

* Fixed inference unit tests

* Small build fix

* Added more system headers

* Try to fix naming style

* Fixed namespace

* Fixed android build
2023-02-24 15:20:32 +04:00
Mateusz Bencer
15935069ff Skip PullThroughReduce optimization for multi-output inputs (#15829)
* Skip PullThroughReduce optimization for multi-output inputs

* review remarks
2023-02-24 12:11:32 +01:00
Ruslan Nugmanov
091ba1f5ee Adds layer tests for binary and reduce tflite operations (#15791)
* adds binary and reduce layer tests

* adds binary with activations layer tests for tfl ops

* 1.moves helper functions and lists to utils file
2.adds axis as test parameter for reduce test
3.adds reluNto1 activation

* skips tanh and signbit activations

* Update tests/layer_tests/common/utils/tflite_utils.py

* Fused activations supported: RELU_N1_TO_1, SIGN_BIT

---------

Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2023-02-24 14:46:29 +04:00
Nadezhda Ageeva
91d1600646 [TESTS] make axis of VariadicSplit int to support negative values (#15925) 2023-02-24 14:45:22 +04:00
Pawel Raasz
36992c9c46 Move shape_inference function to test utils (#15757) 2023-02-24 09:20:12 +01:00
Karol Blaszczak
310dd1d4c4 sphinx directives and less html (#15816)
changes to benchmarks page to align with theme
2023-02-24 09:03:19 +01:00
Sebastian Golebiewski
bd3a392d84 [DOCS] 'Quantization-aware Training' article update (#15617) 2023-02-24 08:57:04 +01:00
Sebastian Golebiewski
28cfb988e7 [DOCS] 'Quantizing with accuracy control' article update (#15642) 2023-02-24 08:56:23 +01:00
Sebastian Golebiewski
7a465e2422 [DOCS] 'Basic Quantization Flow' article update (#15641) 2023-02-24 08:55:51 +01:00
Sebastian Golebiewski
5ae859b4f8 [DOCS] 'Filter Pruning of Convolutional Models' article update (#15616)
Prep for conversion to rst
2023-02-24 08:55:28 +01:00
Paul Youngsoo Ahn
c1c8d6320e [GPU] Apply multi-threads for async compilation context (#15683)
* [GPU] Apply multi-threads for async compilation context (#15683)
- Use CPUStreamExecutor in compilation context
- Use single compilation context, impl_cache and kernels_cache for multple streams
- Move compilation context to cldnn::program
- Move impl_cache to cldnn::program
- Create thread-safe impl_cache
- Create thread independent compilation function in kernels_cache
- Use kernels_cache in program and remove it from network

* [GPU] Fix segfault issue: ocl_engine and ocl_device are released during remained compilation context task are running (#15683)
- compilation context has own CPUStreamExecutor

* [GPU] Follow-up codereview (#15683)
- LruCacheThreadSafe inherit LruCache
- FuncRemoveItem has std::pair<Key,Value> as input
- Change prepare_tools to init_program

* [GPU] Create primitive_impl::build_kernels (#15683)

* [GPU] Fix unit test build error (#15683)

* [GPU] Remove redundant code (#15683)
- Remove try catch for debug
- Call compilation_context.cancel() in destructor of network

* [GPU] combine two atomic counter in kernels_cache (#15683)

* [GPU] Follow-up code review (#15683)

* [GPU] Fix nullptr exception in unit test (#15683)

* [GPU] Follow-up code review (#15683)
- Modify mutex lock in compilation context

* [GPU] Fix windows build issue (#15683)
2023-02-23 23:08:50 -08:00
River Li
2d960fc6c5 Solve test case failure issue for 32bits (#15857)
* Solve test case failure issue for 32bits
  1. ov_core_unit_test
  2. ov_cpu_unit_test

Change-Id: I5e6afda0865fedc1de7fe84dd5f132e642263303

* Solve windows build issue

Change-Id: I1e6ea4d930c41322a73a701d566f0cdee2a4e098

* Disable several 64bit test cases in case of 32bit system

Change-Id: Ib8ef784953bf15cb42048dd905f17a85e52482b1

* Update a simple solution

Change-Id: Ie2e2cd369fe98bfcd26f3416bf36d4dfb0f24c25

* update for 64bits failure

Change-Id: I6571b7842a0fecc01fff169a21fa7aae9eb9da14

* Use OPENVINO_ARCH_64_BIT replace custom macro

Change-Id: I7e72b74aed8f0226513bc0e06ce2381322b42f71
2023-02-24 10:20:31 +04:00
hyunback kim
be5f90199d [GPU] Add oneDNN FC preferred_format to bfyx (#15704)
Signed-off-by: hyunback <hyunback.kim@intel.com>
2023-02-24 15:19:54 +09:00
Eddy Kim
f562e96305 [GPU] Fallback to kernel caching in the case of dynamic models (#15842)
* use kernel caching for dynamic models

* replaced cl_cache with blob

* updated to serialize dims info of input and output

* updated to skip unicode tests in Windows
2023-02-23 22:05:16 -08:00
Dohyun Kim (Felix)
a4f0b340d0 [GPU] Resolve unit test not run as onednn (#15217) 2023-02-24 10:07:56 +09:00
Dohyun Kim (Felix)
f00fb325a6 [GPU][DG2] Disable remained failing tests (#15873) 2023-02-24 10:07:01 +09:00
Roman Kazantsev
8a56234445 [TF FE] Refactor identity operations and layer test (#15904)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-23 21:22:31 +01:00
Ilya Lavrenov
bd61d317f8 Revert "Install patchelf for aarch64 linux (#15865)" (#15919)
This reverts commit e34d4e4664.
2023-02-23 23:02:00 +04:00
Evgeny Kotov
b8de9beeac [GNA] fix Coverity warning (#15823)
* fix

* fix

* fix FindFirstConsumer
2023-02-23 16:00:44 +00:00
Tomasz Jankowski
e8d1be6e0f [Transformations] Enable missing runtime info check (#15796)
* Add rt info propagation to StridesOptimization

* Enable rt info check for pruning tests
2023-02-23 19:14:13 +04:00
Karol Blaszczak
6359926815 [DOCS]-new-prerelease-info-page (#15768) 2023-02-23 14:52:25 +01:00
Tomasz Dołbniak
c72d148ec7 TopK v11 - specification (#15583) 2023-02-23 14:51:48 +01:00
Haiqi Pan
3cc888555a fix ov::shutdown align definition (#15901) 2023-02-23 17:31:34 +04:00
Sebastian Golebiewski
92181b0a4b port 15720 (#15911)
Porting: https://github.com/openvinotoolkit/openvino/pull/15720/
Fixing path.
Ticket: 100955
2023-02-23 17:29:47 +04:00
Jan Iwaszkiewicz
3373c6743f [PyOV] Shared memory improvements for Tensor and Constant classes (#15814) 2023-02-23 13:46:41 +01:00
Oleg Pipikin
d9fc5bac80 Add GCC versiong to linux installation manual (#15858)
* Add GCC versiong to linux installation manual

* Fix comment
2023-02-23 13:40:01 +04:00
Anastasiia Pnevskaia
1e24c51abb Turn on onnx fallthrough in convert_model() (#15651)
* Turn on ONNX_FALLTHROUGH in torch.onnx.export().

* Removed wrong change.

* Added test.
2023-02-23 13:22:30 +04:00
Leonard Sikorski
bc663878eb [PT FE] Add torchvision::roi_align operator with layer test (#15821) 2023-02-23 09:26:17 +01:00
Ekaterina Aidova
288a750bc6 [PT FE]: support aten::einsum (#15844) 2023-02-23 11:39:28 +04:00
Maxim Vafin
a9efe5bd8d [PT FE] Extend upsample support (#15826)
* [PT FE] Extend upsample suport

* Update tests/layer_tests/pytorch_tests/test_upsample.py

Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>

---------

Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>
2023-02-23 11:34:29 +04:00
Roman Kazantsev
900332c46e [TF FE] Support conversion of models with non-standard extensions in the path (#15875)
* [TF FE] Support conversion of models with non-standard extensions in the path

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

* Update tools/mo/unit_tests/moc_tf_fe/conversion_basic_models.py

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-23 11:29:14 +04:00
Ilya Lavrenov
87bcbc1747 Supported OpenSUSE 15.3 (#15897) 2023-02-23 11:25:33 +04:00
Dohyun Kim (Felix)
1028c7b5d5 [GPU] Fix weight reorder bug (#15672) 2023-02-23 14:48:46 +09:00
Jade Cho
c749163f72 [GPU] Update unit tests for swap XY (#15833) 2023-02-23 14:38:10 +09:00
Dohyun Kim (Felix)
1f196bacd3 [GPU][DG2] Fix some testcases (#15774)
* C++ exception with description write lock_type thrown in the test body. 
   Use get_output_values_to_float()
   * fusings_gpu/gemm_2in_act_scale_quantize_eltwise_i8.basic/2
   * fusings_gpu/gemm_2in_act_scale_eltwise.basic/2
* Remove WA test code of [GPU][DG2] Fix fusings_gpu/gemm_2in_scale.basic/7 #15353
   * Now non full-tensor post-ops are broadcasted
2023-02-23 14:23:40 +09:00
Dohyun Kim (Felix)
ed65583957 [GPU] Fix OV_GPU_DumpGraphs option (#15800) 2023-02-23 14:10:21 +09:00
Haiqi Pan
6bd7def8c4 fix sign-compare warnings in template backend (#15880)
* fix detection_output.hpp

* fix roi_align.hpp

* fix detection_output.hpp

* convolution_backprop_data.hpp

* convert_color_nv12.hpp

* fix detection_output.hpp

* fix detection_output.hpp

* remove no-sign

* fix code style

* fix roi_align.hpp

* fix roi_align.hpp

* fix detection_output.hpp

* fix C4267
2023-02-23 08:35:28 +04:00
Haiqi Pan
6f85ee7968 fix shutdown (#15882) 2023-02-22 22:04:19 +04:00
Anastasia Kuporosova
592ad68455 [PyOV] Fix deprecation warning in tests (#15830)
* [PyOV] Fix deprecation warning in tests

* Update src/bindings/python/tests/test_graph/test_manager.py
2023-02-22 18:08:49 +01:00
Ilya Churaev
893f96a7da Extend tensor API (#15811)
* Added some new tensor API

* Added tests on constructors

* Small changes

* Fixed tensor tests

* Fixed tests

* Added parametrized tests

* Extend tests and delete copy_to from remote tensor
2023-02-22 17:43:15 +01:00
Ilya Churaev
27ea9eab32 Moved executor manager to new API (#15871)
* Moved executor manager to new API

* Fixed template plugin build

* Remove setTBBFlag API

* Fixed export

* Added new files

* Revert "Added new files"

This reverts commit 981c3c863f.

* Fixed template plugin tests

* Remove redundant wrapper

* Remove wrappers for executor manager

* Fixed build
2023-02-22 17:19:35 +01:00
Ilya Lavrenov
98392a043b Fixed issues in setupvars.sh (#15884)
* Fixed issues with setupvar.sh

* Fixes setupvars realpath error

---------

Co-authored-by: Otoka, Tomasz <tomasz.otoka@intel.com>
2023-02-22 19:36:23 +04:00
Mateusz Tabaka
eaf368a5f5 PushConstantToSubgraph - use vector<bool> for remove_inputs_mask (#15827)
When MultiSubGraphOp has more than 32 inputs, int is not enough
to track inputs to be removed.

Ticket: 103248
2023-02-22 15:31:34 +01:00
Sofya Balandina
5251133202 [apiConformance] Refactor io_tensor.cpp (#15680) 2023-02-22 17:42:07 +04:00
Ilya Churaev
877018bab6 Moved Cache manager to new API (#15872)
* Moved Cache manager to new API

* Moved cache guard to ov namespace

* Added new files
2023-02-22 10:51:33 +00:00
Ilya Churaev
548f972e19 Added ov::IVariableState (#15843)
* Added ov::IVariableState

* Added variable state

* Try to fix Windows

* Fixed export
2023-02-22 14:30:46 +04:00
Marcin Kacprzak
c8643a9a30 [GNA] incorrect diag insertion (#14858)
* [GNA] Create ngraph implementation for relu_torch_pot model for further tests. Create legacy pass fusing FC-Eltwise-Const layers pattern into single FC layer with biases

* [GNA] Fix review comments, applied proper code style to changed code
2023-02-22 10:22:55 +00:00
Artur Kulikowski
f41c75b965 [NormalizeL2] normalization of reduction axes (#15841)
* Add test for negative axes, preliminary solution to solve uncorrect
results

* Normalize axes in operation NormalizeL2

* Add test for negative axes

* Add EOF
2023-02-22 13:10:06 +04:00
Wang, Yang
7f3ea9a59c Conversion fail for ov::hint::performance_mode with UNDEFINED value (#15629)
* Update ov::hint::performance_hint UNDEFINED value from empty string to "UNDEFINED".

* Update benchmark Python version.

* Update.

* Update.

* Update.

* Update the description about hint setting within benchmark APP README and help message.
2023-02-22 13:01:18 +04:00
Ilya Lavrenov
e34d4e4664 Install patchelf for aarch64 linux (#15865) 2023-02-22 12:55:27 +04:00
Taylor Yeonbok Lee
4fd38844a2 [GPU] Fix remote blob creation to use original shape (#15864)
* Fix remote blob creation to use original shape

* Revert "Fix remote blob creation to use original shape"

This reverts commit 35c674aa97.

* Fix cldnn tensor adjusted blob to be reinterpreted with actual input layout
2023-02-21 22:22:51 -08:00
Eddy Kim
a6ff809ad7 [GPU] Model caching unit tests (#15413)
* gpu model caching unit tests

* added serialization unit tests

* added save and load for quantize primitive_inst

* reduced the range of inputs for Gemm tests

* updated the copyright year
2023-02-22 05:53:43 +00:00
Luwei Zhou
d464f38788 Enhance dump_check.py tool for bf16 blob support. (#15002)
@luweizhou2016 please make CI green to merge it
2023-02-22 05:05:08 +00:00
Ilya Lavrenov
95c7c39b91 Supported rpmlint versions less 2.0 (#15856) 2023-02-22 01:35:28 +04:00
Oleg Pipikin
3644c26402 Remove WAs for myriad (#15854) 2023-02-21 18:05:33 +01:00
Roman Kazantsev
4746c04840 [Common][FE] Implement reverse infer for Transpose (#15824)
* [Common][FE] Implement reverse infer for Transpose

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

* Update src/common/transformations/tests/common_optimizations/reverse_shape_and_type_infer.cpp

* Update src/common/transformations/tests/common_optimizations/reverse_shape_and_type_infer.cpp

* Update src/common/transformations/src/transformations/common_optimizations/reverse_shape_and_type_infer.cpp

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

* Add one more tests with constant order and known output

* Fix reverse infer for a case of know order and output shape

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-02-21 13:42:39 +00:00
Tatiana Savina
f730edb084 [DOCS] Remove DL Workbench (#15733)
* remove dl wb docs

* text correction

* change ecosystem description

* replace link
2023-02-21 13:16:02 +00:00
Roman Kazantsev
0ddca519d6 [TF FE] Fix auto-pruning for QueueDequeue operation (#15838)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-21 13:27:29 +01:00
Pavel Esir
15973fd2da enable --compress_to_fp16=True by default in MO (#15488)
* enable --compress_to_fp16 by default in MO

* corrected docs, added warning if user did't specify --compress_to_fp16 explicitly

* fix failing MO unit-tests

* do not wipe out data_type if user defined it explicitly by cli argument

* updated warning message and docs

* corrected phrasing

* corrected phrasing in FP16_Compression.md

* set compress_to_fp16=False for convert tests

* leftover: set compress_to_fp16=False for convert tests

* minor correction

* print info message in main.py, som minor changes

* typos fix

* fix losing information whether arguments set by user or got from defaults

* returned back default values instead of None

* more selective correcting of test_mo_convert_pytorch.py; added test for cases when compression is enabled/disabled or left by default

* fix test_mo_convert_pytorch.py
2023-02-21 13:07:43 +01:00
Katarzyna Mitrus
94b64fed79 [ShapeInference] DetectionOutput shape inference review (#15645)
* Add setter for attributes

* Add more type_prop tests

* Extend shape infer tests for default ctor

* Remove redundant set_output_size and update shapes init

---------

Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
2023-02-21 14:42:47 +04:00
cecilia peng
86b50044cd [CPU] optimize TensorIterator DynamicBuffer (#15163)
* optimize TensorIterator DynamicBuffer by preallocating a large chunk of intermediate buffer.

code clean.

review update: always copy in transfer as it is not worthy.

review update: update mem_holder_buffer as dnnl::memory instead of shared_ptr of it.

review update: reuse mem_buffer_holder even if the shape changes.

review update: growth factor.

review update: bug fix.

* fix code style

* review update: rewrite the dynamic buffer using the cpu Memory class, instead of dnnl::memory

* Update src/plugins/intel_cpu/src/nodes/tensoriterator.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* Update src/plugins/intel_cpu/src/nodes/tensoriterator.cpp

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>

* review update: minor fix

---------

Co-authored-by: Maksim Kutakov <maxim.kutakov@gmail.com>
2023-02-21 09:40:00 +01:00
Xiuchuan Zhai
8153664b52 [CPU] optimize the shape infer for transpose (#15695)
* optimize the shape infer for transpose

* optimize coding style as comment

* optimize coding style as comment

* fix an bug by PR-15614
2023-02-21 09:19:37 +01:00
Maxim Kurin
f347968a1d Don't use gold linker if mold linker is provided (#15746) 2023-02-21 10:57:41 +04:00
Konstantin Beluchenko
7f3f576151 [GPU] Permute 5d optimization (#14170) 2023-02-21 14:39:53 +09:00
Wang Wangwang
9e3b3e0566 Docs: Update the doc on execution devices property and enable_startup_fallback property (#14750)
* Docs: Update the doc on default hint and execution devices property (#14836)

* Docs: Update to LATENCY as default hint
* Docs: Update the doc on execution devices property
* Update auto_device_selection.md

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

* Update docs/OV_Runtime_UG/auto_device_selection.md

* Update docs/OV_Runtime_UG/auto_device_selection.md

* Update docs/OV_Runtime_UG/auto_device_selection.md

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

* Update docs/OV_Runtime_UG/auto_device_selection.md

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

* Update docs/OV_Runtime_UG/auto_device_selection.md

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

* Update docs/OV_Runtime_UG/auto_device_selection.md

* Update docs/OV_Runtime_UG/auto_device_selection.md

---------

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
2023-02-21 11:24:19 +08:00
Ilya Churaev
a5ec5f5476 Move template infer request (#15696)
* Move Template Infer Requests to new API

* Removed const_pointer_cast from plugin

* Fixed tests

* Fixed async tests

* Fixed some comments

* Added print ov::Tensor

* Fixed ONNX Frontend tests with multiple outputs to the same tensor

* Revert "Added print ov::Tensor"

This reverts commit b752f506bb.

* Fixed ov_core tests

* Fixed some tests

* Fixed batched tensors tests

* Fixed some tests

* Fixed more tests

* Fixed template plugin tests

* Fixed LP tests

* Fixed some comments

* Fixed some documentation issues

* Fixed comments

* Increase timeout because build termenated in case of common changes
2023-02-21 07:03:07 +04:00
Maxim Vafin
ce3ac296ae [PT FE] Fix aten::len for empty lists (#15820)
* [PT FE] Fix aten::len for empty lists

* Fix code style
2023-02-20 21:34:04 +00:00
Haiqi Pan
1b147c3560 remove no-sign (#15817) 2023-02-20 20:34:23 +04:00
Maxim Vafin
cbd56c3ed9 [PT FE] Enable reverse infer (#15802)
* Enable reverse infer in PT FE

* Inherit channes from weight of convolution

* Except 1

* Add tests

* Add shape propagation for concat
2023-02-20 16:07:28 +01:00
Leonard Sikorski
5d3cd81fd1 Add aten::narrow operator with layer test (#15788) 2023-02-20 15:47:25 +01:00
Anastasiia Pnevskaia
c8c4503672 Error messages correcting in MO extractor (#15783)
* Error messages correcting.

* Error messages correcting.

* Small corrections.
2023-02-20 15:20:54 +01:00
Roman Kazantsev
bc8d0ec71e [TF FE] Refactor ReverseSequence and add layer test (#15807)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-20 12:26:19 +00:00
Wang, Yang
1a070b225e [AUTO] Failed to get the ov::model_name when loading network to target device is not ready (#15810)
* Return model name after loading network is ready.

* Update,
2023-02-20 12:16:18 +00:00
Roman Kazantsev
b75a3b3465 [TF FE] Implement layer test for GatherNd translator (#15813)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-20 12:58:52 +01:00
Tomasz Dołbniak
310c4deab9 Allow dynamic data type in NMS (#15684) 2023-02-20 09:01:43 +01:00
Ilya Lavrenov
758ebe5242 Removed cross-check-tool (#15778) 2023-02-20 11:09:08 +04:00
Roman Kazantsev
699a1d1708 [TF FE] Refactor Gather operations and add layer tests (#15808)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-20 11:02:42 +04:00
Xuejun Zhai
d9f0890a84 Xuejun/remove apis in ov node (#15803)
* [Remove APIs] remove get_default_value() in ov::Node

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

* [Remove APIs] remove set_op_annotations & get_op_annotations() in ov::Node

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-02-20 10:56:31 +04:00
Pawel Raasz
69728cb4ef Use new evaluate in template plugin (#15753)
* Use new evaluate method in template plugin

* Add tensor at the end of each iteration

* Remove class TemporaryOverrideOutputs

* Set shape of tensor after evaluate

* Revert "Remove class TemporaryOverrideOutputs"

This reverts commit e345ba9188.

* Update tensors when evaluate passed

* Copy data Tensor when HostTensor was initialized

* Set shape to output tensor in TemporaryOverrideOutputs

* Fix code style

* Add test

* Remove unused code

* Create reshape with scalar when shape is empty

* Reshape, special_zero = true

* Revert "Create reshape with scalar when shape is empty"

This reverts commit 0f901f419a.

* Use Shape with size zero and value max_int for dynamic tensors

* Restore Shape{0} for dynamic tensors

* Revert "Restore Shape{0} for dynamic tensors"

This reverts commit cb2d0e58eb.

* Temporary remove the test

* Use shape{0} for dynamic tensors

* Revert "Use shape{0} for dynamic tensors"

This reverts commit 08460a486b.

* Use Shape{0} for dynamic tensors

* Use new evaluate in template plugin
- Add tensor conversion between ov::Tensor <-> HostTensor
- Add shape utils to create special case shape to be dynamic shape
- Utils are in dev API to remove duplicates

* Move WA for set shape into the ov::tensor.

* Remove dynamic shape from or_tensor helper

* Mark tensor conversion utils as deprecated
- move shape util as core internal only
- update transpose test to not use deprecated functions

* Add missing deprecate suppression macro

---------

Co-authored-by: Artur Kulikowski <artur.kulikowski@intel.com>
2023-02-20 10:50:42 +04:00
Yury Gaydaychuk
7cffe848d6 [Debug tool] Commit slider (#14571) 2023-02-20 10:46:43 +04:00
Xuejun Zhai
749ff8c93f [Remove APIs] remove api set_data_shape (#15805)
Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
2023-02-20 00:20:30 +04:00
Dohyun Kim (Felix)
b7bcef6864 [GPU] Improve OV_GPU_DumpLayers debug configuration (#15719)
Co-authored-by: Kim,SungEun <sungeun.kim@intel.com>
2023-02-19 14:57:19 +00:00
Ilya Lavrenov
1d5839fb92 Fixed compilation with clang (#15801) 2023-02-19 16:22:18 +04:00
River Li
9cc8bc882b [CC]Add CC support for ir reader (#15659)
* Add CC support for ir reader

Change-Id: I3e1c02222800be090a4307bff8c231ad28b23ff7

* Fix clang issue

Change-Id: Idaf7bc5632bd558cfb7b0ecd8891435e5ba5c6ca
2023-02-18 15:43:19 +04:00
Oleg Pipikin
e9f060cce4 Remove WA for myriad plugin (#15786) 2023-02-18 12:42:44 +04:00
Evgenya Stepyreva
5f8f5b5eee Fix TFL warnings (#15793) 2023-02-18 10:23:57 +04:00
Ilya Lavrenov
ed5fa69b41 Fixed compilation on CI (#15787) 2023-02-17 22:28:48 +04:00
Evgeny Kotov
04f300e187 Gather Sinking for Unary operations (#15289)
* initial

* fix year

* CanGatherPropagateForward review fix

* HasSameOutputGatherNodes fix code review

* fix namespaces code review

* fix ReverseGatherIndexes code review

* clang fixes

* clang fixes

* remove unneeded function

* move utils to utils dir + change namespace

* clang fixes

* windows build fixes

* resotore attr file

* resotore attr file

* code review fix
2023-02-17 18:36:22 +01:00
Roman Lyamin
efb51b058c [GPU] Added operator== for cldnn primitives (#15736) 2023-02-17 19:09:12 +04:00
Ilya Churaev
59542d5cd3 Added header with itt macro (#15775) 2023-02-17 18:11:55 +04:00
Tomasz Jankowski
ed49d51ee1 [Transformations] Add Broadcast v3 nop-elimination (#15765)
* Nop-eliminate Broadcast v3

* Combine multi ops wrapper
2023-02-17 14:12:04 +01:00
Xuejun Zhai
91df0a8aa9 [API remove] remove variantImpl & variantwrapper related class/interfaces (#15580)
* [API remove] remove variantImpl & variantwrapper related class/interfaces

Signed-off-by: xuejun <xuejun.zhai@intel.com>

* [Remove APIs] fix code format issue

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove api] fix python compiler issue caused by deprecated varient

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Remove APIs] fix code format issue

Signed-off-by: xuejun <xuejun.zhai@intel.com>

---------

Signed-off-by: xuejun <xuejun.zhai@intel.com>
Signed-off-by: xuejun <Xuejun.Zhai@intel.com>
2023-02-17 16:31:26 +04:00
Pavel Esir
0f459c0455 [Core] fix compress_float_constants.cpp for denormal float16 (#15575)
* fix compress_float_constants.cpp for denormal float16

* keep denormals also in fp16; added unit-test

* fixed comment

* removed debug code; added some comments in unit-tests

* fix warning as error

* fix sign
2023-02-17 16:23:31 +04:00
Roman Kazantsev
7d13bc6861 [TF FE] Remove NormalizeL2 translator and refactor layer test (#15760)
It turned out that NormalizeL2 is absent in tf.raw_ops api
and always presented in the decomposed form.

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-17 14:37:42 +04:00
Evgenya Stepyreva
eeed1f252a TFLite vol.2 (#15698)
* Adds base class and first test for tflite_layer tests

* adds layer tests for unary ops

* adds functionality to get tensors from ops

* 1. adds functionality to use custom funcs for input generation
2. removed UNIQUE op from testing ops

* adds functionality to use custom dtypes

* Cast operation support

* Enhanced tfl layer tests

* Cast operation support

* Transpose Sinking: fix dummy case

* Supported 3 more ops: L2_NORMALIZATION, ARG_MAX, ARG_MIN

* Support scalar shapes

* Supported 1 more op: TRANSPOSE_CONV

* Supported 2 more ops: COMPLEX_ABS, RFFT2D (in combination)

* (DE)QUANTIZE as Identity. Questionable

* Trigger tfl layer tests in .ci

* Apply suggestions from code review

* empty constant support

* Commit as-is. Debug prints inside

* Not ready yet

* Style

* Comments resolved

* Style

* Dynamic shape support

* Style

---------

Co-authored-by: rnugmano <ruslan.nugmanov@intel.com>
Co-authored-by: missjane <estepyreva@gmail.com>
2023-02-17 10:30:16 +00:00
Roman Kazantsev
bd0dfbcd7a [TF FE] Refactor OneHot translator and add layer test (#15763)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-17 13:54:40 +04:00
Edward Shogulin
50090ed03a [Snippets] Linker issue fix in tests (#15346) 2023-02-17 13:13:04 +04:00
Ekaterina Aidova
225f9b3801 [PT FE]: fix aten::embedding realization for integer-like indicies an… (#15721)
* [PT FE]: fix aten::embedding realization for integer-like indicies and add tests

* more comments

* Update src/frontends/pytorch/src/op/embedding.cpp

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-02-17 08:09:46 +00:00
Vladislav Golubev
f03a3321fc GraphComparator: stricter requirements for sinks mapping (#15633) 2023-02-17 11:33:20 +04:00
Chen Xu
ff75fdadf3 [CPU] Register printing utilities (#15423) 2023-02-17 11:23:09 +04:00
Shen, Wanglei
c0fa45a1b9 remove invalid KEY_EXCLUSIVE_ASYNC_REQUESTS (#15776) 2023-02-17 11:02:20 +04:00
Wang, Yang
a088d1ab7d Disable core::set_property() to support ov::device::properties setting (#15175)
* Disable set_property() to support ov::device::properties setting.

* Update benchmark APP to set device properties through compile_model() instead of through set_property().

* Update.

* Update.

* Update some test case including ov::device::properties setting via core.ser_property().

* Since core.set_property() didn't support ov::device::properties setting, just remove the test case to check compile_model() works well if setting ov::device::properties via core.set_property() first.

* Update CompileModel in test name to CompiledModel

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>

* Add corresponding test case.

Signed-off-by: Wang, Yang <yang4.wang@intel.com>

* Update.

* Update.

* Remove the changes of this commit as this modification has nothing to do
with this PR.

This reverts commit 4f04b9f085.

---------

Signed-off-by: Wang, Yang <yang4.wang@intel.com>
Co-authored-by: Chen Peter <peter.chen@intel.com>
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-02-17 10:15:38 +04:00
Ilya Lavrenov
672522492e Changed sample's format_reader libraries type from dynamic to static (#15756) 2023-02-17 09:30:19 +04:00
guozhong wang
f48a67acc9 Improve test coverage for auto_executable_network.cpp (#14693)
* add test case for device_bind_buffer

* Correct path to header file properties.hpp

* rename remote blob testcase with multi

* add test case for remote blob and device bind buffer

* add logs for debug

* disable test case RemoteBlobInitializedWithoutGPU

* add property for remote blob test case

* remove debug logs for bind_multi_schedule.cpp

* fix MultiDeviceMultipleGPU_Test fail

* add test case for oversubsciption of infer requests

* get optimal number to create inferRequests

* using macro ENABLE_INTEL_CPU to make sure tests need CPU

* fix the issue that canCreateRemoteTensorThenInferWithAffinity test case fails to run

* remove ov::hint::PerformanceMode::UNDEFINED from MultiDeviceMultipleGPU_Test
2023-02-17 11:45:28 +08:00
Roman Kazantsev
bce8b7a04c [TF FE] Support auto-pruning for Iterator, IteratorGetNext, Queue and Lookup (#15731)
* [TF FE] Support auto-pruning for Iterator, IteratorGetNext, Queue and Lookup operations

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

* Fix build

* Fix build issue

* Fix build issue

* Fix build issue: use TF NodeContext

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

* Add hash_table translator

* Simplify code in translate session a bit and remove isolated Parameter nodes

* Update src/frontends/tensorflow/src/translate_session.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-17 07:34:09 +04:00
guozhong wang
12a706452c improve auto_executable_network line coverage (#14871)
* add test case for get perf_hint from GetMetric

* Increase Mock GetMetric test sleep time

* add mock test case for getMetric

* add new test case OVAutoExecutableNetworkTest

* convert ov::Any to ov::hint::Priority

* resolve conflict of get_metric.hpp

* add macro ENABLE_INTEL_CPU for gpu test case and fix cases not getting instantiated for cpu test

* fix the issue of running Mock GetMetric test cases fail

* add perf_hint test cases to properties_tests.cpp

* Modify the logic of judging whether it is a single device in ctput mode
2023-02-17 11:30:17 +08:00
Wang, Yang
d89615ff9e [AUTO] Enable AUTO compiledModel::get_property supporting its properties only. (#15003)
* Enable AUTO compiledModel::get_property supporting its properties only.

* Update.

* Update.

* Update some releated test cases.

* Update.

* Update related test case.

Signed-off-by: Wang, Yang <yang4.wang@intel.com>

---------

Signed-off-by: Wang, Yang <yang4.wang@intel.com>
Co-authored-by: Chen Peter <peter.chen@intel.com>
2023-02-17 11:27:51 +08:00
3575 changed files with 140836 additions and 70656 deletions

View File

@@ -118,13 +118,11 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib
@@ -160,6 +158,8 @@ jobs:
-DENABLE_TESTS=ON
-DBUILD_java_api=ON
-DBUILD_nvidia_plugin=OFF
-DBUILD_custom_operations=OFF
-DENABLE_INTEL_GPU=ON
-DOPENVINO_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
-DCMAKE_CXX_LINKER_LAUNCHER=ccache
-DCMAKE_C_LINKER_LAUNCHER=ccache

View File

@@ -1 +1 @@
rel-1.8.1
rel-1.14.0

View File

@@ -71,7 +71,7 @@ jobs:
maxParallel: '2'
# About 150% of total time
timeoutInMinutes: '120'
timeoutInMinutes: '180'
pool:
name: LIN_VMSS_VENV_F16S_U20_WU2
@@ -151,13 +151,11 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib
@@ -165,7 +163,7 @@ jobs:
set -e
sudo -E $(REPO_DIR)/install_build_dependencies.sh
# Move jdk into contrib
# 'clang' compiler is to check that samples can be built using it
# 'clang' compiler is used as a default compiler
sudo apt --assume-yes install openjdk-11-jdk libbz2-dev clang
# For Python API
python3 -m pip install --upgrade pip
@@ -219,7 +217,6 @@ jobs:
# Should be after 'Install dependencies' because Git lfs is not installed
- checkout: testdata
clean: 'true'
fetchDepth: '1'
lfs: 'true'
path: testdata
@@ -239,10 +236,14 @@ jobs:
-DENABLE_FASTER_BUILD=ON
-DENABLE_STRICT_DEPENDENCIES=OFF
-DOPENVINO_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
-DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose"
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_LINKER_LAUNCHER=ccache
-DCMAKE_C_LINKER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_COMPILER=clang
-DENABLE_SYSTEM_SNAPPY=ON
-DCPACK_GENERATOR=$(CMAKE_CPACK_GENERATOR)
-DBUILD_nvidia_plugin=OFF
-S $(REPO_DIR)
@@ -303,7 +304,7 @@ jobs:
# Skip test_onnx/test_zoo_models and test_onnx/test_backend due to long execution time
- script: |
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.00.00.1910/linux/x64:$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.05.00.1906/linux/x64:$(LD_LIBRARY_PATH)
python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph $(PYTHON_STATIC_ARGS) \
--junitxml=$(INSTALL_TEST_DIR)/TEST-Pyngraph.xml \
--ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py \
@@ -313,7 +314,7 @@ jobs:
# Skip test_onnx/test_zoo_models and test_onnx/test_backend due to long execution time
- script: |
# For python imports to import pybind_mock_frontend
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.00.00.1910/linux/x64:$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.05.00.1906/linux/x64:$(LD_LIBRARY_PATH)
export PYTHONPATH=$(INSTALL_TEST_DIR):$(INSTALL_DIR)/python/python3.8:$PYTHONPATH
python3 -m pytest -sv $(INSTALL_TEST_DIR)/pyopenvino $(PYTHON_STATIC_ARGS) \
--junitxml=$(INSTALL_TEST_DIR)/TEST-Pyngraph.xml \
@@ -323,7 +324,7 @@ jobs:
displayName: 'Python API 2.0 Tests'
- script: |
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.00.00.1910/linux/x64:$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH=$(REPO_DIR)/temp/gna_03.05.00.1906/linux/x64:$(LD_LIBRARY_PATH)
python3 -m pytest -s $(INSTALL_TEST_DIR)/mo/unit_tests --junitxml=$(INSTALL_TEST_DIR)/TEST-ModelOptimizer.xml
displayName: 'Model Optimizer UT'
@@ -361,7 +362,7 @@ jobs:
displayName: 'List install files'
- script: $(SAMPLES_INSTALL_DIR)/cpp/build_samples.sh -i $(INSTALL_DIR) -b $(BUILD_DIR)/cpp_samples
displayName: 'Build cpp samples'
displayName: 'Build cpp samples - gcc'
- script: $(SAMPLES_INSTALL_DIR)/cpp/build_samples.sh -b $(BUILD_DIR)/cpp_samples_clang
env:
@@ -389,17 +390,16 @@ jobs:
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_conditional_compilation_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ConditionalCompilation.xml
displayName: 'Conditional Compilation Tests'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-PaddleTests.xml
displayName: 'Paddle Tests'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_ir_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-IRFrontend.xml
displayName: 'IR Frontend Tests'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_onnx_frontend_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ONNXFrontend.xml
displayName: 'ONNX Frontend Tests'
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Paddle.xml
displayName: 'Paddle Frontend UT'
enabled: 'false'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_tensorflow_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Tensorflow.xml
displayName: 'TensorFlow Frontend Unit Tests'
@@ -430,10 +430,14 @@ jobs:
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_gna_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ov_gna_unit_tests.xml
displayName: 'GNA UT'
enabled: 'false' # TODO: fix
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_auto_batch_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ov_auto_batch_unit_tests.xml
displayName: 'AutoBatch UT'
- script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_template_func_tests --gtest_filter=*smoke* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-templateFuncTests.xml
displayName: 'TEMPLATE FuncTests'
@@ -443,16 +447,10 @@ jobs:
- script: |
$(RUN_PREFIX) $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-InferenceEngineCAPITests.xml
env:
DATA_PATH: $(MODELS_PATH)
MODELS_PATH: $(MODELS_PATH)
displayName: 'IE CAPITests'
- script: |
$(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_capi_test --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ov_capi_test.xml
env:
DATA_PATH: $(MODELS_PATH)
MODELS_PATH: $(MODELS_PATH)
displayName: 'OV CAPITests'
- task: CMake@1
@@ -527,22 +525,9 @@ jobs:
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH
export TEST_DEVICE=CPU
$(RUN_PREFIX) python3 -m pytest $(LAYER_TESTS_DIR)/mo_python_api_tests/test_mo_convert_complex_params.py --ir_version=11 --junitxml=./TEST-test_mo_convert_complex_params.xmlTEST
displayName: 'MO Python API Tests - Complex Python params'
$(RUN_PREFIX) python3 -m pytest $(LAYER_TESTS_DIR)/mo_python_api_tests/ --junitxml=./TEST-test_mo_convert.xmlTEST
displayName: 'MO Python API Tests'
- script: |
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH
export TEST_DEVICE=CPU
$(RUN_PREFIX) python3 -m pytest $(LAYER_TESTS_DIR)/mo_python_api_tests/test_mo_convert_tf.py --ir_version=11 --junitxml=./TEST-test_mo_convert_tf.xmlTEST
displayName: 'MO Python API Tests - Import TF model from memory'
- script: |
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH
export TEST_DEVICE=CPU
$(RUN_PREFIX) python3 -m pytest $(LAYER_TESTS_DIR)/mo_python_api_tests/test_mo_convert_pytorch.py --ir_version=11 --junitxml=./TEST-test_mo_convert_pytorch.xmlTEST
displayName: 'MO Python API Tests - Import PyTorch model from memory'
- script: |
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt

View File

@@ -134,13 +134,11 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib

View File

@@ -102,7 +102,6 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
@@ -118,7 +117,6 @@ jobs:
- checkout: testdata
clean: 'true'
fetchDepth: '1'
lfs: 'true'
path: testdata

View File

@@ -82,13 +82,11 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib

View File

@@ -100,13 +100,11 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib

View File

@@ -102,14 +102,13 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- script: |
set -e
sudo -E $(REPO_DIR)/install_build_dependencies.sh
# 'clang' compiler is to check that samples can be built using it
# 'clang' is used as a default compiler
sudo apt --assume-yes install clang
sudo apt --assume-yes install --no-install-recommends libopencv-imgproc-dev libopencv-imgcodecs-dev
# For opencv-python: python3-setuptools and pip upgrade
@@ -143,7 +142,6 @@ jobs:
# Should be after 'Install dependencies' because Git lfs is not installed
- checkout: testdata
clean: 'true'
fetchDepth: '1'
lfs: 'true'
path: testdata
@@ -161,6 +159,7 @@ jobs:
-DENABLE_TESTS=ON
-DENABLE_FASTER_BUILD=ON
-DENABLE_STRICT_DEPENDENCIES=OFF
-DENABLE_SYSTEM_SNAPPY=ON
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_LINKER_LAUNCHER=ccache
@@ -283,13 +282,13 @@ jobs:
displayName: 'Clean build dir'
- script: $(SAMPLES_INSTALL_DIR)/cpp/build_samples.sh -i $(INSTALL_DIR)
displayName: 'Build cpp samples'
displayName: 'Build cpp samples - gcc'
- script: $(SAMPLES_INSTALL_DIR)/cpp/build_samples.sh -i $(INSTALL_DIR)
displayName: 'Build cpp samples - clang'
env:
CC: clang
CXX: clang++
displayName: 'Build cpp samples - clang'
- script: $(SAMPLES_INSTALL_DIR)/c/build_samples.sh -i $(INSTALL_DIR)
displayName: 'Build c samples'
@@ -306,11 +305,12 @@ jobs:
LD_LIBRARY_PATH: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend Tests'
- script: |
$(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Paddle.xml
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
- script: $(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Paddle.xml
env:
LD_LIBRARY_PATH: $(INSTALL_TEST_DIR)
displayName: 'Paddle Frontend UT'
enabled: 'false'
- script: $(INSTALL_TEST_DIR)/ov_tensorflow_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Tensorflow.xml
env:

View File

@@ -30,7 +30,6 @@ jobs:
# - checkout: self
# clean: 'true'
# fetchDepth: '1'
# submodules: 'true'
# path: openvino
@@ -42,7 +41,6 @@ jobs:
# Should be after 'Install dependencies' because Git lfs is not installed
# - checkout: testdata
# clean: 'true'
# fetchDepth: '1'
# submodules: 'true'
# lfs: 'true'
# path: testdata

View File

@@ -91,7 +91,6 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino

View File

@@ -101,7 +101,6 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
@@ -171,7 +170,7 @@ jobs:
- script: |
source $(INSTALL_DIR)/setupvars.sh
./onnxruntime_shared_lib_test
./onnxruntime_shared_lib_test --gtest_filter=-CApiTest.test_custom_op_openvino_wrapper_library
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
displayName: 'Run onnxruntime_shared_lib_test'

View File

@@ -100,19 +100,16 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib
- checkout: testdata
clean: 'true'
fetchDepth: '1'
lfs: 'true'
path: testdata
@@ -143,9 +140,6 @@ jobs:
-DBUILD_nvidia_plugin=OFF \
-S $(REPO_DIR) \
-B $(BUILD_DIR)
env:
CC: gcc
CXX: g++
displayName: 'CMake OpenVINO'
- script: ls -alR $(REPO_DIR)/temp/

View File

@@ -122,19 +122,16 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
- checkout: openvino_contrib
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino_contrib
- checkout: testdata
clean: 'true'
fetchDepth: '1'
lfs: 'true'
path: testdata
@@ -179,6 +176,7 @@ jobs:
-DENABLE_STRICT_DEPENDENCIES=OFF ^
-DENABLE_PYTHON=ON ^
-DBUILD_nvidia_plugin=OFF ^
-DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose" ^
-DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.10.7\x64\python.exe" ^
-DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.10.7\x64\include" ^
-DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.10.7\x64\libs\python310.lib" ^
@@ -269,8 +267,9 @@ jobs:
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_onnx_frontend_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ONNXFrontend.xml
displayName: 'ONNX Frontend Tests'
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-Paddle.xml
displayName: 'Paddle Frontend UT'
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
#- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-Paddle.xml
# displayName: 'Paddle Frontend UT'
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_tensorflow_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-Tensorflow.xml
displayName: 'TensorFlow Frontend Unit Tests'
@@ -305,6 +304,9 @@ jobs:
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT'
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_auto_batch_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ov_auto_batch_unit_tests.xml
displayName: 'AutoBatch UT'
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_template_func_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-templateFuncTests.xml
displayName: 'TEMPLATE FuncTests'
@@ -314,16 +316,10 @@ jobs:
- script: |
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-InferenceEngineCAPITests.xml
env:
DATA_PATH: $(MODELS_PATH)
MODELS_PATH: $(MODELS_PATH)
displayName: 'IE CAPITests'
- script: |
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_capi_test --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ov_capi_test.xml
env:
DATA_PATH: $(MODELS_PATH)
MODELS_PATH: $(MODELS_PATH)
displayName: 'OV CAPITests'
- task: PublishTestResults@2

View File

@@ -93,7 +93,6 @@ jobs:
- checkout: self
clean: 'true'
fetchDepth: '1'
submodules: 'true'
path: openvino
@@ -107,7 +106,6 @@ jobs:
- checkout: testdata
clean: 'true'
lfs: 'true'
fetchDepth: '1'
path: testdata
- script: |

114
.github/dependabot.yml vendored
View File

@@ -6,7 +6,7 @@ updates:
# Python product dependencies
#
# Python API requirements
# Python API, Frontends
- package-ecosystem: pip
directory: "/src/bindings/python/"
schedule:
@@ -17,12 +17,33 @@ updates:
assignees:
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
- "ceciliapeng2011"
- "meiyang-intel"
- "mbencer"
- "tomdol"
- "jane-intel"
versioning-strategy: increase-if-necessary
# Tests
- package-ecosystem: pip
directory: "/tests"
schedule:
interval: "daily"
time: "09:00"
timezone: "Poland"
open-pull-requests-limit: 3
assignees:
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary
# Model Optimizer requirements
# Model Optimizer, openvino_dev and Benchmark tool
- package-ecosystem: pip
directory: "/tools/mo"
directory: "/tools"
schedule:
interval: "daily"
time: "09:00"
@@ -33,6 +54,8 @@ updates:
- "andrei-kochin"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "Wovchena"
allow:
- dependency-name: "*"
dependency-type: "production"
@@ -51,89 +74,10 @@ updates:
- "KodiaqQ"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary
# benchmark_tool requirements
- package-ecosystem: pip
directory: "/tools/benchmark_tool"
schedule:
interval: "daily"
time: "09:00"
timezone: "Asia/Dubai"
open-pull-requests-limit: 3
assignees:
- "Wovchena"
- "jiwaszki"
- "p-wysocki"
- "rkazants"
versioning-strategy: increase-if-necessary
#
# Tests requirements for frontends
#
# PaddlePaddle FE tests requirements
- package-ecosystem: pip
directory: "/src/frontends/paddle/tests/"
schedule:
interval: "daily"
time: "09:00"
timezone: "Asia/Shanghai"
open-pull-requests-limit: 3
assignees:
- "ceciliapeng2011"
- "meiyang-intel"
- "jiwaszki"
- "p-wysocki"
- "rkazants"
versioning-strategy: increase-if-necessary
# ONNX FE tests requirements
- package-ecosystem: pip
directory: "/src/frontends/onnx/tests/"
schedule:
interval: "daily"
time: "09:00"
timezone: "Poland"
open-pull-requests-limit: 3
assignees:
- "mbencer"
- "tomdol"
- "jiwaszki"
- "p-wysocki"
- "rkazants"
versioning-strategy: increase-if-necessary
# TensorFlow FE tests requirements
- package-ecosystem: pip
directory: "/src/frontends/tensorflow/tests/"
schedule:
interval: "daily"
time: "09:00"
timezone: "Asia/Dubai"
open-pull-requests-limit: 3
assignees:
- "rkazants"
- "jiwaszki"
- "p-wysocki"
versioning-strategy: increase-if-necessary
# TensorFlow Lite FE tests requirements
- package-ecosystem: pip
directory: "/src/frontends/tensorflow_lite/tests/"
schedule:
interval: "daily"
time: "09:00"
timezone: "Asia/Dubai"
open-pull-requests-limit: 3
assignees:
- "jane-intel"
- "rkazants"
- "jiwaszki"
- "p-wysocki"
versioning-strategy: increase-if-necessary
#
# Python Samples
#
@@ -149,6 +93,7 @@ updates:
- "Wovchena"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary
@@ -163,6 +108,7 @@ updates:
- "Wovchena"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary
@@ -177,6 +123,7 @@ updates:
- "Wovchena"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary
@@ -191,6 +138,7 @@ updates:
- "Wovchena"
- "jiwaszki"
- "p-wysocki"
- "akuporos"
- "rkazants"
versioning-strategy: increase-if-necessary

View File

@@ -11,7 +11,7 @@ env:
DOXYREST_VER: '2.1.3'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
@@ -25,7 +25,7 @@ jobs:
lfs: true
- name: Install apt-get dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.1.3
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
with:
packages: graphviz texlive liblua5.2-0 libclang1-9 libclang-cpp9
version: 3.0

View File

@@ -30,6 +30,13 @@ jobs:
submodules: recursive
lfs: true
- name: Install OpenCL
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
if: runner.os == 'Linux'
with:
packages: ocl-icd-opencl-dev opencl-headers
version: 3.0
- name: CMake configure
run: cmake -DCMAKE_BUILD_TYPE=Release -B build

View File

@@ -30,7 +30,7 @@ jobs:
python-version: '3.10'
- name: Cache pip
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/mo/requirements*.txt') }}

2
.gitignore vendored
View File

@@ -57,3 +57,5 @@ __pycache__
/tools/mo/*.mapping
/tools/mo/*.dat
/tools/mo/*.svg
/src/plugins/intel_cpu/tools/commit_slider/*.json
/src/plugins/intel_cpu/tools/commit_slider/slider_cache/*

3
.gitmodules vendored
View File

@@ -66,3 +66,6 @@
[submodule "thirdparty/flatbuffers/flatbuffers"]
path = thirdparty/flatbuffers/flatbuffers
url = https://github.com/google/flatbuffers.git
[submodule "thirdparty/snappy"]
path = thirdparty/snappy
url = https://github.com/google/snappy.git

View File

@@ -17,12 +17,12 @@ else()
endif()
endif()
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type" FORCE)
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW) # Enables use of MSVC_RUNTIME_LIBRARY
endif()
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
find_package(IEDevScripts REQUIRED
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
NO_CMAKE_FIND_ROOT_PATH
@@ -39,7 +39,6 @@ if(ENABLE_COVERAGE)
endif()
# resolving dependencies for the project
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})
@@ -48,10 +47,28 @@ 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})
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
message (STATUS "CMAKE_TOOLCHAIN_FILE .................. " ${CMAKE_TOOLCHAIN_FILE})
message (STATUS "GLIBC_VERSION.......................... " ${OV_GLIBC_VERSION})
if(OV_GENERATOR_MULTI_CONFIG)
string(REPLACE ";" " " config_types "${CMAKE_CONFIGURATION_TYPES}")
message (STATUS "CMAKE_CONFIGURATION_TYPES ............. " ${config_types})
unset(config_types)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
message (STATUS "CMAKE_DEFAULT_BUILD_TYPE .............. " ${CMAKE_DEFAULT_BUILD_TYPE})
endif()
else()
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
endif()
if(CMAKE_GENERATOR_PLATFORM)
message (STATUS "CMAKE_GENERATOR_PLATFORM .............. " ${CMAKE_GENERATOR_PLATFORM})
endif()
if(CMAKE_GENERATOR_TOOLSET)
message (STATUS "CMAKE_GENERATOR_TOOLSET ............... " ${CMAKE_GENERATOR_TOOLSET})
endif()
if(CMAKE_TOOLCHAIN_FILE)
message (STATUS "CMAKE_TOOLCHAIN_FILE .................. " ${CMAKE_TOOLCHAIN_FILE})
endif()
if(OV_GLIBC_VERSION)
message (STATUS "GLIBC_VERSION ......................... " ${OV_GLIBC_VERSION})
endif()
# remove file with exported developer targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/ngraphTargets.cmake")

View File

@@ -163,7 +163,7 @@ The system requirements vary depending on platform and are available on dedicate
## How to build
See the [OpenVINO Wiki](https://github.com/openvinotoolkit/openvino/wiki#how-to-build) to get more information about the OpenVINO build process.
See [How to build OpenVINO](./docs/dev/build.md) to get more information about the OpenVINO build process.
## How to contribute

View File

@@ -97,10 +97,10 @@ function(ov_download_tbb)
if(WIN32 AND X86_64)
# TODO: add target_path to be platform specific as well, to avoid following if
RESOLVE_DEPENDENCY(TBB
ARCHIVE_WIN "tbb2020_617e9a71_win.zip"
ARCHIVE_WIN "oneapi-tbb-2021.2.1-win.zip"
TARGET_PATH "${TEMP}/tbb"
ENVIRONMENT "TBBROOT"
SHA256 "01cac3cc48705bd52b83a6e1fa1ed95c708928be76160f5b9c5c37f954d56df4"
SHA256 "d81591673bd7d3d9454054642f8ef799e1fdddc7b4cee810a95e6130eb7323d4"
USE_NEW_LOCATION TRUE)
elseif(ANDROID AND X86_64)
RESOLVE_DEPENDENCY(TBB
@@ -110,10 +110,10 @@ function(ov_download_tbb)
SHA256 "f42d084224cc2d643314bd483ad180b081774608844000f132859fca3e9bf0ce")
elseif(LINUX AND X86_64)
RESOLVE_DEPENDENCY(TBB
ARCHIVE_LIN "tbb2020_617e9a71_lin_strip.tgz"
ARCHIVE_LIN "oneapi-tbb-2021.2.1-lin.tgz"
TARGET_PATH "${TEMP}/tbb"
ENVIRONMENT "TBBROOT"
SHA256 "e7a38f68059fb36de8b59d40b283a849f26275e34a58d2acadfdb84d49e31b9b"
SHA256 "0a56f73baaa40d72e06949ea6d593ae63a19f7580ce71c08287c1f59d2e5b988"
USE_NEW_LOCATION TRUE)
elseif(YOCTO_AARCH64)
RESOLVE_DEPENDENCY(TBB
@@ -123,10 +123,10 @@ function(ov_download_tbb)
SHA256 "321261ff2eda6d4568a473cb883262bce77a93dac599f7bd65d2918bdee4d75b")
elseif(APPLE AND X86_64)
RESOLVE_DEPENDENCY(TBB
ARCHIVE_MAC "tbb2020_617e9a71_mac.tgz"
ARCHIVE_MAC "oneapi-tbb-2021.2.1-mac.tgz"
TARGET_PATH "${TEMP}/tbb"
ENVIRONMENT "TBBROOT"
SHA256 "67a44b695bef3348416eaf5bf2baca2b1401576c0e09c394304eba1e0eee96cd"
SHA256 "c57ce4b97116cd3093c33e6dcc147fb1bbb9678d0ee6c61a506b2bfe773232cb"
USE_NEW_LOCATION TRUE)
else()
message(WARNING "Prebuilt TBB is not available on current platform")
@@ -177,16 +177,18 @@ function(ov_download_tbbbind_2_5)
if(WIN32 AND X86_64)
RESOLVE_DEPENDENCY(TBBBIND_2_5
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
ARCHIVE_WIN "tbbbind_2_5_static_win_v2.zip"
TARGET_PATH "${TEMP}/tbbbind_2_5"
ENVIRONMENT "TBBBIND_2_5_ROOT"
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
SHA256 "49ae93b13a13953842ff9ae8d01681b269b5b0bc205daf18619ea9a828c44bee"
USE_NEW_LOCATION TRUE)
elseif(LINUX AND X86_64)
RESOLVE_DEPENDENCY(TBBBIND_2_5
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
ARCHIVE_LIN "tbbbind_2_5_static_lin_v3.tgz"
TARGET_PATH "${TEMP}/tbbbind_2_5"
ENVIRONMENT "TBBBIND_2_5_ROOT"
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
SHA256 "d39deb262c06981b5e2d2e3c593e9fc9be62ce4feb91dd4e648e92753659a6b3"
USE_NEW_LOCATION TRUE)
else()
# TMP: for Apple Silicon TBB does not provide TBBBind
if(NOT (APPLE AND AARCH64))
@@ -298,8 +300,8 @@ if(ENABLE_INTEL_GNA)
GNA_LIB_DIR
libGNA_INCLUDE_DIRS
libGNA_LIBRARIES_BASE_PATH)
set(GNA_VERSION "03.00.00.1910")
set(GNA_HASH "894ddbc0ae3459f04513b853b0cabc32890dd4ea37228a022b6a32101bdbb7f8")
set(GNA_VERSION "03.05.00.1906")
set(GNA_HASH "4a5be86d9c026b0e10afac2a57fc7c99d762b30e3d506abb3a3380fbcfe2726e")
set(FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/include)
if(WIN32)

View File

@@ -24,7 +24,6 @@ function(set_ci_build_number)
endfunction()
include(features)
include(message)
set_ci_build_number()
@@ -112,10 +111,13 @@ else()
set(BIN_FOLDER "bin/${ARCH_FOLDER}")
endif()
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release;Debug;RelWithDebInfo;MinSizeRel")
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
# Ninja-Multi specific, see:
# https://cmake.org/cmake/help/latest/variable/CMAKE_DEFAULT_BUILD_TYPE.html
set(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "CMake default build type")
elseif(NOT OV_GENERATOR_MULTI_CONFIG)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release;Debug;RelWithDebInfo;MinSizeRel")
endif()
if(USE_BUILD_TYPE_SUBFOLDER)
@@ -153,10 +155,10 @@ set(CMAKE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX})
set(CMAKE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX})
# Support CMake multi-configuration for Visual Studio / Ninja or Xcode build
if (OV_GENERATOR_MULTI_CONFIG)
if(OV_GENERATOR_MULTI_CONFIG)
set(IE_BUILD_POSTFIX $<$<CONFIG:Debug>:${IE_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${IE_RELEASE_POSTFIX}>)
else ()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
else()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(IE_BUILD_POSTFIX ${IE_DEBUG_POSTFIX})
else()
set(IE_BUILD_POSTFIX ${IE_RELEASE_POSTFIX})

View File

@@ -5,60 +5,99 @@
if(WIN32)
set(PROGRAMFILES_ENV "ProgramFiles(X86)")
file(TO_CMAKE_PATH $ENV{${PROGRAMFILES_ENV}} PROGRAMFILES)
set(UWP_SDK_PATH "${PROGRAMFILES}/Windows Kits/10/bin/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/x64")
message(STATUS "Trying to find apivalidator in: ${UWP_SDK_PATH}")
find_host_program(UWP_API_VALIDATOR
set(WDK_PATHS "${PROGRAMFILES}/Windows Kits/10/bin/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/x64"
"${PROGRAMFILES}/Windows Kits/10/bin/x64")
message(STATUS "Trying to find apivalidator in: ")
foreach(wdk_path IN LISTS WDK_PATHS)
message(" * ${wdk_path}")
endforeach()
find_host_program(ONECORE_API_VALIDATOR
NAMES apivalidator
PATHS "${UWP_SDK_PATH}"
DOC "ApiValidator for UWP compliance")
PATHS ${WDK_PATHS}
DOC "ApiValidator for OneCore compliance")
if(UWP_API_VALIDATOR)
message(STATUS "Found apivalidator: ${UWP_API_VALIDATOR}")
if(ONECORE_API_VALIDATOR)
message(STATUS "Found apivalidator: ${ONECORE_API_VALIDATOR}")
endif()
endif()
function(_ie_add_api_validator_post_build_step_recursive)
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
list(APPEND API_VALIDATOR_TARGETS ${API_VALIDATOR_TARGET})
set(API_VALIDATOR_TARGETS ${API_VALIDATOR_TARGETS} PARENT_SCOPE)
get_target_property(IS_IMPORTED ${API_VALIDATOR_TARGET} IMPORTED)
if(IS_IMPORTED)
return()
endif()
get_target_property(LIBRARY_TYPE ${API_VALIDATOR_TARGET} TYPE)
if(LIBRARY_TYPE STREQUAL "EXECUTABLE" OR LIBRARY_TYPE STREQUAL "SHARED_LIBRARY")
get_target_property(LINKED_LIBRARIES ${API_VALIDATOR_TARGET} LINK_LIBRARIES)
if(LINKED_LIBRARIES)
foreach(ITEM IN LISTS LINKED_LIBRARIES)
if(NOT TARGET ${ITEM})
continue()
endif()
get_target_property(LIBRARY_TYPE_DEPENDENCY ${ITEM} TYPE)
if(LIBRARY_TYPE_DEPENDENCY STREQUAL "SHARED_LIBRARY")
_ie_add_api_validator_post_build_step_recursive(TARGET ${ITEM})
endif()
endforeach()
endif()
if(LIBRARY_TYPE MATCHES "^(SHARED_LIBRARY|MODULE_LIBRARY|EXECUTABLE)$" AND
NOT ${API_VALIDATOR_TARGET} IN_LIST API_VALIDATOR_TARGETS)
list(APPEND API_VALIDATOR_TARGETS ${API_VALIDATOR_TARGET})
endif()
# keep checks target list to track cyclic dependencies, leading to infinite recursion
list(APPEND checked_targets ${API_VALIDATOR_TARGET})
if(NOT LIBRARY_TYPE STREQUAL "INTERFACE_LIBRARY")
get_target_property(LINKED_LIBRARIES ${API_VALIDATOR_TARGET} LINK_LIBRARIES)
else()
set(LINKED_LIBRARIES)
endif()
get_target_property(INTERFACE_LINKED_LIBRARIES ${API_VALIDATOR_TARGET} INTERFACE_LINK_LIBRARIES)
foreach(library IN LISTS LINKED_LIBRARIES INTERFACE_LINKED_LIBRARIES)
if(TARGET "${library}")
get_target_property(orig_library ${library} ALIASED_TARGET)
if(orig_library IN_LIST checked_targets OR library IN_LIST checked_targets)
# in case of cyclic dependencies, we need to skip current target
continue()
endif()
if(TARGET "${orig_library}")
_ie_add_api_validator_post_build_step_recursive(TARGET ${orig_library})
else()
_ie_add_api_validator_post_build_step_recursive(TARGET ${library})
endif()
endif()
endforeach()
set(API_VALIDATOR_TARGETS ${API_VALIDATOR_TARGETS} PARENT_SCOPE)
endfunction()
set(VALIDATED_LIBRARIES "" CACHE INTERNAL "")
set(VALIDATED_TARGETS "" CACHE INTERNAL "")
function(_ov_add_api_validator_post_build_step)
set(UWP_API_VALIDATOR_APIS "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64/UniversalDDIs.xml")
set(UWP_API_VALIDATOR_EXCLUSION "${UWP_SDK_PATH}/BinaryExclusionlist.xml")
if((NOT UWP_API_VALIDATOR) OR (WINDOWS_STORE OR WINDOWS_PHONE))
if((NOT ONECORE_API_VALIDATOR) OR (WINDOWS_STORE OR WINDOWS_PHONE))
return()
endif()
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
# see https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/validating-windows-drivers#known-apivalidator-issues
# ApiValidator does not run on Arm64 because AitStatic does not work on Arm64
if(HOST_AARCH64)
return()
endif()
if(X86_64)
set(wdk_platform "x64")
elseif(X86)
set(wdk_platform "x86")
elseif(ARM)
set(wdk_platform "arm")
elseif(AARCH64)
set(wdk_platform "arm64")
else()
message(FATAL_ERROR "Unknown configuration: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()
find_file(ONECORE_API_VALIDATOR_APIS NAMES UniversalDDIs.xml
PATHS "${PROGRAMFILES}/Windows Kits/10/build/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/universalDDIs/${wdk_platform}"
"${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/${wdk_platform}"
DOC "Path to UniversalDDIs.xml file")
find_file(ONECORE_API_VALIDATOR_EXCLUSION NAMES BinaryExclusionlist.xml
PATHS ${WDK_PATHS}
DOC "Path to BinaryExclusionlist.xml file")
if(NOT ONECORE_API_VALIDATOR_APIS)
message(FATAL_ERROR "Internal error: apiValidator is found (${ONECORE_API_VALIDATOR}), but UniversalDDIs.xml file has not been found for ${wdk_platform} platform")
endif()
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "EXTRA" "" ${ARGN})
if(NOT API_VALIDATOR_TARGET)
message(FATAL_ERROR "RunApiValidator requires TARGET to validate!")
@@ -69,74 +108,81 @@ function(_ov_add_api_validator_post_build_step)
endif()
# collect targets
_ie_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
if (API_VALIDATOR_EXTRA)
foreach(target IN LISTS API_VALIDATOR_EXTRA)
_ie_add_api_validator_post_build_step_recursive(TARGET ${target})
endforeach()
endif()
# remove targets which were tested before
foreach(target IN LISTS API_VALIDATOR_TARGETS)
list(FIND VALIDATED_LIBRARIES ${target} index)
if (NOT index EQUAL -1)
list(APPEND VALIDATED_TARGETS ${target})
endif()
if(TARGET "${target}")
get_target_property(orig_target ${target} ALIASED_TARGET)
list(FIND VALIDATED_LIBRARIES ${orig_target} index)
if (NOT index EQUAL -1)
list(APPEND VALIDATED_TARGETS ${target})
endif()
endif()
endforeach()
foreach(item IN LISTS VALIDATED_TARGETS)
list(REMOVE_ITEM API_VALIDATOR_TARGETS ${item})
endforeach()
list(REMOVE_DUPLICATES API_VALIDATOR_TARGETS)
if(NOT API_VALIDATOR_TARGETS)
return()
endif()
# apply check
macro(api_validator_get_target_name)
get_target_property(IS_IMPORTED ${target} IMPORTED)
get_target_property(is_imported ${target} IMPORTED)
get_target_property(orig_target ${target} ALIASED_TARGET)
if(IS_IMPORTED)
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_name "${target_location}" NAME_WE)
if(is_imported)
get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS)
foreach(imported_config RELEASE RELWITHDEBINFO DEBUG)
if(imported_config IN_LIST imported_configs)
get_target_property(target_location ${target} IMPORTED_LOCATION_${imported_config})
get_filename_component(target_name "${target_location}" NAME_WE)
break()
endif()
endforeach()
unset(imported_configs)
elseif(TARGET "${orig_target}")
set(target_name ${orig_target})
set(target_location $<TARGET_FILE:${orig_target}>)
else()
set(target_name ${target})
set(target_location $<TARGET_FILE:${target}>)
endif()
unset(orig_target)
unset(is_imported)
endmacro()
foreach(target IN LISTS API_VALIDATOR_TARGETS)
api_validator_get_target_name()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21 AND OV_GENERATOR_MULTI_CONFIG)
set(output_file "${CMAKE_BINARY_DIR}/api_validator/$<CONFIG>/${target_name}.txt")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20 AND OV_GENERATOR_MULTI_CONFIG)
set(output_file "${OpenVINO_BINARY_DIR}/api_validator/$<CONFIG>/${target_name}.txt")
else()
set(output_file "${CMAKE_BINARY_DIR}/api_validator/${target_name}.txt")
set(output_file "${OpenVINO_BINARY_DIR}/api_validator/${target_name}.txt")
endif()
add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} --config $<CONFIG>
-D UWP_API_VALIDATOR=${UWP_API_VALIDATOR}
-D UWP_API_VALIDATOR_TARGET=$<TARGET_FILE:${target}>
-D UWP_API_VALIDATOR_APIS=${UWP_API_VALIDATOR_APIS}
-D UWP_API_VALIDATOR_EXCLUSION=${UWP_API_VALIDATOR_EXCLUSION}
-D UWP_API_VALIDATOR_OUTPUT=${output_file}
list(APPEND post_build_commands
${CMAKE_COMMAND} --config $<CONFIG>
-D ONECORE_API_VALIDATOR=${ONECORE_API_VALIDATOR}
-D ONECORE_API_VALIDATOR_TARGET=${target_location}
-D ONECORE_API_VALIDATOR_APIS=${ONECORE_API_VALIDATOR_APIS}
-D ONECORE_API_VALIDATOR_EXCLUSION=${ONECORE_API_VALIDATOR_EXCLUSION}
-D ONECORE_API_VALIDATOR_OUTPUT=${output_file}
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake"
BYPRODUCTS ${output_file}
COMMENT "[apiValidator] Check ${target_name} for OneCore compliance"
VERBATIM)
-P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake")
list(APPEND byproducts_files ${output_file})
unset(target_name)
unset(target_location)
endforeach()
add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD
COMMAND ${post_build_commands}
BYPRODUCTS ${byproducts_files}
COMMENT "[apiValidator] Check ${API_VALIDATOR_TARGET} and dependencies for OneCore compliance"
VERBATIM)
# update list of validated libraries
list(APPEND VALIDATED_LIBRARIES ${API_VALIDATOR_TARGETS})
set(VALIDATED_LIBRARIES "${VALIDATED_LIBRARIES}" CACHE INTERNAL "" FORCE)
list(APPEND VALIDATED_TARGETS ${API_VALIDATOR_TARGETS})
set(VALIDATED_TARGETS "${VALIDATED_TARGETS}" CACHE INTERNAL "" FORCE)
endfunction()
#

View File

@@ -4,9 +4,9 @@
cmake_policy(SET CMP0012 NEW)
foreach(var UWP_API_VALIDATOR UWP_API_VALIDATOR_TARGET
UWP_API_VALIDATOR_APIS UWP_API_VALIDATOR_EXCLUSION
UWP_API_VALIDATOR_OUTPUT CMAKE_TOOLCHAIN_FILE)
foreach(var ONECORE_API_VALIDATOR ONECORE_API_VALIDATOR_TARGET
ONECORE_API_VALIDATOR_APIS ONECORE_API_VALIDATOR_EXCLUSION
ONECORE_API_VALIDATOR_OUTPUT CMAKE_TOOLCHAIN_FILE)
if(NOT DEFINED ${var})
message(FATAL_ERROR "Variable ${var} is not defined")
endif()
@@ -14,18 +14,18 @@ endforeach()
# create command
if(NOT EXISTS "${UWP_API_VALIDATOR_APIS}")
message(FATAL_ERROR "${UWP_API_VALIDATOR_APIS} does not exist")
if(NOT EXISTS "${ONECORE_API_VALIDATOR_APIS}")
message(FATAL_ERROR "${ONECORE_API_VALIDATOR_APIS} does not exist")
endif()
set(command "${UWP_API_VALIDATOR}"
-SupportedApiXmlFiles:${UWP_API_VALIDATOR_APIS}
-DriverPackagePath:${UWP_API_VALIDATOR_TARGET})
if(EXISTS "${UWP_API_VALIDATOR_EXCLUSION}")
set(command "${ONECORE_API_VALIDATOR}"
-SupportedApiXmlFiles:${ONECORE_API_VALIDATOR_APIS}
-DriverPackagePath:${ONECORE_API_VALIDATOR_TARGET})
if(EXISTS "${ONECORE_API_VALIDATOR_EXCLUSION}")
list(APPEND command
-BinaryExclusionListXmlFile:${UWP_API_VALIDATOR_EXCLUSION}
-BinaryExclusionListXmlFile:${ONECORE_API_VALIDATOR_EXCLUSION}
-StrictCompliance:TRUE)
set(UWP_HAS_BINARY_EXCLUSION ON)
set(ONECORE_HAS_BINARY_EXCLUSION ON)
endif()
# execute
@@ -36,13 +36,13 @@ execute_process(COMMAND ${command}
RESULT_VARIABLE exit_code
OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE "${UWP_API_VALIDATOR_OUTPUT}" "${output_message}\n\n\n${error_message}")
file(WRITE "${ONECORE_API_VALIDATOR_OUTPUT}" "CMAKE COMMAND: ${command}\n\n\n${output_message}\n\n\n${error_message}")
# post-process output
get_filename_component(name "${UWP_API_VALIDATOR_TARGET}" NAME)
get_filename_component(name "${ONECORE_API_VALIDATOR_TARGET}" NAME)
if(NOT UWP_HAS_BINARY_EXCLUSION)
if(NOT ONECORE_HAS_BINARY_EXCLUSION)
if(CMAKE_TOOLCHAIN_FILE MATCHES "onecoreuap.toolchain.cmake$")
# empty since we compile with static MSVC runtime
else()
@@ -66,7 +66,7 @@ endif()
# write output
if(UWP_HAS_BINARY_EXCLUSION AND NOT exit_code EQUAL 0)
if(ONECORE_HAS_BINARY_EXCLUSION AND NOT exit_code EQUAL 0)
message(FATAL_ERROR "${error_message}")
endif()

View File

@@ -0,0 +1,52 @@
import pkg_resources
import re
import os
def check_python_requirements(requirements_path: str) -> None:
"""
Checks if the requirements defined in `requirements_path` are installed
in the active Python environment, while also taking constraints.txt files
into account.
"""
constraints = {}
constraints_path = None
requirements = []
# read requirements and find constraints file
with open(requirements_path) as f:
raw_requirements = f.readlines()
for line in raw_requirements:
if line.startswith("-c"):
constraints_path = os.path.join(os.path.dirname(requirements_path), line.split(' ')[1][:-1])
# read constraints if they exist
if constraints_path:
with open(constraints_path) as f:
raw_constraints = f.readlines()
for line in raw_constraints:
if line.startswith("#") or line=="\n":
continue
line = line.replace("\n", "")
package, delimiter, constraint = re.split("(~|=|<|>|;)", line, maxsplit=1)
if constraints.get(package) is None:
constraints[package] = [delimiter + constraint]
else:
constraints[package].extend([delimiter + constraint])
for line in raw_requirements:
if line.startswith(("#", "-c")):
continue
line = line.replace("\n", "")
if re.search("\W", line):
requirements.append(line)
else:
constraint = constraints.get(line)
if constraint:
for marker in constraint:
requirements.append(line+marker)
else:
requirements.append(line)
else:
requirements = raw_requirements
pkg_resources.require(requirements)

View File

@@ -3,23 +3,23 @@
#
if(ENABLE_CLANG_FORMAT)
set(clang_format_required_version 9)
set(CLANG_FORMAT_FILENAME clang-format-${clang_format_required_version} clang-format)
set(CLANG_FORMAT_REQUIRED_VERSION 9 CACHE STRING "Clang-format version to use")
set(CLANG_FORMAT_FILENAME clang-format-${CLANG_FORMAT_REQUIRED_VERSION} clang-format)
find_host_program(CLANG_FORMAT NAMES ${CLANG_FORMAT_FILENAME} PATHS ENV PATH)
if(CLANG_FORMAT)
execute_process(COMMAND ${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
if(NOT CLANG_VERSION)
message(WARNING "Supported clang-format version is ${clang_format_required_version}!")
message(WARNING "Supported clang-format version is ${CLANG_FORMAT_REQUIRED_VERSION}!")
set(ENABLE_CLANG_FORMAT OFF)
else()
string(REGEX REPLACE "[^0-9]+([0-9]+)\\..*" "\\1" CLANG_FORMAT_MAJOR_VERSION ${CLANG_VERSION})
if(NOT CLANG_FORMAT_MAJOR_VERSION EQUAL clang_format_required_version)
if(NOT CLANG_FORMAT_MAJOR_VERSION EQUAL CLANG_FORMAT_REQUIRED_VERSION)
message(WARNING "Supported clang-format version is 9! Provided version ${CLANG_FORMAT_MAJOR_VERSION}")
set(ENABLE_CLANG_FORMAT OFF)
endif()
endif()
else()
message(WARNING "Supported clang-format-${clang_format_required_version} is not found!")
message(WARNING "Supported clang-format-${CLANG_FORMAT_REQUIRED_VERSION} is not found!")
set(ENABLE_CLANG_FORMAT OFF)
endif()
endif()
@@ -70,6 +70,10 @@ function(add_clang_format_target TARGET_NAME)
continue()
endif()
if(IS_DIRECTORY "${source_file}")
message(FATAL_ERROR "Directory ${source_file} cannot be passed to clang-format")
endif()
file(RELATIVE_PATH source_file_relative "${CMAKE_CURRENT_SOURCE_DIR}" "${source_file}")
set(output_file "${CMAKE_CURRENT_BINARY_DIR}/clang_format/${source_file_relative}.clang")
string(REPLACE ".." "__" output_file "${output_file}")

View File

@@ -412,11 +412,6 @@ else()
# Warn if an undefined identifier is evaluated in an #if directive. Such identifiers are replaced with zero.
ie_add_compiler_flags(-Wundef)
check_cxx_compiler_flag("-Wsuggest-override" SUGGEST_OVERRIDE_SUPPORTED)
if(SUGGEST_OVERRIDE_SUPPORTED)
set(CMAKE_CXX_FLAGS "-Wsuggest-override ${CMAKE_CXX_FLAGS}")
endif()
#
# Warnings as errors
#
@@ -460,14 +455,13 @@ else()
endif()
endif()
# if(OV_COMPILER_IS_CLANG)
# ie_add_compiler_flags(-Wshorten-64-to-32)
# endif()
# TODO
if(OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
check_cxx_compiler_flag("-Wsuggest-override" SUGGEST_OVERRIDE_SUPPORTED)
if(SUGGEST_OVERRIDE_SUPPORTED)
set(CMAKE_CXX_FLAGS "-Wsuggest-override ${CMAKE_CXX_FLAGS}")
endif()
check_cxx_compiler_flag("-Wunused-but-set-variable" UNUSED_BUT_SET_VARIABLE_SUPPORTED)
#
# link_system_libraries(target <PUBLIC | PRIVATE | INTERFACE> <lib1 [lib2 lib3 ...]>)
#
@@ -499,6 +493,11 @@ endfunction()
# Tries to use gold linker in current scope (directory, function)
#
function(ov_try_use_gold_linker)
# don't use the gold linker, if the mold linker is set
if(CMAKE_EXE_LINKER_FLAGS MATCHES "mold" OR CMAKE_MODULE_LINKER_FLAGS MATCHES "mold" OR CMAKE_SHARED_LINKER_FLAGS MATCHES "mold")
return()
endif()
# gold linker on ubuntu20.04 may fail to link binaries build with sanitizer
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_SANITIZER AND NOT CMAKE_CROSSCOMPILING)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold" PARENT_SCOPE)

View File

@@ -33,7 +33,7 @@ if (ENABLE_UB_SANITIZER)
# https://github.com/KhronosGroup/OpenCL-CLHPP/issues/17
# 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 *(*)()'
# call to function get_api_version 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

View File

@@ -50,6 +50,9 @@ else()
if(ENABLE_INTEGRITYCHECK)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /INTEGRITYCHECK")
endif()
if(ENABLE_QSPECTRE)
ie_add_compiler_flags(/Qspectre)
endif()
endif()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${IE_C_CXX_FLAGS}")

View File

@@ -8,7 +8,7 @@ include(target_flags)
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
# this must be addressed in a proper way
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF
"LINUX OR (APPLE AND AARCH64);EMSCRIPTEN OR NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
"LINUX;EMSCRIPTEN OR NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
@@ -26,6 +26,8 @@ endif()
ie_option (CMAKE_COMPILE_WARNING_AS_ERROR "Enable warnings as errors" ${CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT})
ie_dependent_option (ENABLE_QSPECTRE "Enable Qspectre mitigation" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ie_dependent_option (ENABLE_INTEGRITYCHECK "build DLLs with /INTEGRITYCHECK flag" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ie_option (ENABLE_SANITIZER "enable checking memory errors via AddressSanitizer" OFF)

View File

@@ -15,8 +15,8 @@ set(OV_FRONTEND_MAP_DEFINITION " FrontendsStaticRegistry registry = {")
foreach(frontend IN LISTS FRONTEND_NAMES)
# common
set(_OV_FRONTEND_DATA_FUNC "GetFrontEndData${frontend}")
set(_OV_VERSION_FUNC "GetAPIVersion${frontend}")
set(_OV_FRONTEND_DATA_FUNC "get_front_end_data_${frontend}")
set(_OV_VERSION_FUNC "get_api_version_${frontend}")
# declarations
set(OV_FRONTEND_DECLARATIONS "${OV_FRONTEND_DECLARATIONS}

View File

@@ -182,7 +182,7 @@ macro(ov_add_frontend)
add_library(openvino::frontend::${OV_FRONTEND_NAME} ALIAS ${TARGET_NAME})
endif()
# Shutdown protobuf when unloading the front dynamic library
# Shutdown protobuf when unloading the frontend dynamic library
if(proto_files AND BUILD_SHARED_LIBS)
target_link_libraries(${TARGET_NAME} PRIVATE ov_protobuf_shutdown)
endif()
@@ -190,21 +190,8 @@ macro(ov_add_frontend)
if(NOT BUILD_SHARED_LIBS)
# override default function names
target_compile_definitions(${TARGET_NAME} PRIVATE
"-DGetFrontEndData=GetFrontEndData${OV_FRONTEND_NAME}"
"-DGetAPIVersion=GetAPIVersion${OV_FRONTEND_NAME}")
endif()
# enable LTO
set_target_properties(${TARGET_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
if(OV_FRONTEND_SKIP_NCC_STYLE)
# frontend's CMakeLists.txt must define its own custom 'ov_ncc_naming_style' step
else()
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
SOURCE_DIRECTORY "${frontend_root_dir}/include"
ADDITIONAL_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_INCLUDE_DIRECTORIES>)
"-Dget_front_end_data=get_front_end_data_${OV_FRONTEND_NAME}"
"-Dget_api_version=get_api_version_${OV_FRONTEND_NAME}")
endif()
target_include_directories(${TARGET_NAME}
@@ -217,8 +204,6 @@ macro(ov_add_frontend)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION ${OV_FRONTEND_FILEDESCRIPTION})
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime)
target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES})
ov_add_library_version(${TARGET_NAME})
@@ -255,10 +240,30 @@ macro(ov_add_frontend)
endif()
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${flatbuffers_schema_files})
EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${proto_files} ${flatbuffers_schema_files})
# enable LTO
set_target_properties(${TARGET_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
if(OV_FRONTEND_SKIP_NCC_STYLE)
# frontend's CMakeLists.txt must define its own custom 'ov_ncc_naming_style' step
else()
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
SOURCE_DIRECTORIES "${frontend_root_dir}/include"
"${frontend_root_dir}/src"
ADDITIONAL_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:${TARGET_NAME},INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:${TARGET_NAME},INCLUDE_DIRECTORIES>)
endif()
add_dependencies(ov_frontends ${TARGET_NAME})
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
# installation
if(NOT OV_FRONTEND_SKIP_INSTALL)
if(BUILD_SHARED_LIBS)
# Note:

View File

@@ -10,12 +10,12 @@
namespace {
using GetFrontEndDataFunc = void*();
using GetAPIVersionFunc = ov::frontend::FrontEndVersion();
using get_front_end_data_func = void*();
using get_api_version_func = ov::frontend::FrontEndVersion();
struct Value {
GetFrontEndDataFunc* m_dataFunc;
GetAPIVersionFunc* m_versionFunc;
get_front_end_data_func* m_dataFunc;
get_api_version_func* m_versionFunc;
};
using FrontendsStaticRegistry = std::vector<Value>;

View File

@@ -1,27 +0,0 @@
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
if(UNIX AND ENABLE_ERROR_HIGHLIGHT)
function(message)
string(ASCII 27 ESC)
set(RESET "${ESC}[m")
set(RED "${ESC}[31;1m")
set(YELLOW "${ESC}[33;1m")
list(GET ARGV 0 MessageType)
list(REMOVE_AT ARGV 0)
foreach(arg IN LISTS ARGV)
set(_msg "${_msg}${arg}")
endforeach()
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
_message(${MessageType} "${RED}${_msg}${RESET}")
elseif(MessageType STREQUAL WARNING)
_message(${MessageType} "${YELLOW}${_msg}${RESET}")
else()
_message(${MessageType} "${_msg}")
endif()
endfunction()
endif()

View File

@@ -63,6 +63,24 @@ function(ov_native_compile_external_project)
set(ARG_NATIVE_SOURCE_SUBDIR SOURCE_SUBDIR ${ARG_NATIVE_SOURCE_SUBDIR})
endif()
if(OV_GENERATOR_MULTI_CONFIG)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}")
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}")
endif()
else()
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21)
if(DEFINED CMAKE_CXX_LINKER_LAUNCHER)
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_CXX_LINKER_LAUNCHER=${CMAKE_CXX_LINKER_LAUNCHER}")
endif()
if(DEFINED CMAKE_C_LINKER_LAUNCHER)
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_C_LINKER_LAUNCHER=${CMAKE_C_LINKER_LAUNCHER}")
endif()
endif()
ExternalProject_Add(${ARG_TARGET_NAME}
# Directory Options
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -75,13 +93,10 @@ function(ov_native_compile_external_project)
CMAKE_ARGS
"-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}"
"-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}"
"-DCMAKE_CXX_LINKER_LAUNCHER=${CMAKE_CXX_LINKER_LAUNCHER}"
"-DCMAKE_C_LINKER_LAUNCHER=${CMAKE_C_LINKER_LAUNCHER}"
"-DCMAKE_CXX_FLAGS=${compile_flags}"
"-DCMAKE_C_FLAGS=${compile_flags}"
"-DCMAKE_POLICY_DEFAULT_CMP0069=NEW"
"-DCMAKE_INSTALL_PREFIX=${ARG_NATIVE_INSTALL_DIR}"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
${ARG_CMAKE_ARGS}
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
${ARG_NATIVE_SOURCE_SUBDIR}

View File

@@ -112,13 +112,13 @@ endif()
#
# ov_ncc_naming_style(FOR_TARGET target_name
# SOURCE_DIRECTORY dir
# [SOURCE_DIRECTORIES dir1 dir2 ...]
# [STYLE_FILE style_file.style]
# [ADDITIONAL_INCLUDE_DIRECTORIES dir1 dir2 ..]
# [DEFINITIONS def1 def2 ..])
#
# FOR_TARGET - name of the target
# SOURCE_DIRECTORY - directory to check sources from
# SOURCE_DIRECTORIES - directory to check sources from
# STYLE_FILE - path to the specific style file
# ADDITIONAL_INCLUDE_DIRECTORIES - additional include directories used in checked headers
# DEFINITIONS - additional definitions passed to preprocessor stage
@@ -129,9 +129,9 @@ function(ov_ncc_naming_style)
endif()
cmake_parse_arguments(NCC_STYLE "FAIL"
"FOR_TARGET;SOURCE_DIRECTORY;STYLE_FILE" "ADDITIONAL_INCLUDE_DIRECTORIES;DEFINITIONS" ${ARGN})
"FOR_TARGET;STYLE_FILE" "SOURCE_DIRECTORIES;ADDITIONAL_INCLUDE_DIRECTORIES;DEFINITIONS" ${ARGN})
foreach(var FOR_TARGET SOURCE_DIRECTORY)
foreach(var FOR_TARGET SOURCE_DIRECTORIES)
if(NOT DEFINED NCC_STYLE_${var})
message(FATAL_ERROR "${var} is not defined in ov_ncc_naming_style function")
endif()
@@ -141,18 +141,18 @@ function(ov_ncc_naming_style)
set(NCC_STYLE_STYLE_FILE ${ncc_style_dir}/openvino.style)
endif()
file(GLOB_RECURSE sources
RELATIVE "${NCC_STYLE_SOURCE_DIRECTORY}"
"${NCC_STYLE_SOURCE_DIRECTORY}/*.hpp"
"${NCC_STYLE_SOURCE_DIRECTORY}/*.cpp")
foreach(source_dir IN LISTS NCC_STYLE_SOURCE_DIRECTORIES)
file(GLOB_RECURSE local_sources "${source_dir}/*.hpp" "${source_dir}/*.cpp")
list(APPEND sources ${local_sources})
endforeach()
list(APPEND NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES "${NCC_STYLE_SOURCE_DIRECTORY}")
# without it sources with same name from different directories will map to same .ncc_style target
file(RELATIVE_PATH source_dir_rel ${CMAKE_SOURCE_DIR} ${NCC_STYLE_SOURCE_DIRECTORY})
list(APPEND NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES ${NCC_STYLE_SOURCE_DIRECTORIES})
foreach(source IN LISTS sources)
set(output_file "${ncc_style_bin_dir}/${source_dir_rel}/${source}.ncc_style")
set(full_source_path "${NCC_STYLE_SOURCE_DIRECTORY}/${source}")
foreach(source_file IN LISTS sources)
get_filename_component(source_dir "${source_file}" DIRECTORY)
file(RELATIVE_PATH source_dir_rel "${CMAKE_SOURCE_DIR}" "${source_dir}")
get_filename_component(source_name "${source_file}" NAME)
set(output_file "${ncc_style_bin_dir}/${source_dir_rel}/${source_name}.ncc_style")
add_custom_command(
OUTPUT
@@ -161,7 +161,7 @@ function(ov_ncc_naming_style)
"${CMAKE_COMMAND}"
-D "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
-D "NCC_PY_SCRIPT=${ncc_script_py}"
-D "INPUT_FILE=${full_source_path}"
-D "INPUT_FILE=${source_file}"
-D "OUTPUT_FILE=${output_file}"
-D "DEFINITIONS=${NCC_STYLE_DEFINITIONS}"
-D "CLANG_LIB_PATH=${libclang_location}"
@@ -170,12 +170,12 @@ function(ov_ncc_naming_style)
-D "EXPECTED_FAIL=${NCC_STYLE_FAIL}"
-P "${ncc_style_dir}/ncc_run.cmake"
DEPENDS
"${full_source_path}"
"${source_file}"
"${ncc_style_dir}/openvino.style"
"${ncc_script_py}"
"${ncc_style_dir}/ncc_run.cmake"
COMMENT
"[ncc naming style] ${source}"
"[ncc naming style] ${source_dir_rel}/${source_name}"
VERBATIM)
list(APPEND output_files ${output_file})
endforeach()
@@ -191,6 +191,6 @@ endfunction()
if(TARGET ncc_all)
ov_ncc_naming_style(FOR_TARGET ncc_all
SOURCE_DIRECTORY "${ncc_style_dir}/self_check"
SOURCE_DIRECTORIES "${ncc_style_dir}/self_check"
FAIL)
endif()

View File

@@ -1,7 +1,7 @@
# custom OpenVINO values
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)$'
StructName: '^([A-Z][\w]+|element_type_traits|hash|oi_pair|stat)$'
FunctionName: '^(operator\W+|[a-z_\d]+)|PrintTo$'
Namespace: '^([a-z\d_]*|InferenceEngine)$'
NamespaceAlias: '^([a-z\d_]+|InferenceEngine)$'
@@ -12,7 +12,7 @@ TemplateNonTypeParameter: '^\w*$'
ClassTemplate: '^([A-Z][\w]+|element_type_traits)$'
TemplateTypeParameter: '^\w*$'
ParameterName: '^\w*$'
FunctionTemplate: '^(operator.+|[\w]+|Impl<.*>)$'
FunctionTemplate: '^(operator.+|[\w]+|SoPtr.+|Impl<.*>)$'
TypeAliasName: '^\w+$'
VariableReference: '^\w+$'
@@ -27,7 +27,7 @@ CxxDynamicCastExpression: '^.*$'
# not needed values
ClassTemplatePartialSpecialization: '^.*$'
ConversionFunction: '^.*$'
UsingDirective: 'XXXX'
UsingDirective: '^.*$'
ClassAccessSpecifier: '^.*$' # looks like can be fixed
TypeReference: '^.*$' # looks like can be fixed
CxxBaseSpecifier: '^.*$' # looks like can be fixed

View File

@@ -194,7 +194,7 @@ macro(ie_cpack)
set(CPACK_STRIP_FILES ON)
endif()
# TODO: replace with openvino
# TODO: replace with openvino and handle multi-config generators case
if(WIN32)
set(CPACK_PACKAGE_NAME inference-engine_${CMAKE_BUILD_TYPE})
else()
@@ -202,6 +202,7 @@ macro(ie_cpack)
endif()
set(CPACK_PACKAGE_VERSION "${OpenVINO_VERSION}")
# build version can be empty in case we are running cmake out of git repository
if(NOT OpenVINO_VERSION_BUILD STREQUAL "000")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${OpenVINO_VERSION_BUILD}")
endif()

View File

@@ -10,6 +10,24 @@ endif()
set(rpmlint_passed ON)
execute_process(COMMAND "${rpmlint_PROGRAM}" --version
RESULT_VARIABLE rpmlint_exit_code
OUTPUT_VARIABLE rpmlint_version)
if(NOT rpmlint_exit_code EQUAL 0)
message(FATAL_ERROR "Failed to get ${rpmlint_PROGRAM} version. Output is '${rpmlint_version}'")
endif()
if(rpmlint_version MATCHES "([0-9]+)\.([0-9]+)")
set(rpmlint_version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
else()
message(FATAL_ERROR "Failed to parse rpmlint version '${rpmlint_version}'")
endif()
if(rpmlint_version VERSION_GREATER_EQUAL 2.0)
set(rpmlint_has_strict_option ON)
endif()
foreach(rpm_file IN LISTS CPACK_PACKAGE_FILES)
get_filename_component(rpm_name "${rpm_file}" NAME)
get_filename_component(dir_name "${rpm_file}" DIRECTORY)
@@ -17,20 +35,25 @@ foreach(rpm_file IN LISTS CPACK_PACKAGE_FILES)
set(rpmlint_overrides "${dir_name}/${rpm_name}.rpmlintrc")
if(EXISTS "${rpmlint_overrides}")
set(file_option --file "${rpmlint_overrides}")
set(rpmlint_options --file "${rpmlint_overrides}")
endif()
if(rpmlint_has_strict_option)
list(APPEND rpmlint_options --strict)
endif()
execute_process(COMMAND "${rpmlint_PROGRAM}" --strict ${file_option} ${rpm_file}
execute_process(COMMAND "${rpmlint_PROGRAM}" ${rpmlint_options} ${rpm_file}
RESULT_VARIABLE rpmlint_exit_code
OUTPUT_VARIABLE rpmlint_output)
if(NOT rpmlint_exit_code EQUAL 0)
if(NOT rpmlint_exit_code EQUAL 0 OR NOT rpmlint_has_strict_option)
message("Package ${rpm_name}:")
message("${rpmlint_output}")
set(rpmlint_passed OFF)
if(rpmlint_has_strict_option)
set(rpmlint_passed OFF)
endif()
endif()
unset(file_option)
unset(rpmlint_options)
endforeach()
if(NOT rpmlint_passed)

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
#
foreach(var IE_DEVICE_MAPPING IE_PLUGINS_HPP_HEADER IE_PLUGINS_HPP_HEADER_IN)
foreach(var OV_DEVICE_MAPPING BUILD_SHARED_LIBS OV_PLUGINS_HPP_HEADER OV_PLUGINS_HPP_HEADER_IN)
if(NOT DEFINED ${var})
message(FATAL_ERROR "${var} is required, but not defined")
endif()
@@ -10,29 +10,15 @@ endforeach()
# configure variables
set(IE_PLUGINS_DECLARATIONS "")
set(IE_PLUGINS_MAP_DEFINITION
set(OV_PLUGINS_DECLARATIONS "")
set(OV_PLUGINS_MAP_DEFINITION
" static const std::map<Key, Value> plugins_hpp = {")
foreach(dev_map IN LISTS IE_DEVICE_MAPPING)
foreach(dev_map IN LISTS OV_DEVICE_MAPPING)
string(REPLACE ":" ";" dev_map "${dev_map}")
list(GET dev_map 0 mapped_dev_name)
list(GET dev_map 1 actual_dev_name)
# common
set(_IE_CREATE_PLUGIN_FUNC "CreatePluginEngine${actual_dev_name}")
set(_IE_CREATE_EXTENSION_FUNC "CreateExtensionShared${actual_dev_name}")
# declarations
set(IE_PLUGINS_DECLARATIONS "${IE_PLUGINS_DECLARATIONS}
IE_DEFINE_PLUGIN_CREATE_FUNCTION_DECLARATION(${_IE_CREATE_PLUGIN_FUNC});")
if(${actual_dev_name}_AS_EXTENSION)
set(IE_PLUGINS_DECLARATIONS "${IE_PLUGINS_DECLARATIONS}
IE_DEFINE_EXTENSION_CREATE_FUNCTION_DECLARATION(${_IE_CREATE_EXTENSION_FUNC});")
else()
set(_IE_CREATE_EXTENSION_FUNC "nullptr")
endif()
# definitions
set(dev_config "{")
if(${mapped_dev_name}_CONFIG)
@@ -48,11 +34,31 @@ IE_DEFINE_EXTENSION_CREATE_FUNCTION_DECLARATION(${_IE_CREATE_EXTENSION_FUNC});")
endif()
set(dev_config "${dev_config}}")
set(IE_PLUGINS_MAP_DEFINITION "${IE_PLUGINS_MAP_DEFINITION}
{ \"${mapped_dev_name}\", Value { ${_IE_CREATE_PLUGIN_FUNC}, ${_IE_CREATE_EXTENSION_FUNC}, ${dev_config} } },")
if(NOT BUILD_SHARED_LIBS)
# common
set(_OV_CREATE_PLUGIN_FUNC "CreatePluginEngine${actual_dev_name}")
set(_OV_CREATE_EXTENSION_FUNC "CreateExtensionShared${actual_dev_name}")
# declarations
set(OV_PLUGINS_DECLARATIONS "${OV_PLUGINS_DECLARATIONS}
IE_DEFINE_PLUGIN_CREATE_FUNCTION_DECLARATION(${_OV_CREATE_PLUGIN_FUNC});")
if(${actual_dev_name}_AS_EXTENSION)
set(OV_PLUGINS_DECLARATIONS "${OV_PLUGINS_DECLARATIONS}
IE_DEFINE_EXTENSION_CREATE_FUNCTION_DECLARATION(${_OV_CREATE_EXTENSION_FUNC});")
else()
set(_OV_CREATE_EXTENSION_FUNC "nullptr")
endif()
set(OV_PLUGINS_MAP_DEFINITION "${OV_PLUGINS_MAP_DEFINITION}
{ \"${mapped_dev_name}\", Value { ${_OV_CREATE_PLUGIN_FUNC}, ${_OV_CREATE_EXTENSION_FUNC}, ${dev_config} } },")
else()
set(OV_PLUGINS_MAP_DEFINITION "${OV_PLUGINS_MAP_DEFINITION}
{ \"${mapped_dev_name}\", Value { \"${actual_dev_name}\", ${dev_config} } },")
endif()
endforeach()
set(IE_PLUGINS_MAP_DEFINITION "${IE_PLUGINS_MAP_DEFINITION}
set(OV_PLUGINS_MAP_DEFINITION "${OV_PLUGINS_MAP_DEFINITION}
};\n")
configure_file("${IE_PLUGINS_HPP_HEADER_IN}" "${IE_PLUGINS_HPP_HEADER}" @ONLY)
configure_file("${OV_PLUGINS_HPP_HEADER_IN}" "${OV_PLUGINS_HPP_HEADER}" @ONLY)

View File

@@ -49,10 +49,6 @@ function(ie_add_plugin)
# create and configure target
if(NOT IE_PLUGIN_PSEUDO_PLUGIN_FOR)
if(IE_PLUGIN_VERSION_DEFINES_FOR)
addVersionDefines(${IE_PLUGIN_VERSION_DEFINES_FOR} CI_BUILD_NUMBER)
endif()
set(input_files ${IE_PLUGIN_SOURCES})
foreach(obj_lib IN LISTS IE_PLUGIN_OBJECT_LIBRARIES)
list(APPEND input_files $<TARGET_OBJECTS:${obj_lib}>)
@@ -67,6 +63,10 @@ function(ie_add_plugin)
add_library(${IE_PLUGIN_NAME} ${library_type} ${input_files})
if(IE_PLUGIN_VERSION_DEFINES_FOR)
ov_add_version_defines(${IE_PLUGIN_VERSION_DEFINES_FOR} ${IE_PLUGIN_NAME})
endif()
target_compile_definitions(${IE_PLUGIN_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN)
if(NOT BUILD_SHARED_LIBS)
# to distinguish functions creating plugin objects
@@ -113,7 +113,7 @@ function(ie_add_plugin)
if(IE_PLUGIN_PSEUDO_DEVICE)
set(plugin_hidden HIDDEN)
endif()
ie_cpack_add_component(${install_component}
ie_cpack_add_component(${install_component}
DISPLAY_NAME "${IE_PLUGIN_DEVICE_NAME} runtime"
DESCRIPTION "${IE_PLUGIN_DEVICE_NAME} runtime"
${plugin_hidden}
@@ -227,16 +227,18 @@ macro(ie_register_plugins_dynamic)
# Combine all <device_name>.xml files into plugins.xml
add_custom_command(TARGET ${IE_REGISTER_MAIN_TARGET} POST_BUILD
COMMAND
"${CMAKE_COMMAND}"
-D "CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}"
-D "IE_CONFIG_OUTPUT_FILE=${config_output_file}"
-D "IE_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
-P "${IEDevScripts_DIR}/plugins/register_plugin_cmake.cmake"
COMMENT
"Registering plugins to plugins.xml config file"
VERBATIM)
if(ENABLE_PLUGINS_XML)
add_custom_command(TARGET ${IE_REGISTER_MAIN_TARGET} POST_BUILD
COMMAND
"${CMAKE_COMMAND}"
-D "CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}"
-D "IE_CONFIG_OUTPUT_FILE=${config_output_file}"
-D "IE_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
-P "${IEDevScripts_DIR}/plugins/register_plugin_cmake.cmake"
COMMENT
"Registering plugins to plugins.xml config file"
VERBATIM)
endif()
endmacro()
#
@@ -279,13 +281,9 @@ function(ie_target_link_plugins TARGET_NAME)
endfunction()
#
# ie_generate_plugins_hpp()
# ov_generate_plugins_hpp()
#
function(ie_generate_plugins_hpp)
if(BUILD_SHARED_LIBS)
return()
endif()
function(ov_generate_plugins_hpp)
set(device_mapping)
set(device_configs)
set(as_extension)
@@ -296,17 +294,23 @@ function(ie_generate_plugins_hpp)
message(FATAL_ERROR "Unexpected error, please, contact developer of this script")
endif()
# create device mapping: preudo device => actual device
# create device mapping: pseudo device => actual device
list(GET name 0 device_name)
if(${device_name}_PSEUDO_PLUGIN_FOR)
list(APPEND device_mapping "${device_name}:${${device_name}_PSEUDO_PLUGIN_FOR}")
if(BUILD_SHARED_LIBS)
list(GET name 1 library_name)
ie_plugin_get_file_name(${library_name} library_name)
list(APPEND device_mapping "${device_name}:${library_name}")
else()
list(APPEND device_mapping "${device_name}:${device_name}")
endif()
if(${device_name}_PSEUDO_PLUGIN_FOR)
list(APPEND device_mapping "${device_name}:${${device_name}_PSEUDO_PLUGIN_FOR}")
else()
list(APPEND device_mapping "${device_name}:${device_name}")
endif()
# register plugin as extension
if(${device_name}_AS_EXTENSION)
list(APPEND as_extension -D "${device_name}_AS_EXTENSION=ON")
# register plugin as extension
if(${device_name}_AS_EXTENSION)
list(APPEND as_extension -D "${device_name}_AS_EXTENSION=ON")
endif()
endif()
# add default plugin config options
@@ -317,21 +321,22 @@ function(ie_generate_plugins_hpp)
endif()
endforeach()
# add plugins to libraries including ie_plugins.hpp
# add plugins to libraries including ov_plugins.hpp
ie_target_link_plugins(openvino)
if(TARGET inference_engine_s)
ie_target_link_plugins(inference_engine_s)
endif()
set(ie_plugins_hpp "${CMAKE_BINARY_DIR}/src/inference/ie_plugins.hpp")
set(ov_plugins_hpp "${CMAKE_BINARY_DIR}/src/inference/ov_plugins.hpp")
set(plugins_hpp_in "${IEDevScripts_DIR}/plugins/plugins.hpp.in")
add_custom_command(OUTPUT "${ie_plugins_hpp}"
add_custom_command(OUTPUT "${ov_plugins_hpp}"
COMMAND
"${CMAKE_COMMAND}"
-D "IE_DEVICE_MAPPING=${device_mapping}"
-D "IE_PLUGINS_HPP_HEADER_IN=${plugins_hpp_in}"
-D "IE_PLUGINS_HPP_HEADER=${ie_plugins_hpp}"
-D "BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}"
-D "OV_DEVICE_MAPPING=${device_mapping}"
-D "OV_PLUGINS_HPP_HEADER_IN=${plugins_hpp_in}"
-D "OV_PLUGINS_HPP_HEADER=${ov_plugins_hpp}"
${device_configs}
${as_extension}
-P "${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
@@ -339,28 +344,11 @@ function(ie_generate_plugins_hpp)
"${plugins_hpp_in}"
"${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
COMMENT
"Generate ie_plugins.hpp for static build"
"Generate ov_plugins.hpp for build"
VERBATIM)
# for some reason dependency on source files does not work
# so, we have to use explicit target and make it dependency for inference_engine
add_custom_target(_ie_plugins_hpp DEPENDS ${ie_plugins_hpp})
add_dependencies(inference_engine_obj _ie_plugins_hpp)
# add dependency for object files
get_target_property(sources inference_engine_obj SOURCES)
foreach(source IN LISTS sources)
if("${source}" MATCHES "\\$\\<TARGET_OBJECTS\\:([A-Za-z0-9_]*)\\>")
# object library
set(obj_library ${CMAKE_MATCH_1})
get_target_property(obj_sources ${obj_library} SOURCES)
list(APPEND all_sources ${obj_sources})
else()
# usual source
list(APPEND all_sources ${source})
endif()
endforeach()
# add dependency on header file generation for all inference_engine source files
set_source_files_properties(${all_sources} PROPERTIES OBJECT_DEPENDS ${ie_plugins_hpp})
add_custom_target(_ov_plugins_hpp DEPENDS ${ov_plugins_hpp})
add_dependencies(inference_engine_obj _ov_plugins_hpp)
endfunction()

View File

@@ -4,10 +4,14 @@
#pragma once
#include <map>
#include <string>
#ifdef OPENVINO_STATIC_LIBRARY
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
namespace {
@IE_PLUGINS_DECLARATIONS@
@OV_PLUGINS_DECLARATIONS@
struct Value {
InferenceEngine::CreatePluginEngineFunc * m_create_plugin_func;
@@ -15,12 +19,20 @@ struct Value {
std::map<std::string, std::string> m_default_config;
};
#else
struct Value {
std::string m_plugin_path;
std::map<std::string, std::string> m_default_config;
};
#endif
using Key = std::string;
using PluginsStaticRegistry = std::map<Key, Value>;
const std::map<Key, Value> getStaticPluginsRegistry() {
@IE_PLUGINS_MAP_DEFINITION@
inline const std::map<Key, Value> getCompiledPluginsRegistry() {
@OV_PLUGINS_MAP_DEFINITION@
return plugins_hpp;
}
} // namespace

View File

@@ -97,7 +97,11 @@ function(ov_check_pip_packages)
if(PYTHONINTERP_FOUND)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import pkg_resources ; pkg_resources.require(open('${ARG_REQUIREMENTS_FILE}', mode='r'))"
COMMAND ${PYTHON_EXECUTABLE} -c "
from check_python_requirements import check_python_requirements ;
check_python_requirements('${ARG_REQUIREMENTS_FILE}') ;
"
WORKING_DIRECTORY "${IEDevScripts_DIR}"
RESULT_VARIABLE EXIT_CODE
OUTPUT_VARIABLE OUTPUT_TEXT
ERROR_VARIABLE ERROR_TEXT)

View File

@@ -20,7 +20,7 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
set(arch_flag X86_64)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
set(arch_flag X86)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm64.*|aarch64.*|AARCH64.*)")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm64.*|aarch64.*|AARCH64.*|ARM64.*)")
set(arch_flag AARCH64)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
set(arch_flag ARM)
@@ -31,8 +31,8 @@ endif()
set(HOST_${arch_flag} ON)
macro(_ie_process_msvc_generator_platform arch_flag)
# if cmake -A <ARM|ARM64> is passed
if(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
# if cmake -A <ARM|ARM64|x64|Win32> is passed
if(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
set(AARCH64 ON)
elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM")
set(ARM ON)

View File

@@ -185,6 +185,46 @@ macro (addVersionDefines FILE)
unset(__version_file)
endmacro()
macro (ov_add_version_defines FILE TARGET)
set(__version_file ${FILE})
if(NOT IS_ABSOLUTE ${__version_file})
set(__version_file "${CMAKE_CURRENT_SOURCE_DIR}/${__version_file}")
endif()
if(NOT EXISTS ${__version_file})
message(FATAL_ERROR "${FILE} does not exists in current source directory")
endif()
_remove_source_from_target(${TARGET} ${FILE})
_remove_source_from_target(${TARGET} ${__version_file})
if (BUILD_SHARED_LIBS)
add_library(${TARGET}_version OBJECT ${__version_file})
else()
add_library(${TARGET}_version STATIC ${__version_file})
endif()
if(SUGGEST_OVERRIDE_SUPPORTED)
set_source_files_properties(${__version_file}
PROPERTIES COMPILE_OPTIONS -Wno-suggest-override)
endif()
target_compile_definitions(${TARGET}_version PRIVATE
CI_BUILD_NUMBER=\"${CI_BUILD_NUMBER}\"
$<TARGET_PROPERTY:${TARGET},INTERFACE_COMPILE_DEFINITIONS>
$<TARGET_PROPERTY:${TARGET},COMPILE_DEFINITIONS>)
target_include_directories(${TARGET}_version PRIVATE
$<TARGET_PROPERTY:${TARGET},INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>)
target_link_libraries(${TARGET}_version PRIVATE
$<TARGET_PROPERTY:${TARGET},LINK_LIBRARIES>)
target_compile_options(${TARGET}_version PRIVATE
$<TARGET_PROPERTY:${TARGET},INTERFACE_COMPILE_OPTIONS>
$<TARGET_PROPERTY:${TARGET},COMPILE_OPTIONS>)
set_target_properties(${TARGET}_version
PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE
$<TARGET_PROPERTY:${TARGET},INTERPROCEDURAL_OPTIMIZATION_RELEASE>)
target_sources(${TARGET} PRIVATE $<TARGET_OBJECTS:${TARGET}_version>)
unset(__version_file)
endmacro()
function(ov_add_library_version library)
if(NOT DEFINED OpenVINO_SOVERSION)
message(FATAL_ERROR "Internal error: OpenVINO_SOVERSION is not defined")

View File

@@ -169,9 +169,9 @@ ov_generate_dev_package_config()
# with all imported developer targets
register_extra_modules()
# for static libraries case we need to generate final ie_plugins.hpp
# for static libraries case we need to generate final ov_plugins.hpp
# with all the information about plugins
ie_generate_plugins_hpp()
ov_generate_plugins_hpp()
# used for static build
ov_generate_frontends_hpp()

View File

@@ -14,7 +14,13 @@ ie_option (ENABLE_COMPILE_TOOL "Enables compile_tool" ON)
ie_option (ENABLE_STRICT_DEPENDENCIES "Skip configuring \"convinient\" dependencies for efficient parallel builds" ON)
ie_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ON "X86_64;NOT APPLE;NOT MINGW;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF)
if(X86_64)
set(ENABLE_INTEL_GPU_DEFAULT ON)
else()
set(ENABLE_INTEL_GPU_DEFAULT OFF)
endif()
ie_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT MINGW;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF)
if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
# oneDNN doesn't support old compilers and android builds for now, so we'll
@@ -41,8 +47,6 @@ In case SELECTIVE_BUILD is enabled, the SELECTIVE_BUILD_STAT variable should con
Usage: -DSELECTIVE_BUILD=ON -DSELECTIVE_BUILD_STAT=/path/*.csv" OFF
ALLOWED_VALUES ON OFF COLLECT)
ie_option(ENABLE_ERROR_HIGHLIGHT "Highlight errors and warnings during compile time" ON)
ie_option (ENABLE_DOCS "Build docs using Doxygen" OFF)
find_package(PkgConfig QUIET)
@@ -90,6 +94,8 @@ ie_option (ENABLE_HETERO "Enables Hetero Device Plugin" ON)
ie_option (ENABLE_TEMPLATE "Enable template plugin" ON)
ie_dependent_option (ENABLE_PLUGINS_XML "Generate plugins.xml configuration file or not" OFF "NOT BUILD_SHARED_LIBS" OFF)
ie_dependent_option (GAPI_TEST_PERF "if GAPI unit tests should examine performance" OFF "ENABLE_TESTS;ENABLE_GAPI_PREPROCESSING" OFF)
ie_dependent_option (ENABLE_DATA "fetch models from testdata repo" ON "ENABLE_FUNCTIONAL_TESTS;NOT ANDROID" OFF)
@@ -148,13 +154,16 @@ ie_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON)
ie_option(ENABLE_OV_PYTORCH_FRONTEND "Enable PyTorch FrontEnd" ON)
ie_option(ENABLE_OV_TF_FRONTEND "Enable TensorFlow FrontEnd" ON)
ie_option(ENABLE_OV_TF_LITE_FRONTEND "Enable TensorFlow Lite FrontEnd" ON)
ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" OFF
"ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND;BUILD_SHARED_LIBS" OFF)
ie_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON)
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Use system flatbuffers" ON
"ENABLE_OV_TF_LITE_FRONTEND" OFF)
ie_dependent_option(ENABLE_OV_CORE_UNIT_TESTS "Enables OpenVINO core unit tests" ON "ENABLE_TESTS" OFF)
ie_dependent_option(ENABLE_SNAPPY_COMPRESSION "Enables compression support for TF FE" ON
"ENABLE_OV_TF_FRONTEND" ON)
ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Enables use of system protobuf" OFF
"ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND;BUILD_SHARED_LIBS" OFF)
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ON
"ENABLE_OV_TF_LITE_FRONTEND" OFF)
ie_dependent_option(ENABLE_SYSTEM_SNAPPY "Enables use of system version of snappy" OFF "ENABLE_SNAPPY_COMPRESSION;BUILD_SHARED_LIBS" OFF)
ie_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF)
if(NOT BUILD_SHARED_LIBS AND ENABLE_OV_TF_FRONTEND)

View File

@@ -52,6 +52,8 @@ macro(ov_cpack_settings)
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND
# see ticket # 82605
NOT item STREQUAL "gna" AND
# don't install Intel OpenMP during debian
NOT item STREQUAL "omp" AND
# even for case of system TBB we have installation rules for wheels packages
# so, need to skip this explicitly
NOT item MATCHES "^tbb(_dev)?$" AND

View File

@@ -38,6 +38,8 @@ macro(ov_cpack_settings)
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND
# see ticket # 82605
NOT item STREQUAL "gna" AND
# don't install Intel OpenMP during rpm
NOT item STREQUAL "omp" AND
# even for case of system TBB we have installation rules for wheels packages
# so, need to skip this explicitly
NOT item MATCHES "^tbb(_dev)?$" AND

View File

@@ -16,7 +16,8 @@ set(ie_options "@IE_OPTIONS@")
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
CMAKE_CXX_LINKER_LAUNCHER CMAKE_C_LINKER_LAUNCHER
CMAKE_BUILD_TYPE CMAKE_SKIP_RPATH CMAKE_INSTALL_PREFIX
CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET)
CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_CONFIGURATION_TYPES CMAKE_DEFAULT_BUILD_TYPE)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
message(STATUS "The following CMake options are exported from Inference Engine Developer package")

View File

@@ -14,7 +14,8 @@ set(ov_options "@IE_OPTIONS@")
list(APPEND ov_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
CMAKE_CXX_LINKER_LAUNCHER CMAKE_C_LINKER_LAUNCHER
CMAKE_BUILD_TYPE CMAKE_SKIP_RPATH CMAKE_INSTALL_PREFIX
CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET)
CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_CONFIGURATION_TYPES CMAKE_DEFAULT_BUILD_TYPE)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
message(STATUS "The following CMake options are exported from OpenVINO Developer package")
@@ -27,6 +28,9 @@ foreach(option IN LISTS ov_options)
endforeach()
message(" ")
# activate generation of plugins.xml
set(ENABLE_PLUGINS_XML ON)
# for samples in 3rd party projects
if(ENABLE_SAMPLES)
set_and_check(gflags_DIR "@gflags_BINARY_DIR@")

View File

@@ -9,12 +9,9 @@
Run and Deploy Locally <openvino_deployment_guide>
Deploy via Model Serving <ovms_what_is_openvino_model_server>
@endsphinxdirective
Once you have a model that meets both OpenVINO™ and your requirements, you can choose how to deploy it with your application.
@sphinxdirective
.. panels::
:doc:`Deploy via OpenVINO Runtime <openvino_deployment_guide>`
@@ -30,8 +27,7 @@ Once you have a model that meets both OpenVINO™ and your requirements, you can
Deployment via OpenVINO Model Server allows the application to connect to the inference server set up remotely.
This way inference can use external resources instead of those available to the application itself.
@endsphinxdirective
Apart from the default deployment options, you may also :doc:`deploy your application for the TensorFlow framework with OpenVINO Integration <ovtf_integration>`
Apart from the default deployment options, you may also [deploy your application for the TensorFlow framework with OpenVINO Integration](./openvino_ecosystem_ovtf.md).
@endsphinxdirective

View File

@@ -1,15 +0,0 @@
# OpenVINO™ Deep Learning Workbench Overview {#workbench_docs_Workbench_DG_Introduction}
@sphinxdirective
.. toctree::
:maxdepth: 1
:hidden:
workbench_docs_Workbench_DG_Install
workbench_docs_Workbench_DG_Work_with_Models_and_Sample_Datasets
Tutorials <workbench_docs_Workbench_DG_Tutorials>
User Guide <workbench_docs_Workbench_DG_User_Guide>
workbench_docs_Workbench_DG_Troubleshooting
@endsphinxdirective

View File

@@ -10,15 +10,15 @@
openvino_docs_OV_UG_Running_on_multiple_devices
openvino_docs_OV_UG_Hetero_execution
openvino_docs_OV_UG_Automatic_Batching
@endsphinxdirective
OpenVINO Runtime offers multiple inference modes to allow optimum hardware utilization under different conditions. The most basic one is a single-device mode, which defines just one device responsible for the entire inference workload. It supports a range of Intel hardware by means of plugins embedded in the Runtime library, each set up to offer the best possible performance. For a complete list of supported devices and instructions on how to use them, refer to the [guide on inference devices](../OV_Runtime_UG/supported_plugins/Device_Plugins.md).
OpenVINO Runtime offers multiple inference modes to allow optimum hardware utilization under different conditions. The most basic one is a single-device mode, which defines just one device responsible for the entire inference workload. It supports a range of Intel hardware by means of plugins embedded in the Runtime library, each set up to offer the best possible performance. For a complete list of supported devices and instructions on how to use them, refer to the :doc:`guide on inference devices <openvino_docs_OV_UG_Working_with_devices>`.
The remaining modes assume certain levels of automation in selecting devices for inference. Using them in the deployed solution may potentially increase its performance and portability. The automated modes are:
* [Automatic Device Selection (AUTO)](../OV_Runtime_UG/auto_device_selection.md)
* [Multi-Device Execution (MULTI)](../OV_Runtime_UG/multi_device.md)
* [Heterogeneous Execution (HETERO)](../OV_Runtime_UG/hetero_execution.md)
* [Automatic Batching Execution (Auto-batching)](../OV_Runtime_UG/automatic_batching.md)
* :doc:`Automatic Device Selection (AUTO) <openvino_docs_OV_UG_supported_plugins_AUTO>`
* :doc:``Multi-Device Execution (MULTI) <openvino_docs_OV_UG_Running_on_multiple_devices>`
* :doc:`Heterogeneous Execution (HETERO) <openvino_docs_OV_UG_Hetero_execution>`
* :doc:`Automatic Batching Execution (Auto-batching) <openvino_docs_OV_UG_Automatic_Batching>`
@endsphinxdirective

View File

@@ -9,22 +9,23 @@
openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide
omz_tools_downloader
@endsphinxdirective
Every deep learning workflow begins with obtaining a model. You can choose to prepare a custom one, use a ready-made solution and adjust it to your needs, or even download and run a pre-trained network from an online database, such as OpenVINO's :doc:`Open Model Zoo <model_zoo>`.
Every deep learning workflow begins with obtaining a model. You can choose to prepare a custom one, use a ready-made solution and adjust it to your needs, or even download and run a pre-trained network from an online database, such as OpenVINO's [Open Model Zoo](../model_zoo.md).
:doc:`OpenVINO™ supports several model formats <Supported_Model_Formats>` and allows to convert them to it's own, OpenVINO IR, providing a tool dedicated to this task.
[OpenVINO™ supports several model formats](../MO_DG/prepare_model/convert_model/supported_model_formats.md) and allows to convert them to it's own, OpenVINO IR, providing a tool dedicated to this task.
[Model Optimizer](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md) reads the original model and creates the OpenVINO IR model (.xml and .bin files) so that inference can ultimately be performed without delays due to format conversion. Optionally, Model Optimizer can adjust the model to be more suitable for inference, for example, by [alternating input shapes](../MO_DG/prepare_model/convert_model/Converting_Model.md), [embedding preprocessing](../MO_DG/prepare_model/Additional_Optimizations.md) and [cutting training parts off](../MO_DG/prepare_model/convert_model/Cutting_Model.md).
:doc:`Model Optimizer <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` reads the original model and creates the OpenVINO IR model (.xml and .bin files) so that inference can ultimately be performed without delays due to format conversion. Optionally, Model Optimizer can adjust the model to be more suitable for inference, for example, by :doc:`alternating input shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>`, :doc:`embedding preprocessing <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` and :doc:`cutting training parts off <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>`.
The approach to fully convert a model is considered the default choice, as it allows the full extent of OpenVINO features. The OpenVINO IR model format is used by other conversion and preparation tools, such as the Post-Training Optimization Tool, for further optimization of the converted model.
Conversion is not required for ONNX and PaddlePaddle models, as OpenVINO provides C++ and Python APIs for importing them to OpenVINO Runtime directly. It provides a convenient way to quickly switch from framework-based code to OpenVINO-based code in your inference application.
Conversion is not required for ONNX, PaddlePaddle, and TensorFlow models (check :doc:`TensorFlow Frontend Capabilities and Limitations <openvino_docs_MO_DG_TensorFlow_Frontend>`), as OpenVINO provides C++ and Python APIs for importing them to OpenVINO Runtime directly. It provides a convenient way to quickly switch from framework-based code to OpenVINO-based code in your inference application.
This section describes how to obtain and prepare your model for work with OpenVINO to get the best inference results:
* [See the supported formats and how to use them in your project](../MO_DG/prepare_model/convert_model/supported_model_formats.md)
* [Convert different model formats to the OpenVINO IR format](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md).
* [Automate model-related tasks with Model Downloader and additional OMZ Tools](https://docs.openvino.ai/latest/omz_tools_downloader.html).
To begin with, you may want to [browse a database of models for use in your projects](../model_zoo.md).
* :doc:`See the supported formats and how to use them in your project <Supported_Model_Formats>`.
* :doc:`Convert different model formats to the OpenVINO IR format <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`.
* `Automate model-related tasks with Model Downloader and additional OMZ Tools <https://docs.openvino.ai/latest/omz_tools_downloader.html>`__.
To begin with, you may want to :doc:`browse a database of models for use in your projects <model_zoo>`.
@endsphinxdirective

View File

@@ -6,78 +6,103 @@
:maxdepth: 1
:hidden:
ovtf_integration
ote_documentation
ovtf_integration
ovsa_get_started
openvino_inference_engine_tools_compile_tool_README
openvino_docs_tuning_utilities
workbench_docs_Workbench_DG_Introduction
@endsphinxdirective
OpenVINO™ is not just one tool. It is an expansive ecosystem of utilities, providing a comprehensive workflow for deep learning solution development. Learn more about each of them to reach the full potential of OpenVINO™ Toolkit.
### Neural Network Compression Framework (NNCF)
Neural Network Compression Framework (NNCF)
###########################################
A suite of advanced algorithms for Neural Network inference optimization with minimal accuracy drop. NNCF applies quantization, filter pruning, binarization and sparsity algorithms to PyTorch and TensorFlow models during training.
More resources:
* [Documentation](@ref tmo_introduction)
* [GitHub](https://github.com/openvinotoolkit/nncf)
* [PyPI](https://pypi.org/project/nncf/)
### OpenVINO™ Security Add-on
A solution for Model Developers and Independent Software Vendors to use secure packaging and secure model execution.
More resources:
* [documentation](https://docs.openvino.ai/latest/ovsa_get_started.html)
* [GitHub](https://github.com/openvinotoolkit/security_addon)
* :doc:`Documentation <tmo_introduction>`
* `GitHub <https://github.com/openvinotoolkit/nncf>`__
* `PyPI <https://pypi.org/project/nncf/>`__
### OpenVINO™ integration with TensorFlow (OVTF)
A solution empowering TensorFlow developers with OpenVINO's optimization capabilities. With just two lines of code in your application, you can offload inference to OpenVINO, while keeping the TensorFlow API.
OpenVINO™ Training Extensions
#############################
More resources:
* [documentation](https://github.com/openvinotoolkit/openvino_tensorflow)
* [PyPI](https://pypi.org/project/openvino-tensorflow/)
* [GitHub](https://github.com/openvinotoolkit/openvino_tensorflow)
### DL Streamer
A streaming media analytics framework, based on the GStreamer multimedia framework, for creating complex media analytics pipelines.
More resources:
* [documentation on GitHub](https://dlstreamer.github.io/index.html)
* [installation Guide on GitHub](https://github.com/openvinotoolkit/dlstreamer_gst/wiki/Install-Guide)
### DL Workbench
A web-based tool for deploying deep learning models. Built on the core of OpenVINO and equipped with a graphics user interface, DL Workbench is a great way to explore the possibilities of the OpenVINO workflow, import, analyze, optimize, and build your pre-trained models. You can do all that by visiting [Intel® DevCloud for the Edge](https://software.intel.com/content/www/us/en/develop/tools/devcloud.html) and launching DL Workbench on-line.
More resources:
* [documentation](dl_workbench_overview.md)
* [Docker Hub](https://hub.docker.com/r/openvino/workbench)
* [PyPI](https://pypi.org/project/openvino-workbench/)
### OpenVINO™ Training Extensions (OTE)
A convenient environment to train Deep Learning models and convert them using the OpenVINO™ toolkit for optimized inference.
More resources:
* [GitHub](https://github.com/openvinotoolkit/training_extensions)
### Computer Vision Annotation Tool (CVAT)
* :doc:`Overview <ote_documentation>`
* `GitHub <https://github.com/openvinotoolkit/training_extensions>`__
* `Documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/get_started/introduction.html>`__
OpenVINO™ Security Add-on
#########################
A solution for Model Developers and Independent Software Vendors to use secure packaging and secure model execution.
More resources:
* `Documentation <https://docs.openvino.ai/latest/ovsa_get_started.html>`__
* `GitHub <https://github.com/openvinotoolkit/security_addon>`__
OpenVINO™ integration with TensorFlow (OVTF)
############################################
A solution empowering TensorFlow developers with OpenVINO's optimization capabilities. With just two lines of code in your application, you can offload inference to OpenVINO, while keeping the TensorFlow API.
More resources:
* `Documentation <https://github.com/openvinotoolkit/openvino_tensorflow>`__
* `PyPI <https://pypi.org/project/openvino-tensorflow/>`__
* `GitHub <https://github.com/openvinotoolkit/openvino_tensorflow>`__
DL Streamer
###########
A streaming media analytics framework, based on the GStreamer multimedia framework, for creating complex media analytics pipelines.
More resources:
* `Documentation on GitHub <https://dlstreamer.github.io/index.html>`__
* `Installation Guide on GitHub <https://github.com/openvinotoolkit/dlstreamer_gst/wiki/Install-Guide>`__
DL Workbench
############
A web-based tool for deploying deep learning models. Built on the core of OpenVINO and equipped with a graphics user interface, DL Workbench is a great way to explore the possibilities of the OpenVINO workflow, import, analyze, optimize, and build your pre-trained models. You can do all that by visiting `Intel® Developer Cloud <https://software.intel.com/content/www/us/en/develop/tools/devcloud.html>`__ and launching DL Workbench online.
More resources:
* `Documentation <https://docs.openvino.ai/2022.3/workbench_docs_Workbench_DG_Introduction.html>`__
* `Docker Hub <https://hub.docker.com/r/openvino/workbench>`__
* `PyPI <https://pypi.org/project/openvino-workbench/>`__
Computer Vision Annotation Tool (CVAT)
######################################
An online, interactive video and image annotation tool for computer vision purposes.
More resources:
* [documentation on GitHub](https://opencv.github.io/cvat/docs/)
* [web application](https://cvat.org/)
* [Docker Hub](https://hub.docker.com/r/openvino/cvat_server)
* [GitHub](https://github.com/openvinotoolkit/cvat)
### Dataset Management Framework (Datumaro)
* `Documentation on GitHub <https://opencv.github.io/cvat/docs/>`__
* `Web application <https://www.cvat.ai/>`__
* `Docker Hub <https://hub.docker.com/r/openvino/cvat_server>`__
* `GitHub <https://github.com/openvinotoolkit/cvat>`__
Dataset Management Framework (Datumaro)
#######################################
A framework and CLI tool to build, transform, and analyze datasets.
More resources:
* [documentation on GitHub](https://openvinotoolkit.github.io/datumaro/docs/)
* [PyPI](https://pypi.org/project/datumaro/)
* [GitHub](https://github.com/openvinotoolkit/datumaro)
* `Documentation on GitHub <https://openvinotoolkit.github.io/datumaro/docs/>`__
* `PyPI <https://pypi.org/project/datumaro/>`__
* `GitHub <https://github.com/openvinotoolkit/datumaro>`__
@endsphinxdirective

View File

@@ -1,42 +1,55 @@
# OpenVINO™ integration with TensorFlow {#ovtf_integration}
@sphinxdirective
**OpenVINO™ integration with TensorFlow** is a solution for TensorFlow developers who want to get started with OpenVINO™ in their inferencing applications. By adding just two lines of code you can now take advantage of OpenVINO™ toolkit optimizations with TensorFlow inference applications across a range of Intel® computation devices.
This is all you need:
```bash
import openvino_tensorflow
openvino_tensorflow.set_backend('<backend_name>')
```
.. code-block:: bash
import openvino_tensorflow
openvino_tensorflow.set_backend('<backend_name>')
**OpenVINO™ integration with TensorFlow** accelerates inference across many AI models on a variety of Intel® technologies, such as:
- Intel® CPUs
- Intel® integrated GPUs
> **NOTE**: For maximum performance, efficiency, tooling customization, and hardware control, we recommend developers to adopt native OpenVINO™ solutions.
To find out more about the product itself, as well as learn how to use it in your project, check its dedicated [GitHub repository](https://github.com/openvinotoolkit/openvino_tensorflow/tree/master/docs).
* Intel® CPUs
* Intel® integrated GPUs
.. note::
For maximum performance, efficiency, tooling customization, and hardware control, we recommend developers to adopt native OpenVINO™ solutions.
To find out more about the product itself, as well as learn how to use it in your project, check its dedicated `GitHub repository <https://github.com/openvinotoolkit/openvino_tensorflow/tree/master/docs>`__.
To see what you can do with **OpenVINO™ integration with TensorFlow**, explore the demos located in the [examples folder](https://github.com/openvinotoolkit/openvino_tensorflow/tree/master/examples) in our GitHub repository.
To see what you can do with **OpenVINO™ integration with TensorFlow**, explore the demos located in the `examples folder <https://github.com/openvinotoolkit/openvino_tensorflow/tree/master/examples>`__ in our GitHub repository.
Sample tutorials are also hosted on [Intel® DevCloud](https://www.intel.com/content/www/us/en/developer/tools/devcloud/edge/build/ovtfoverview.html). The demo applications are implemented using Jupyter Notebooks. You can interactively execute them on Intel® DevCloud nodes, compare the results of **OpenVINO™ integration with TensorFlow**, native TensorFlow, and OpenVINO™.
Sample tutorials are also hosted on `Intel® DevCloud <https://www.intel.com/content/www/us/en/developer/tools/devcloud/edge/build/ovtfoverview.html>`__. The demo applications are implemented using Jupyter Notebooks. You can interactively execute them on Intel® DevCloud nodes, compare the results of **OpenVINO™ integration with TensorFlow**, native TensorFlow, and OpenVINO™.
## License
**OpenVINO™ integration with TensorFlow** is licensed under [Apache License Version 2.0](https://github.com/openvinotoolkit/openvino_tensorflow/blob/master/LICENSE).
License
#######
**OpenVINO™ integration with TensorFlow** is licensed under `Apache License Version 2.0 <https://github.com/openvinotoolkit/openvino_tensorflow/blob/master/LICENSE>`__.
By contributing to the project, you agree to the license and copyright terms therein
and release your contribution under these terms.
## Support
Support
#######
Submit your questions, feature requests and bug reports via [GitHub issues](https://github.com/openvinotoolkit/openvino_tensorflow/issues).
Submit your questions, feature requests and bug reports via `GitHub issues <https://github.com/openvinotoolkit/openvino_tensorflow/issues>`__.
## How to Contribute
How to Contribute
#################
We welcome community contributions to **OpenVINO™ integration with TensorFlow**. If you have an idea for improvement:
* Share your proposal via [GitHub issues](https://github.com/openvinotoolkit/openvino_tensorflow/issues).
* Submit a [pull request](https://github.com/openvinotoolkit/openvino_tensorflow/pulls).
* Share your proposal via `GitHub issues <https://github.com/openvinotoolkit/openvino_tensorflow/issues>`__.
* Submit a `pull request <https://github.com/openvinotoolkit/openvino_tensorflow/pulls>`__.
We will review your contribution as soon as possible. If any additional fixes or modifications are necessary, we will guide you and provide feedback. Before you make your contribution, make sure you can build **OpenVINO™ integration with TensorFlow** and run all the examples with your fix/patch. If you want to introduce a large feature, create test cases for your feature. Upon our verification of your pull request, we will merge it to the repository provided that the pull request has met the above mentioned requirements and proved acceptable.
---
\* Other names and brands may be claimed as the property of others.
\* Other names and brands may be claimed as the property of others.
@endsphinxdirective

View File

@@ -0,0 +1,40 @@
# OpenVINO™ Training Extensions {#ote_documentation}
@sphinxdirective
OpenVINO™ Training Extensions provide a suite of advanced algorithms to train
Deep Learning models and convert them using the `OpenVINO™
toolkit <https://software.intel.com/en-us/openvino-toolkit>`__ for optimized
inference. It allows you to export and convert the models to the needed format. OpenVINO Training Extensions independently create and train the model. It is open-sourced and available on `GitHub <https://github.com/openvinotoolkit/training_extensions>`__. Read the OpenVINO Training Extensions `documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/get_started/introduction.html>`__ to learn more.
Detailed Workflow
#################
.. image:: ./_static/images/training_extensions_framework.png
1. To start working with OpenVINO Training Extensions, prepare and annotate your dataset. For example, on CVAT.
2. OpenVINO Training Extensions train the model, using training interface, and evaluate the model quality on your dataset, using evaluation and inference interfaces.
.. note::
Prepare a separate dataset or split the dataset you have for more accurate quality evaluation.
3. Having successful evaluation results received, you have an opportunity to deploy your model or continue optimizing it, using NNCF and POT. For more information about these frameworks, go to :doc:`Optimization Guide <openvino_docs_model_optimization_guide>`.
If the results are unsatisfactory, add datasets and perform the same steps, starting with dataset annotation.
OpenVINO Training Extensions Components
#######################################
- `OpenVINO Training Extensions SDK <https://github.com/openvinotoolkit/training_extensions/tree/master/ote_sdk>`__
- `OpenVINO Training Extensions CLI <https://github.com/openvinotoolkit/training_extensions/tree/master/ote_cli>`__
- `OpenVINO Training Extensions Algorithms <https://github.com/openvinotoolkit/training_extensions/tree/master/external>`__
Tutorials
#########
`Object Detection <https://github.com/openvinotoolkit/training_extensions/blob/master/ote_cli/notebooks/train.ipynb>`__
@endsphinxdirective

View File

@@ -1002,7 +1002,6 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \
ie_api::BlobBuffer \
*impl* \
*device_name* \
*num_requests* \
*exec_net* \
*c_config* \
*ie_core_impl* \

View File

@@ -1,237 +1,353 @@
# How to Implement Custom GPU Operations {#openvino_docs_Extensibility_UG_GPU}
@sphinxdirective
To enable operations not supported by OpenVINO™ out of the box, you may need an extension for OpenVINO operation set, and a custom kernel for the device you will target. This article 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 automatically-loaded `<lib_path>/cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml` file.
* Call the `ov::Core::set_property()` method from your application with the `"CONFIG_FILE"` key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
@sphinxtabset
* Include a section with your kernels into the automatically-loaded ``<lib_path>/cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml`` file.
* Call the ``:ref:`ov::Core::set_property() <doxid-classov_1_1_core_1aa953cb0a1601dbc9a34ef6ba82b8476e>``` method from your application with the ``"CONFIG_FILE"`` key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
@sphinxtab{C++}
@snippet docs/snippets/gpu/custom_kernels_api.cpp part0
@endsphinxtab
.. tab-set::
@sphinxtab{Python}
@snippet docs/snippets/gpu/custom_kernels_api.py part0
@endsphinxtab
.. tab-item:: C++
.. doxygensnippet:: docs/snippets/gpu/custom_kernels_api.cpp
:language: cpp
:fragment: [part0]
@endsphinxtabset
.. tab-item:: Python
.. doxygensnippet:: docs/snippets/gpu/custom_kernels_api.py
:language: python
:fragment: [part0]
All OpenVINO 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>
All OpenVINO 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:
The configuration file is expected to follow the `.xml` file structure
with a node of the type `CustomLayer` for every custom operation you provide.
.. code-block:: cpp
$ ./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
.. _config-file-format:
Configuration File Format
#########################
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
.. list-table::
:header-rows: 1
### CustomLayer Node and Sub-Node Structure
* - 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
The `CustomLayer` node contains the entire configuration for a single custom operation.
CustomLayer Node and Sub-Node Structure
+++++++++++++++++++++++++++++++++++++++
| 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 OpenVINO IR.|
| `type` | (1) | Must be `SimpleGPU`. |
| `version` | (1) | Must be `1`. |
The ``CustomLayer`` node contains the entire configuration for a single custom operation.
**Sub-nodes**: `Kernel` (1), `Buffers` (1), `CompilerOptions` (0+),
`WorkSizes` (0/1)
.. list-table::
:header-rows: 1
### Kernel Node and Sub-Node Structure
* - 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`` .
The `Kernel` node contains all kernel source code configuration.
**Sub-nodes**: ``Kernel`` (1), ``Buffers`` (1), ``CompilerOptions`` (0+),
``WorkSizes`` (0/1)
**Sub-nodes**: `Source` (1+), `Define` (0+)
Kernel Node and Sub-Node Structure
++++++++++++++++++++++++++++++++++
### Source Node and Sub-Node Structure
The ``Kernel`` node contains all kernel source code configuration.
The `Source` node points to a single OpenCL source file.
**Sub-nodes**: ``Source`` (1+), ``Define`` (0+)
| Attribute Name | \# |Description|
|-----|-----|-----|
| `filename` | (1) | Name of the file containing OpenCL source code. The path is relative to your executable. Multiple source nodes will have their sources concatenated in order. |
Source Node and Sub-Node Structure
++++++++++++++++++++++++++++++++++
The ``Source`` node points to a single OpenCL source file.
.. list-table::
:header-rows: 1
* - Attribute Name
- #
- Description
* - ``filename``
- (1)
- Name of the file containing OpenCL source code. 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 and Sub-Node Structure
++++++++++++++++++++++++++++++++++
The `Define` node configures a single `#&zwj;define` instruction to be added to
The ``Define`` node configures a single ``#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 OpenVINO IR. |
.. list-table::
:header-rows: 1
* - 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 OpenVINO IR.
**Sub-nodes:** None
The resulting JIT has the following form:
`#&zwj;define [name] [type] [value/default]`.
``#define [name] [type] [value/default]``.
### Buffers Node and Sub-Node Structure
Buffers Node and Sub-Node Structure
+++++++++++++++++++++++++++++++++++
The `Buffers` node configures all input/output buffers for the OpenCL entry
The ``Buffers`` node configures all input/output buffers for the OpenCL entry
function. No buffers node structure exists.
**Sub-nodes:** `Data` (0+), `Tensor` (1+)
**Sub-nodes:** ``Data`` (0+), ``Tensor`` (1+)
### Data Node and Sub-Node Structure
Data Node and Sub-Node Structure
++++++++++++++++++++++++++++++++
The `Data` node configures a single input with static data, for example,
The ``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 OpenVINO IR. |
| `arg-index` | (1) | 0-based index in the entry function arguments to be bound to. |
.. list-table::
:header-rows: 1
* - Attribute Name
- #
- Description
* - ``name``
- (1)
- Name of a blob attached to an operation in the OpenVINO 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 and Sub-Node Structure
++++++++++++++++++++++++++++++++++
The `Tensor` node configures a single input or output tensor.
The ``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 OpenVINO IR |
| `format` | (0/1) | Data layout declaration for the tensor. Accepted values: `BFYX`, `BYXF`, `YXFB`, `FYXB`(also in lowercase). The default value: `BFYX` |
.. list-table::
:header-rows: 1
### CompilerOptions Node and Sub-Node Structure
* - 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 OpenVINO 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``.
The `CompilerOptions` node configures the compilation flags for the OpenCL
CompilerOptions Node and Sub-Node Structure
+++++++++++++++++++++++++++++++++++++++++++
The ``CompilerOptions`` node configures the compilation flags for the OpenCL
sources.
| Attribute Name | \# | Description |
|--------|-----|------|
| `options` | (1) | Options string to be passed to the OpenCL compiler |
.. list-table::
:header-rows: 1
* - 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 and Sub-Node Structure
+++++++++++++++++++++++++++++++++++++
The `WorkSizes` node configures the global/local work sizes to be used when
The ``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. The default value: `output` |
.. list-table::
:header-rows: 1
* - Attribute Name
- #
- Description
* - ``global`` ``local``
- (0/1) (0/1)
- An array of up to three integers or formulas for defining OpenCL work-sizes to be used during execution. The formulas can use the values of the B,F,Y,X dimensions and contain the operators: +,-,/,\*,%. All operators are evaluated in integer arithmetic. 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
Example Configuration File
##########################
The following code sample provides an example configuration file in XML
format. For information on the configuration file structure, see the
[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>
```
format. For information on the configuration file structure, see the `Configuration File Format <#config-file-format>`__.
## Built-In Definitions for Custom Layers
.. code-block:: cpp
<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.
For an example, see [Example Kernel](#example-kernel).
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_<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 offset (in 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. |
.. list-table::
:header-rows: 1
All `<TENSOR>` values are automatically defined for every tensor
bound to this operation, such as `INPUT0`, `INPUT1`, and `OUTPUT0`, as shown
* - 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_<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 ``#ifdef/#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 offset (in 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:
```c
#define INPUT0_DIMS_SIZE 4
#define INPUT0_DIMS (int []){ 1,96,55,55, }
```
.. code-block:: c
## Example Kernel<a name="example-kernel"></a>
#define INPUT0_DIMS_SIZE 4
#define INPUT0_DIMS (int []){ 1,96,55,55, }
```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;
.. _example-kernel:
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;
}
```
Example Kernel
##############
.. code-block:: c
> **NOTE**: As described in the previous section, all items such as the
> `INPUT0_TYPE` are actually defined as OpenCL (pre-)compiler inputs by
> OpenVINO for efficiency reasons. See the [Debugging
> Tips](#debugging-tips) below for information on debugging the results.
#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;
## Debugging Tips<a name="debugging-tips"></a>
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;
}
**Using `printf` in the OpenCL™ Kernels**.
To debug the specific values, use `printf` in your kernels.
.. _debugging-tips:
.. note::
As described in the previous section, all items such as the ``INPUT0_TYPE`` are actually defined as OpenCL (pre-)compiler inputs by OpenVINO for efficiency reasons. See the `Debugging Tips <#debugging-tips>`__ below for information on debugging the results.
Debugging Tips
##############
**Using ``printf`` in the OpenCL™ Kernels**.
To debug the specific values, use ``printf`` in your kernels.
However, be careful not to output excessively, which
could generate too much data. The `printf` output is typical, so
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>
execution ends.
For more information, refer to the [printf Function](https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/printfFunction.html).
For more information, refer to the `printf Function <https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/printfFunction.html>`__.
@endsphinxdirective

View File

@@ -18,12 +18,9 @@
openvino_docs_transformations
OpenVINO Plugin Developer Guide <openvino_docs_ie_plugin_dg_overview>
@endsphinxdirective
The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with various frameworks, including
TensorFlow, PyTorch, ONNX, PaddlePaddle, Apache MXNet, Caffe, and Kaldi. The list of supported operations 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).
each of the supported frameworks. To see the operations supported by your framework, refer to :doc:`Supported Framework Operations <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>`.
Custom operations, which are not included in the list, are not recognized by OpenVINO out-of-the-box. The need for custom operation may appear in two cases:
@@ -35,31 +32,33 @@ Importing models with such operations requires additional steps. This guide illu
Defining a new custom operation basically consists of two parts:
1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). The implementation of execution kernels for [GPU](./GPU_Extensibility.md) is described in separate guides.
1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). The implementation of execution kernels for :doc:`GPU <openvino_docs_Extensibility_UG_GPU>` is described in separate guides.
2. Mapping rule that facilitates conversion of framework operation representation to OpenVINO defined operation semantics.
The first part is required for inference. The second part is required for successful import of a model containing such operations from the original framework model format. There are several options to implement each part. The following sections will describe them in detail.
## Definition of Operation Semantics
Definition of Operation Semantics
#################################
If the custom operation can be mathematically represented as a combination of exiting OpenVINO operations and such decomposition gives desired performance, then low-level operation implementation is not required. Refer to the latest OpenVINO operation set, when deciding feasibility of such decomposition. You can use any valid combination of exiting operations. The next section of this document describes the way to map a custom operation.
If such decomposition is not possible or appears too bulky with a large number of constituent operations that do not perform well, then a new class for the custom operation should be implemented, as described in the [Custom Operation Guide](add_openvino_ops.md).
If such decomposition is not possible or appears too bulky with a large number of constituent operations that do not perform well, then a new class for the custom operation should be implemented, as described in the :doc:`Custom Operation Guide <openvino_docs_Extensibility_UG_add_openvino_ops>`.
You might prefer implementing a custom operation class if you already have a generic C++ implementation of operation kernel. Otherwise, try to decompose the operation first, as described above. Then, after verifying correctness of inference and resulting performance, you may move on to optional implementation of Bare Metal C++.
## Mapping from Framework Operation
Mapping from Framework Operation
################################
Mapping of custom operation is implemented differently, depending on model format used for import. You may choose one of the following:
1. If a model is represented in the ONNX (including models exported from Pytorch in ONNX) or PaddlePaddle formats, then one of the classes from [Frontend Extension API](frontend_extensions.md) should be used. It consists of several classes available in C++ which can be used with the `--extensions` option in Model Optimizer or when a model is imported directly to OpenVINO runtime using the `read_model` method. Python API is also available for runtime model import.
1. If a model is represented in the ONNX (including models exported from Pytorch in ONNX), PaddlePaddle or TensorFlow formats, then one of the classes from :doc:`Frontend Extension API <openvino_docs_Extensibility_UG_Frontend_Extensions>` should be used. It consists of several classes available in C++ which can be used with the ``--extensions`` option in Model Optimizer or when a model is imported directly to OpenVINO runtime using the ``read_model`` method. Python API is also available for runtime model import.
2. If a model is represented in the TensorFlow, Caffe, Kaldi or MXNet formats, then [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) should be used. This approach is available for model conversion in Model Optimizer only.
2. If a model is represented in the Caffe, Kaldi or MXNet formats, then :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` should be used. This approach is available for model conversion in Model Optimizer only.
Existing of two approaches simultaneously is explained by two different types of frontends used for model conversion in OpenVINO: new frontends (ONNX, PaddlePaddle) and legacy frontends (TensorFlow, Caffe, Kaldi and Apache MXNet). Model Optimizer can use both front-ends in contrast to the direct import of model with `read_model` method which can use new frontends only. Follow one of the appropriate guides referenced above to implement mappings depending on framework frontend.
Existing of two approaches simultaneously is explained by two different types of frontends used for model conversion in OpenVINO: new frontends (ONNX, PaddlePaddle and TensorFlow) and legacy frontends (Caffe, Kaldi and Apache MXNet). Model Optimizer can use both front-ends in contrast to the direct import of model with ``read_model`` method which can use new frontends only. Follow one of the appropriate guides referenced above to implement mappings depending on framework frontend.
If you are implementing extensions for new ONNX or PaddlePaddle frontends and plan to use the `--extensions` option in Model Optimizer for model conversion, then the extensions should be:
If you are implementing extensions for new ONNX, PaddlePaddle or TensorFlow frontends and plan to use the ``--extensions`` option in Model Optimizer for model conversion, then the extensions should be:
1. Implemented in C++ only.
@@ -69,109 +68,123 @@ Model Optimizer does not support new frontend extensions written in Python API.
Remaining part of this guide describes application of Frontend Extension API for new frontends.
## Registering Extensions
Registering Extensions
######################
A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.
> **NOTE**: This documentation is derived from the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new), which demonstrates the details of extension development. It is based on minimalistic `Identity` operation that is a placeholder for your real custom operation. Review the complete, fully compilable code to see how it works.
.. note::
This documentation is derived from the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__, which demonstrates the details of extension development. It is based on minimalistic ``Identity`` operation that is a placeholder for your real custom operation. Review the complete, fully compilable code to see how it works.
Use the `ov::Core::add_extension` method to load the extensions to the `ov::Core` object. This method allows loading library with extensions or extensions from the code.
Use the ``:ref:`ov::Core::add_extension <doxid-classov_1_1_core_1a68d0dea1cbcd42a67bea32780e32acea>``` method to load the extensions to the ``:ref:`ov::Core <doxid-classov_1_1_core>``` object. This method allows loading library with extensions or extensions from the code.
### Load Extensions to Core
Load Extensions to Core
+++++++++++++++++++++++
Extensions can be loaded from a code with the `ov::Core::add_extension` method:
Extensions can be loaded from a code with the ``:ref:`ov::Core::add_extension <doxid-classov_1_1_core_1a68d0dea1cbcd42a67bea32780e32acea>``` method:
@sphinxtabset
.. tab-set::
@sphinxtab{C++}
@snippet docs/snippets/ov_extensions.cpp add_extension
@endsphinxtab
@sphinxtab{Python}
@snippet docs/snippets/ov_extensions.py add_extension
@endsphinxtab
@endsphinxtabset
The `Identity` is a custom operation class defined in [Custom Operation Guide](add_openvino_ops.md). This is sufficient to enable reading OpenVINO IR which uses the `Identity` extension operation emitted by Model Optimizer. In order to load original model directly to the runtime, add a mapping extension:
@sphinxdirective
.. tab:: C++
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: add_frontend_extension
.. tab:: Python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: add_frontend_extension
@endsphinxdirective
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [add_extension]
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [add_extension]
The ``Identity`` is a custom operation class defined in :doc:`Custom Operation Guide <openvino_docs_Extensibility_UG_add_openvino_ops>`. This is sufficient to enable reading OpenVINO IR which uses the ``Identity`` extension operation emitted by Model Optimizer. In order to load original model directly to the runtime, add a mapping extension:
.. tab-set::
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [add_frontend_extension]
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [add_frontend_extension]
When Python API is used, there is no way to implement a custom OpenVINO operation. Even if custom OpenVINO operation is implemented in C++ and loaded into the runtime by a shared library, there is still no way to add a frontend mapping extension that refers to this custom operation. In this case, use C++ shared library approach to implement both operations semantics and framework mapping.
Python can still be used to map and decompose operations when only operations from the standard OpenVINO operation set are used.
### Create a Library with Extensions
Create a Library with Extensions
++++++++++++++++++++++++++++++++
An extension library should be created in the following cases:
- Conversion of a model with custom operations in Model Optimizer.
- Loading a model with custom operations in a Python application. This applies to both framework model and OpenVINO IR.
- Loading models with custom operations in tools that support loading extensions from a library, for example the `benchmark_app`.
* Conversion of a model with custom operations in Model Optimizer.
* Loading a model with custom operations in a Python application. This applies to both framework model and OpenVINO IR.
* Loading models with custom operations in tools that support loading extensions from a library, for example the ``benchmark_app``.
To create an extension library, for example, to load the extensions into Model Optimizer, perform the following:
1. Create an entry point for extension library. OpenVINO provides the `OPENVINO_CREATE_EXTENSIONS()` macro, which allows to define an entry point to a library with OpenVINO Extensions.
1. Create an entry point for extension library. OpenVINO provides the ``:ref:`OPENVINO_CREATE_EXTENSIONS() <doxid-core_2include_2openvino_2core_2extension_8hpp_1acdadcfa0eff763d8b4dadb8a9cb6f6e6>``` macro, which allows to define an entry point to a library with OpenVINO Extensions.
This macro should have a vector of all OpenVINO Extensions as an argument.
Based on that, the declaration of an extension class might look like the following:
@snippet template_extension/new/ov_extension.cpp ov_extension:entry_point
.. doxygensnippet:: ./src/core/template_extension/new/ov_extension.cpp
:language: cpp
:fragment: [ov_extension:entry_point]
2. Configure the build of your extension library, using the following CMake script:
@snippet template_extension/new/CMakeLists.txt cmake:extension
.. doxygensnippet:: ./src/core/template_extension/new/CMakeLists.txt
:language: cpp
:fragment: [cmake:extension]
This CMake script finds OpenVINO, using the `find_package` CMake command.
This CMake script finds OpenVINO, using the ``find_package`` CMake command.
3. Build the extension library, running the commands below:
```sh
$ cd src/core/template_extension/new
$ mkdir build
$ cd build
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
$ cmake --build .
```
.. code-block:: sh
$ cd src/core/template_extension/new
$ mkdir build
$ cd build
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
$ cmake --build .
4. After the build, you may use the path to your extension library to load your extensions to OpenVINO Runtime:
@sphinxtabset
.. tab-set::
.. tab-item:: C++
:sync: cpp
@sphinxtab{C++}
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [add_extension_lib]
@snippet docs/snippets/ov_extensions.cpp add_extension_lib
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [add_extension_lib]
@endsphinxtab
@sphinxtab{Python}
See Also
########
@snippet docs/snippets/ov_extensions.py add_extension_lib
* :doc:`OpenVINO Transformations <openvino_docs_transformations>`
* :doc:`Using OpenVINO Runtime Samples <openvino_docs_OV_UG_Samples_Overview>`
* :doc:`Hello Shape Infer SSD sample <openvino_inference_engine_samples_hello_reshape_ssd_README>`
@endsphinxtab
@endsphinxtabset
## See Also
* [OpenVINO Transformations](./ov_transformations.md)
* [Using OpenVINO Runtime Samples](../OV_Runtime_UG/Samples_Overview.md)
* [Hello Shape Infer SSD sample](../../samples/cpp/hello_reshape_ssd/README.md)
@endsphinxdirective

View File

@@ -1,59 +1,81 @@
# 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. This capability requires writing code in C++, so if you are using Python to develop your application you need to build a separate shared library implemented in C++ first and load it in Python using `add_extension` API. Please refer to [Create library with extensions](Intro.md#create-library-with-extensions) for more details on library creation and usage. The remining part of this document describes how to implement an operation class.
@sphinxdirective
## Operation Class
OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box. This capability requires writing code in C++, so if you are using Python to develop your application you need to build a separate shared library implemented in C++ first and load it in Python using ``add_extension`` API. Please refer to :ref:`Create library with extensions <create_library_with_extensions>` for more details on library creation and usage. The remining part of this document describes how to implement an 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:
Operation Class
###############
@snippet template_extension/new/identity.hpp op:common_include
To add your custom operation, create a new class that extends ``ov::Op``, which is in turn derived from ``:ref:`ov::Node <doxid-classov_1_1_node>```, the base class for all graph operations in OpenVINO™. To add ``ov::Op``, include the next file:
.. doxygensnippet:: ./src/core/template_extension/new/identity.hpp
:language: cpp
:fragment: [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.
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`.
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 ``:ref:`ov::Node <doxid-classov_1_1_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.
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.
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 allows to get information about availability of `evaluate` method for the operation.
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 allows to get information about availability of ``evaluate`` method for the operation.
Based on that, declaration of an operation class can look as follows:
### Operation Constructors
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
.. doxygensnippet:: ./src/core/template_extension/new/identity.cpp
:language: cpp
:fragment: [op:ctor]
### `validate_and_infer_types()`
``validate_and_infer_types()``
++++++++++++++++++++++++++++++
`ov::Node::validate_and_infer_types` method validates operation attributes and calculates output shapes using attributes of the operation.
``:ref:`ov::Node::validate_and_infer_types <doxid-classov_1_1_node_1ac5224b5be848ec670d2078d9816d12e7>``` method validates operation attributes and calculates output shapes using attributes of the operation.
@snippet template_extension/new/identity.cpp op:validate
.. doxygensnippet:: ./src/core/template_extension/new/identity.cpp
:language: cpp
:fragment: [op:validate]
### `clone_with_new_inputs()`
``clone_with_new_inputs()``
+++++++++++++++++++++++++++
`ov::Node::clone_with_new_inputs` method creates a copy of the operation with new inputs.
``:ref:`ov::Node::clone_with_new_inputs <doxid-classov_1_1_node_1a04cb103fa069c3b7944ab7c44d94f5ff>``` method creates a copy of the operation with new inputs.
@snippet template_extension/new/identity.cpp op:copy
.. doxygensnippet:: ./src/core/template_extension/new/identity.cpp
:language: cpp
:fragment: [op:copy]
### `visit_attributes()`
``visit_attributes()``
++++++++++++++++++++++
`ov::Node::visit_attributes` method enables you to visit all operation attributes.
``:ref:`ov::Node::visit_attributes <doxid-classov_1_1_node_1a9743b56d352970486d17dae2416d958e>``` method enables you to visit all operation attributes.
@snippet template_extension/new/identity.cpp op:visit_attributes
.. doxygensnippet:: ./src/core/template_extension/new/identity.cpp
:language: cpp
:fragment: [op:visit_attributes]
### evaluate() and has_evaluate()
``evaluate() and has_evaluate()``
+++++++++++++++++++++++++++++++++
`ov::Node::evaluate` method enables you to apply constant folding to an operation.
``:ref:`ov::Node::evaluate <doxid-classov_1_1_node_1acfb82acc8349d7138aeaa05217c7014e>``` method enables you to apply constant folding to an operation.
@snippet template_extension/new/identity.cpp op:evaluate
.. doxygensnippet:: ./src/core/template_extension/new/identity.cpp
:language: cpp
:fragment: [op:evaluate]
@endsphinxdirective

View File

@@ -1,14 +1,18 @@
# Frontend Extensions {#openvino_docs_Extensibility_UG_Frontend_Extensions}
The goal of this chapter is to explain how to use Frontend extension classes to facilitate mapping of custom operations from framework model representation to OpenVINO representation. Refer to [Introduction to OpenVINO Extension](Intro.md) to understand entire flow.
@sphinxdirective
This API is applicable for new frontends only, which exist for ONNX and PaddlePaddle. If a different model format is used, follow legacy [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) guide.
The goal of this chapter is to explain how to use Frontend extension classes to facilitate mapping of custom operations from framework model representation to OpenVINO representation. Refer to :doc:`Introduction to OpenVINO Extension <openvino_docs_Extensibility_UG_Intro>` to understand entire flow.
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
This API is applicable for new frontends only, which exist for ONNX, PaddlePaddle and TensorFlow. If a different model format is used, follow legacy :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` guide.
## Single Operation Mapping with OpExtension
.. note::
This documentation is written based on the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__, which demonstrates extension development details based on minimalistic ``Identity`` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
This section covers the case when a single operation in framework representation is mapped to a single operation in OpenVINO representation. This is called *one-to-one mapping*. There is `OpExtension` class that works well if all the following conditions are satisfied:
Single Operation Mapping with OpExtension
#########################################
This section covers the case when a single operation in framework representation is mapped to a single operation in OpenVINO representation. This is called *one-to-one mapping*. There is ``OpExtension`` class that works well if all the following conditions are satisfied:
1. Number of inputs to operation in the Framework representation is the same as in the OpenVINO representation.
@@ -20,63 +24,87 @@ This section covers the case when a single operation in framework representation
5. Each attribute in OpenVINO operation can be initialized from one of the attributes of original operation or by some predefined constant value. Value of copied attributes cannot contain expressions, value is accepted as-is, so type of a value should be compatible.
> **NOTE**: `OpExtension` class is currently available for ONNX frontend only. PaddlePaddle frontend has named inputs and outputs for operation (not indexed) therefore OpExtension mapping is not applicable for this case.
.. note::
``OpExtension`` class is currently available for ONNX and TensorFlow frontends. PaddlePaddle frontend has named inputs and outputs for operation (not indexed) therefore OpExtension mapping is not applicable for this case.
The next example maps ONNX operation with type [Identity]( https://github.com/onnx/onnx/blob/main/docs/Operators.md#Identity) to OpenVINO template extension `Identity` class.
The next example maps ONNX operation with type `Identity <https://github.com/onnx/onnx/blob/main/docs/Operators.md#Identity>`__ to OpenVINO template extension ``Identity`` class.
@snippet ov_extensions.cpp frontend_extension_Identity_header
@snippet ov_extensions.cpp frontend_extension_Identity
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_Identity_header]
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_Identity]
The mapping doesnt involve any attributes, as operation Identity doesnt have them.
Extension objects, like just constructed `extension` can be used to add to the OpenVINO runtime just before the loading a model that contains custom operations:
Extension objects, like just constructed ``extension`` can be used to add to the OpenVINO runtime just before the loading a model that contains custom operations:
@snippet ov_extensions.cpp frontend_extension_read_model
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_read_model]
Or extensions can be constructed in a separately compiled shared library. Separately compiled library can be used in Model Optimizer or `benchmark_app`. Read about how to build and load such library in chapter “Create library with extensions” in [Introduction to OpenVINO Extension](Intro.md).
Or extensions can be constructed in a separately compiled shared library. Separately compiled library can be used in Model Optimizer or ``benchmark_app``. Read about how to build and load such library in chapter “Create library with extensions” in :doc:`Introduction to OpenVINO Extension <openvino_docs_Extensibility_UG_Intro>`.
If operation have multiple inputs and/or outputs they will be mapped in order. The type of elements in input/output tensors should match expected types in the surrounding operations. For example, if custom operation produces `f32` data type then operation that consumes this output should also support `f32`. Otherwise, model conversion fails with an error, there are no automatic type conversion happens.
If operation have multiple inputs and/or outputs they will be mapped in order. The type of elements in input/output tensors should match expected types in the surrounding operations. For example, if custom operation produces ``f32`` data type then operation that consumes this output should also support ``f32``. Otherwise, model conversion fails with an error, there are no automatic type conversion happens.
### Converting to Standard OpenVINO Operation
Converting to Standard OpenVINO Operation
+++++++++++++++++++++++++++++++++++++++++
`OpExtension` class can be used when mapping to one of the operations from standard OpenVINO operation set is what you need and there is no class like `TemplateExtension::Identity` implemented.
``OpExtension`` class can be used when mapping to one of the operations from standard OpenVINO operation set is what you need and there is no class like ``TemplateExtension::Identity`` implemented.
Here is an example for a custom framework operation “MyRelu”. Suppose it is mathematically equivalent to standard `Relu` that exists in OpenVINO operation set, but for some reason has type name “MyRelu”. In this case you can directly say that “MyRelu” -> `Relu` mapping should be used:
Here is an example for a custom framework operation “MyRelu”. Suppose it is mathematically equivalent to standard `Relu` that exists in OpenVINO operation set, but for some reason has type name “MyRelu”. In this case you can directly say that “MyRelu” -> ``Relu`` mapping should be used:
@sphinxtabset
.. tab-set::
@sphinxtab{C++}
@snippet ov_extensions.cpp frontend_extension_MyRelu
@endsphinxtab
@sphinxtab{Python}
@snippet ov_extensions.py py_frontend_extension_MyRelu
@endsphinxtab
.. tab-item:: C++
:sync: cpp
@endsphinxtabset
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_MyRelu]
In the resulting converted OpenVINO model, “MyRelu” operation will be replaced by the standard operation `Relu` from the latest available OpenVINO operation set. Notice that when standard operation is used, it can be specified using just a type string (“Relu”) instead of using a `ov::opset8::Relu` class name as a template parameter for `OpExtension`. This method is available for operations from the standard operation set only. For a user custom OpenVINO operation the corresponding class should be always specified as a template parameter as it was demonstrated with `TemplateExtension::Identity`.
.. tab-item:: Python
:sync: python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [py_frontend_extension_MyRelu]
### Attributes Mapping
As described above, `OpExtension` is useful when attributes can be mapped one by one or initialized by a constant. If the set of attributes in framework representation and OpenVINO representation completely match by their names and types, nothing should be specified in OpExtension constructor parameters. The attributes are discovered and mapped automatically based on `visit_attributes` method that should be defined for any OpenVINO operation.
In the resulting converted OpenVINO model, “MyRelu” operation will be replaced by the standard operation ``Relu`` from the latest available OpenVINO operation set. Notice that when standard operation is used, it can be specified using just a type string (“Relu”) instead of using a ``ov::opset8::Relu`` class name as a template parameter for ``OpExtension``. This method is available for operations from the standard operation set only. For a user custom OpenVINO operation the corresponding class should be always specified as a template parameter as it was demonstrated with ``TemplateExtension::Identity``.
Imagine you have CustomOperation class implementation that has two attributes with names `attr1` and `attr2`:
Attributes Mapping
++++++++++++++++++
@snippet ov_extensions.cpp frontend_extension_CustomOperation
As described above, ``OpExtension`` is useful when attributes can be mapped one by one or initialized by a constant. If the set of attributes in framework representation and OpenVINO representation completely match by their names and types, nothing should be specified in OpExtension constructor parameters. The attributes are discovered and mapped automatically based on ``visit_attributes`` method that should be defined for any OpenVINO operation.
And original model in framework representation also has operation with name “CustomOperatoin” with the same `attr1` and `attr2` attributes. Then with the following code:
Imagine you have CustomOperation class implementation that has two attributes with names ``attr1`` and ``attr2``:
@snippet ov_extensions.cpp frontend_extension_CustomOperation_as_is
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_CustomOperation]
both `attr1` and `attr2` are copied from framework representation to OpenVINO representation automatically. If for some reason names of attributes are different but values still can be copied “as-is” you can pass attribute names mapping in `OpExtension` constructor:
And original model in framework representation also has operation with name “CustomOperatoin” with the same ``attr1`` and ``attr2`` attributes. Then with the following code:
@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_CustomOperation_as_is]
Where `fw_attr1` and `fw_attr2` are names for corresponding attributes in framework operation representation.
both ``attr1`` and ``attr2`` are copied from framework representation to OpenVINO representation automatically. If for some reason names of attributes are different but values still can be copied “as-is” you can pass attribute names mapping in ``OpExtension`` constructor:
If copying of an attribute is not what you need, `OpExtension` also can set attribute to predefined constant value. For the same `CustomOperation`, imagine you want to set `attr2` to value 5 instead of copying from `fw_attr2`, to achieve that do the following:
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_CustomOperation_rename]
@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename_set
Where ``fw_attr1`` and ``fw_attr2`` are names for corresponding attributes in framework operation representation.
If copying of an attribute is not what you need, ``OpExtension`` also can set attribute to predefined constant value. For the same ``CustomOperation``, imagine you want to set ``attr2`` to value 5 instead of copying from ``fw_attr2``, to achieve that do the following:
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_CustomOperation_rename_set]
So the conclusion is that each attribute of target OpenVINO operation should be initialized either by
@@ -88,46 +116,89 @@ So the conclusion is that each attribute of target OpenVINO operation should be
This is achieved by specifying maps as arguments for `OpExtension` constructor.
### Mapping custom operations to frontends with OPENVINO_FRAMEWORK_MAP macro
## Mapping to Multiple Operations with ConversionExtension
> **NOTE**: Below solution works only for ONNX and Tensorflow frontends.
Previous sections cover the case when a single operation is mapped to a single operation with optional adjustment in names and attribute values. That is likely enough for your own custom operation with existing C++ kernel implementation. In this case your framework representation and OpenVINO representation for the operation are under your control and inputs/outpus/attributes can be aligned to make `OpExtension` usable.
`OPENVINO_FRAMEWORK_MAP` is a macro that should be used inside OpenVINO operation's class definition and that lets you specify the mapping between this operation to a frontend operation.
In case if one-to-one mapping is not possible, *decomposition to multiple operations* should be considered. It is achieved by using more verbose and less automated `ConversionExtension` class. It enables writing arbitrary code to replace a single framework operation by multiple connected OpenVINO operations constructing dependency graph of any complexity.
Let's consider the following example. Imagine you have an ONNX model with `CustomOp` operation (and this operation has `mode` attribute) and a Tensorflow model with `CustomOpV3` operation (this operation has `axis` attribute) and both of them can be implemented with a single OpenVINO operation `CustomOp` like follows:
`ConversionExtension` maps a single operation to a function which builds a graph using OpenVINO operation classes. Follow chapter [Build a Model in OpenVINO Runtime](@ref ov_ug_build_model) to learn how to use OpenVINO operation classes to build a fragment of model for replacement.
@snippet ov_extensions.cpp frontend_extension_framework_map_macro_headers
@snippet ov_extensions.cpp frontend_extension_framework_map_macro_CustomOp
The next example illustrates using `ConversionExtension` for conversion of “ThresholdedRelu” from ONNX according to the formula: `ThresholdedRelu(x, alpha) -> Multiply(x, Convert(Greater(x, alpha), type=float))`.
Let's take a closer look at the parameters this macro takes:
```cpp
OPENVINO_FRAMEWORK_MAP(framework, name, attributes_map, attributes_values)
```
- `framework` - framework name.
- `name` - the framework operation name. It's optional if the OpenVINO custom operation name (that is the name that is passed as the first parameter to `OPENVINO_OP` macro) is the same as the framework operation name and both `attributes_map` and `attributes_values` are not provided.
- `attributes_map` - used to provide a mapping between OpenVINO operation attribute and framework operation attribute. Contains key-value pairs, where key is an OpenVINO operation attribute name and value is its corresponding framework operation attribute name. This parameter is optional if the number of OpenVINO operation attributes and their names match one-to-one with framework operation attributes.
- `attributes_values` - used to provide default values for OpenVINO operation attributes that are not specified in `attributes_map`. Contains key-value pairs, where key is an OpenVINO operation attribute name and the value is this attribute value. This parameter cannot be provided if `attributes_map` contains all of OpenVINO operation attributes or if `attributes_map` is not provided.
> **NOTE**: `ThresholdedRelu` is one of the standard ONNX operators which is supported by ONNX frontend natively out-of-the-box. Here we are re-implementing it to illustrate how you can add a similar support for your custom operation instead of `ThresholdedRelu`.
In the example above, `OPENVINO_FRAMEWORK_MAP` is used twice.
First, OpenVINO `CustomOp` is mapped to ONNX `CustomOp` operation, `m_mode` attribute is mapped to `mode` attribute, while `m_axis` attribute gets the default value `-1`.
Secondly, OpenVINO `CustomOp` is mapped to Tensorflow `CustomOpV3` operation, `m_axis` attribute is mapped to `axis` attribute, while `m_mode` attribute gets the default value `"linear"`.
@sphinxtabset
The last step is to register this custom operation by following:
@snippet ov_extensions.cpp frontend_extension_framework_map_macro_add_extension
@sphinxtab{C++}
@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU_header
@endsphinxtab
@sphinxtab{Python}
@snippet ov_extensions.py py_frontend_extension_ThresholdedReLU_header
@endsphinxtab
Mapping to Multiple Operations with ConversionExtension
#######################################################
@endsphinxtabset
Previous sections cover the case when a single operation is mapped to a single operation with optional adjustment in names and attribute values. That is likely enough for your own custom operation with existing C++ kernel implementation. In this case your framework representation and OpenVINO representation for the operation are under your control and inputs/outpus/attributes can be aligned to make ``OpExtension`` usable.
@sphinxtabset
In case if one-to-one mapping is not possible, *decomposition to multiple operations* should be considered. It is achieved by using more verbose and less automated ``ConversionExtension`` class. It enables writing arbitrary code to replace a single framework operation by multiple connected OpenVINO operations constructing dependency graph of any complexity.
@sphinxtab{C++}
@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU
@endsphinxtab
@sphinxtab{Python}
@snippet ov_extensions.py py_frontend_extension_ThresholdedReLU
@endsphinxtab
``ConversionExtension`` maps a single operation to a function which builds a graph using OpenVINO operation classes. Follow chapter :ref:`Build a Model in OpenVINO Runtime <ov_ug_build_model>` to learn how to use OpenVINO operation classes to build a fragment of model for replacement.
@endsphinxtabset
The next example illustrates using ``ConversionExtension`` for conversion of “ThresholdedRelu” from ONNX according to the formula: ``ThresholdedRelu(x, alpha) -> Multiply(x, Convert(Greater(x, alpha), type=float))``.
To access original framework operation attribute value and connect to inputs, `node` object of type `NodeContext` is used. It has two main methods:
.. note::
``ThresholdedRelu`` is one of the standard ONNX operators which is supported by ONNX frontend natively out-of-the-box. Here we are re-implementing it to illustrate how you can add a similar support for your custom operation instead of ``ThresholdedRelu``.
* `NodeContext::get_input` to get input with a given index,
.. tab-set::
* `NodeContext::get_attribute` to get attribute value with a given name.
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_ThresholdedReLU_header]
.. tab-item:: Python
:sync: python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [py_frontend_extension_ThresholdedReLU_header]
.. tab-set::
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
:language: cpp
:fragment: [frontend_extension_ThresholdedReLU]
.. tab-item:: Python
:sync: python
.. doxygensnippet:: docs/snippets/ov_extensions.py
:language: python
:fragment: [py_frontend_extension_ThresholdedReLU]
To access original framework operation attribute value and connect to inputs, ``node`` object of type ``NodeContext`` is used. It has two main methods:
* ``NodeContext::get_input`` to get input with a given index,
* ``NodeContext::get_attribute`` to get attribute value with a given name.
The conversion function should return a vector of node outputs that are mapped to corresponding outputs of the original framework operation in the same order.
@endsphinxdirective

View File

@@ -1,28 +1,37 @@
# 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.
@sphinxdirective
``:ref:`ov::pass::GraphRewrite <doxid-classov_1_1pass_1_1_graph_rewrite>``` serves for running multiple matcher passes on ``:ref:`ov::Model <doxid-classov_1_1_model>``` in a single graph traversal.
Example:
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:graph_rewrite
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [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.
.. note::
When using ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_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]
.. image:: ./_static/images/graph_rewrite_execution.png
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]
.. image:: ./_static/images/graph_rewrite_efficient_search.png
> **NOTE**: GraphRewrite execution algorithm cannot be set manually and depends only on root nodes registered inside MatcherPasses.
.. note::
## See Also
GraphRewrite execution algorithm cannot be set manually and depends only on root nodes registered inside MatcherPasses.
* [OpenVINO™ Transformations](./ov_transformations.md)
See Also
########
* :doc:`OpenVINO™ Transformations <openvino_docs_transformations>`
@endsphinxdirective
[graph_rewrite_execution]: ./img/graph_rewrite_execution.png
[graph_rewrite_efficient_search]: ./img/graph_rewrite_efficient_search.png

View File

@@ -1,13 +1,22 @@
# OpenVINO Matcher Pass {#openvino_docs_Extensibility_UG_matcher_pass}
`ov::pass::MatcherPass` is used for pattern-based transformations.
@sphinxdirective
``:ref:`ov::pass::MatcherPass <doxid-classov_1_1pass_1_1_matcher_pass>``` 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
.. doxygensnippet:: docs/snippets/template_pattern_transformation.hpp
:language: cpp
:fragment: [graph_rewrite:template_transformation_hpp]
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [graph_rewrite:template_transformation_cpp]
To use ``:ref:`ov::pass::MatcherPass <doxid-classov_1_1pass_1_1_matcher_pass>```, you need to complete these steps:
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
@@ -15,87 +24,135 @@ To use `ov::pass::MatcherPass`, you need to complete these steps:
So let's go through each of these steps.
## Create a pattern
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.
Pattern is a single root ``:ref:`ov::Model <doxid-classov_1_1_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
.. note::
Any nodes in a pattern that have no consumers and are not registered as root will not be used in pattern matching.
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.
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [pattern:simple_example]
For more pattern examples, refer to the [pattern matching](#pattern_matching) section.
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.
## Implement callback
For more pattern examples, refer to the `pattern matching section <#pattern-matching>`__.
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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [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.
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.
If MatcherPass was registered in ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>``` or ``:ref:`ov::pass::GraphRewrite <doxid-classov_1_1pass_1_1_graph_rewrite>```, these registered nodes will be added for additional pattern matching.
That means that matcher passes registered in ``:ref:`ov::pass::GraphRewrite <doxid-classov_1_1pass_1_1_graph_rewrite>``` will be applied to these nodes.
The example below shows how single MatcherPass can fuse sequence of operations using the `register_new_node` method.
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
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [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.
.. 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
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.
The last step is to register Matcher and callback inside the MatcherPass pass. To do this, call the ``register_matcher`` method.
```cpp
// Register matcher and callback
register_matcher(m, callback);
```
## Execute MatcherPass
.. note::
Only one matcher can be registered for a single MatcherPass class.
.. code-block:: 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>
* Run on a single node - it can be useful if you want to run MatcherPass inside another transformation.
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [matcher_pass:run_on_node]
* Run on ``:ref:`ov::Model <doxid-classov_1_1_model>``` using GraphRewrite - this approach gives ability to run MatcherPass on whole ``:ref:`ov::Model <doxid-classov_1_1_model>```. Moreover, multiple MatcherPass transformation can be registered in a single GraphRewite to be executed in a single graph traversal.
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [matcher_pass:graph_rewrite]
* Run on ``:ref:`ov::Model <doxid-classov_1_1_model>``` using ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>``` - this approach helps you to register MatcherPass for execution on ``:ref:`ov::Model <doxid-classov_1_1_model>``` as another transformation types.
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [matcher_pass:manager]
Pattern Matching
################
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.
1. ``:ref:`ov::pass::pattern::any_input <doxid-namespaceov_1_1pass_1_1pattern_1a8ed84c3eed4610f117ee10d86d500e02>``` - helps to express inputs if their types are undefined.
2. ``:ref:`ov::pass::pattern::wrap_type <doxid-namespaceov_1_1pass_1_1pattern_1adfcd6031c95d7bace5f084e2aa105af8>`<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.
.. 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`.
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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [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.
.. note::
## See Also
Be careful with manual matching because Matcher object holds matched nodes. To clear a match, use the m->clear_state() method.
* [OpenVINO™ Transformations](./ov_transformations.md)
See Also
########
* :doc:`OpenVINO™ Transformations <openvino_docs_transformations>`
@endsphinxdirective

View File

@@ -1,17 +1,26 @@
# 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.
@sphinxdirective
``:ref:`ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>``` is used for transformations that take entire ``:ref:`ov::Model <doxid-classov_1_1_model>``` as an input and process it.
Template for ModelPass transformation class
@snippet src/transformations/template_model_transformation.hpp model_pass:template_transformation_hpp
.. doxygensnippet:: docs/snippets/template_model_transformation.hpp
:language: cpp
:fragment: [model_pass:template_transformation_hpp]
@snippet src/transformations/template_model_transformation.cpp model_pass:template_transformation_cpp
.. doxygensnippet:: docs/snippets/template_model_transformation.cpp
:language: cpp
:fragment: [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`.
Using ``:ref:`ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>```, 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 ``:ref:`ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>``` based transformations can be executed via ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>```.
## See Also
See Also
########
* [OpenVINO™ Transformations](./ov_transformations.md)
* :doc:`OpenVINO™ Transformations <openvino_docs_transformations>`
@endsphinxdirective

View File

@@ -10,164 +10,208 @@
openvino_docs_Extensibility_UG_matcher_pass
openvino_docs_Extensibility_UG_graph_rewrite_pass
@endsphinxdirective
OpenVINO Transformation mechanism allows to develop transformation passes to modify `ov::Model`. You can use this mechanism to apply additional optimizations to the original Model or transform unsupported subgraphs and operations to new operations which are supported by the plugin.
OpenVINO Transformation mechanism allows to develop transformation passes to modify ``:ref:`ov::Model <doxid-classov_1_1_model>```. You can use this mechanism to apply additional optimizations to the original Model or transform unsupported subgraphs and operations to new operations which are supported by the plugin.
This guide contains all necessary information that you need to start implementing OpenVINO™ transformations.
## Working with Model
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`.
Before the moving to transformation part it is needed to say several words about functions which allow to modify ``:ref:`ov::Model <doxid-classov_1_1_model>```.
This chapter extends the :doc:`model representation guide <openvino_docs_OV_UG_Model_Representation>` and shows an API that allows us to manipulate with ``:ref:`ov::Model <doxid-classov_1_1_model>```.
### Working with node input and output ports
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.
First of all let's talk about ``:ref:`ov::Node <doxid-classov_1_1_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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:ports_example]
### Node replacement
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)`.
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]
.. image:: ./_static/images/ngraph_replace_node.png
@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.
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:replace_node]
``:ref:`ov::replace_node <doxid-namespaceov_1a75d84ee654edb73fe4fb18936a5dca6d>``` 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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:manual_replace]
Another transformation example is insertion.
![ngraph_insert_node]
.. image:: ./_static/images/ngraph_insert_node.png
@snippet ov_model_snippets.cpp ov:insert_node
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:insert_node]
The alternative way to the insert operation is to make a node copy and use `ov::replace_node()`:
The alternative way to the insert operation is to make a node copy and use ``:ref:`ov::replace_node() <doxid-namespaceov_1a75d84ee654edb73fe4fb18936a5dca6d>```:
@snippet ov_model_snippets.cpp ov:insert_node_with_copy
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:insert_node_with_copy]
### Node elimination
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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:eliminate_node]
`ov::replace_output_update_name()` in case of successful replacement it automatically preserves friendly name and runtime info.
``:ref:`ov::replace_output_update_name() <doxid-namespaceov_1a75ba2120e573883bd96bb19c887c6a1d>``` in case of successful replacement it automatically preserves friendly name and runtime info.
## Transformations types <a name="transformations-types"></a>
.. _transformations_types:
Transformations types
#####################
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
* :doc:`Model pass <openvino_docs_Extensibility_UG_model_pass>` - straightforward way to work with ``:ref:`ov::Model <doxid-classov_1_1_model>``` directly
* :doc:`Matcher pass <openvino_docs_Extensibility_UG_matcher_pass>` - pattern-based transformation approach
* :doc:`Graph rewrite pass <openvino_docs_Extensibility_UG_graph_rewrite_pass>` - container for matcher passes needed for efficient execution
![transformations_structure]
.. image:: ./_static/images/transformations_structure.png
## Transformation conditional compilation
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.
* ``:ref:`MATCHER_SCOPE(region) <doxid-conditional__compilation_2include_2openvino_2cc_2pass_2itt_8hpp_1a3d1377542bcf3e305c33a1b683cc77df>``` - 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.
* ``:ref:`RUN_ON_MODEL_SCOPE(region) <doxid-conditional__compilation_2include_2openvino_2cc_2pass_2itt_8hpp_1ab308561b849d47b9c820506ec73c4a30>``` - 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>
.. _transformation_writing_essentials:
Transformation writing essentials
#################################
When developing a transformation, you need to follow these transformation rules:
### 1. Friendly Names
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.
Each ``:ref:`ov::Node <doxid-classov_1_1_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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [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
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.
Runtime info is a map ``std::map<std::string, :ref:`ov::Any <doxid-classov_1_1_any>`>`` located inside ``:ref:`ov::Node <doxid-classov_1_1_node>``` class. It represents additional attributes in ``:ref:`ov::Node <doxid-classov_1_1_node>```.
These attributes can be set by users or by plugins and when executing transformation that changes ``:ref:`ov::Model <doxid-classov_1_1_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.
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:copy_runtime_info]
> **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})`
When transformation has multiple fusions or decompositions, ``:ref:`ov::copy_runtime_info <doxid-namespaceov_1a3bb5969a95703b4b4fd77f6f58837207>``` must be called multiple times for each case.
### 3. Constant Folding
.. 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})``
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.
3. Constant Folding
+++++++++++++++++++
If your transformation inserts constant sub-graphs that need to be folded, do not forget to use ``:ref:`ov::pass::ConstantFolding() <doxid-classov_1_1pass_1_1_constant_folding>``` 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
.. doxygensnippet:: docs/snippets/ov_model_snippets.cpp
:language: cpp
:fragment: [ov:constant_subgraph]
Manual constant folding is more preferable than `ov::pass::ConstantFolding()` because it is much faster.
Manual constant folding is more preferable than ``:ref:`ov::pass::ConstantFolding() <doxid-classov_1_1pass_1_1_constant_folding>``` 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
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [manual_constant_folding]
## Common mistakes in transformations <a name="common_mistakes"></a>
.. _common_mistakes:
Common mistakes in transformations
##################################
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.
* 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 ``:ref:`ov::Model <doxid-classov_1_1_model>```. If you are using ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>```, it will automatically call this method after each transformation execution.
* Do not forget to call the ``:ref:`ov::pass::ConstantFolding <doxid-classov_1_1pass_1_1_constant_folding>``` 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.
* When developing a callback for ``:ref:`ov::pass::MatcherPass <doxid-classov_1_1pass_1_1_matcher_pass>```, do not change nodes that come after the root node in topological order.
## Using pass manager <a name="using_pass_manager"></a>
.. _using_pass_manager:
`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).
Using pass manager
##################
The example below shows basic usage of `ov::pass::Manager`
``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_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, ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>``` has extended debug capabilities (find more information in the `how to debug transformations <#how_to_debug_transformations>`__ section).
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager3
The example below shows basic usage of ``:ref:`ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>```
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [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
.. doxygensnippet:: docs/snippets/template_pattern_transformation.cpp
:language: cpp
:fragment: [matcher_pass:manager2]
.. _how_to_debug_transformations:
## How to debug transformations <a name="how-to-debug-transformations"></a>
How to debug transformations
############################
If you are using `ngraph::pass::Manager` to run sequence of transformations, you can get additional debug capabilities by using the following environment variables:
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.
```
.. code-block:: cpp
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
.. note:: Make sure that you have dot installed on your machine; otherwise, it will silently save only dot file without svg file.
* [OpenVINO™ Model Representation](../OV_Runtime_UG/model_representation.md)
* [OpenVINO™ Extensions](./Intro.md)
See Also
########
[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
* :doc:`OpenVINO™ Model Representation <openvino_docs_OV_UG_Model_Representation>`
* :doc:`OpenVINO™ Extensions <openvino_docs_Extensibility_UG_Intro>`
@endsphinxdirective

View File

@@ -1,49 +1,45 @@
# Asynchronous Inference Request {#openvino_docs_ie_plugin_dg_async_infer_request}
# Asynchronous Inference Request {#openvino_docs_ov_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.
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class:
OpenVINO Runtime Plugin API provides the base ov::IAsyncInferRequest class:
- The class has the `_pipeline` field of `std::vector<std::pair<ITaskExecutor::Ptr, Task> >`, which contains pairs of an executor and executed task.
- The class has the `m_pipeline` field of `std::vector<std::pair<std::shared_ptr<ov::threading::ITaskExecutor>, ov::threading::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.
- The class has the InferenceEngine::AsyncInferRequestThreadSafeDefault::StopAndWait method, which waits for `_pipeline` to finish in a class destructor. The method does not stop task executors and they are still in the running stage, because they belong to the executable network instance and are not destroyed.
- The class has the ov::IAsyncInferRequest::stop_and_wait method, which waits for `m_pipeline` to finish in a class destructor. The method does not stop task executors and they are still in the running stage, because they belong to the compiled model instance and are not destroyed.
`AsyncInferRequest` Class
AsyncInferRequest Class
------------------------
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class for a custom asynchronous inference request implementation:
OpenVINO Runtime Plugin API provides the base ov::IAsyncInferRequest class for a custom asynchronous inference request implementation:
@snippet src/template_async_infer_request.hpp async_infer_request:header
@snippet src/async_infer_request.hpp async_infer_request:header
#### Class Fields
### Class Fields
- `_inferRequest` - a reference to the [synchronous inference request](@ref openvino_docs_ie_plugin_dg_infer_request) implementation. Its methods are reused in the `AsyncInferRequest` constructor to define a device pipeline.
- `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion
- `m_wait_executor` - a task executor that waits for a response from a device about device tasks completion
> **NOTE**: If a plugin can work with several instances of a device, `_waitExecutor` must be device-specific. Otherwise, having a single task executor for several devices does not allow them to work in parallel.
> **NOTE**: If a plugin can work with several instances of a device, `m_wait_executor` must be device-specific. Otherwise, having a single task executor for several devices does not allow them to work in parallel.
### `AsyncInferRequest()`
### AsyncInferRequest()
The main goal of the `AsyncInferRequest` constructor is to define a device pipeline `_pipeline`. The example below demonstrates `_pipeline` creation with the following stages:
The main goal of the `AsyncInferRequest` constructor is to define a device pipeline `m_pipeline`. The example below demonstrates `m_pipeline` creation with the following stages:
- `inferPreprocess` is a CPU compute task.
- `startPipeline` is a CPU ligthweight task to submit tasks to a remote device.
- `waitPipeline` is a CPU non-compute task that waits for a response from a remote device.
- `inferPostprocess` is a CPU compute task.
- `infer_preprocess_and_start_pipeline` is a CPU ligthweight task to submit tasks to a remote device.
- `wait_pipeline` is a CPU non-compute task that waits for a response from a remote device.
- `infer_postprocess` is a CPU compute task.
@snippet src/template_async_infer_request.cpp async_infer_request:ctor
@snippet src/async_infer_request.cpp async_infer_request:ctor
The stages are distributed among two task executors in the following way:
- `inferPreprocess` and `startPipeline` are combined into a single task and run on `_requestExecutor`, which computes CPU tasks.
- `infer_preprocess_and_start_pipeline` prepare input tensors and run on `m_request_executor`, which computes CPU tasks.
- You need at least two executors to overlap compute tasks of a CPU and a remote device the plugin works with. Otherwise, CPU and device tasks are executed serially one by one.
- `waitPipeline` is sent to `_waitExecutor`, which works with the device.
- `wait_pipeline` is sent to `m_wait_executor`, which works with the device.
> **NOTE**: `callbackExecutor` is also passed to the constructor and it is used in the base InferenceEngine::AsyncInferRequestThreadSafeDefault class, which adds a pair of `callbackExecutor` and a callback function set by the user to the end of the pipeline.
> **NOTE**: `m_callback_executor` is also passed to the constructor and it is used in the base ov::IAsyncInferRequest class, which adds a pair of `callback_executor` and a callback function set by the user to the end of the pipeline.
Inference request stages are also profiled using IE_PROFILING_AUTO_SCOPE, which shows how pipelines of multiple asynchronous inference requests are run in parallel via the [Intel® VTune™ Profiler](https://software.intel.com/en-us/vtune) tool.
### ~AsyncInferRequest()
### `~AsyncInferRequest()`
In the asynchronous request destructor, it is necessary to wait for a pipeline to finish. It can be done using the ov::IAsyncInferRequest::stop_and_wait method of the base class.
In the asynchronous request destructor, it is necessary to wait for a pipeline to finish. It can be done using the InferenceEngine::AsyncInferRequestThreadSafeDefault::StopAndWait method of the base class.
@snippet src/template_async_infer_request.cpp async_infer_request:dtor
@snippet src/async_infer_request.cpp async_infer_request:dtor

View File

@@ -1,4 +1,4 @@
# Build Plugin Using CMake {#openvino_docs_ie_plugin_dg_plugin_build}
# Build Plugin Using CMake {#openvino_docs_ov_plugin_dg_plugin_build}
OpenVINO build infrastructure provides the OpenVINO Developer Package for plugin development.
@@ -18,28 +18,21 @@ Once the commands above are executed, the OpenVINO Developer Package is generate
- `OpenVINODeveloperPackageConfig-version.cmake` - a file with a package version.
- `targets_developer.cmake` - an automatically generated file which contains all targets exported from the OpenVINO build tree. This file is included by `OpenVINODeveloperPackageConfig.cmake` to import the following targets:
- Libraries for plugin development:
* `openvino::ngraph` - shared OpenVINO library
* `openvino::openvino_gapi_preproc` - shared library with OpenVINO preprocessing plugin
* `openvino::core::dev` - interface library with OpenVINO Core development headers
* `openvino::runtime::dev` - interface library with OpenVINO Plugin API headers
* `openvino::runtime` - shared OpenVINO library
* `openvino::runtime::dev` - interface library with OpenVINO Developer API
* `openvino::pugixml` - static Pugixml library
* `openvino::xbyak` - interface library with Xbyak headers
* `openvino::itt` - static library with tools for performance measurement using Intel ITT
- Libraries for tests development:
* `IE::gtest`, `IE::gtest_main`, `IE::gmock` - Google Tests framework libraries
* `IE::commonTestUtils` - static library with common tests utilities
* `IE::funcTestUtils` - static library with functional tests utilities
* `IE::unitTestUtils` - static library with unit tests utilities
* `IE::ngraphFunctions` - static library with the set of `ngraph::Function` builders
* `IE::funcSharedTests` - static library with common functional tests
* `openvino::gtest`, `openvino::gtest_main`, `openvino::gmock` - Google Tests framework libraries
* `openvino::commonTestUtils` - static library with common tests utilities
* `openvino::funcTestUtils` - static library with functional tests utilities
* `openvino::unitTestUtils` - static library with unit tests utilities
* `openvino::ngraphFunctions` - static library with the set of `ov::Model` builders
* `openvino::funcSharedTests` - static library with common functional tests
* `openvino::ngraph_reference` - static library with operation reference implementations.
> **NOTE**: it's enough just to run `cmake --build . --target ie_dev_targets` command to build only targets from the
> **NOTE**: it's enough just to run `cmake --build . --target ov_dev_targets` command to build only targets from the
> OpenVINO Developer package.
Build Plugin using OpenVINO Developer Package
@@ -61,31 +54,7 @@ A common plugin consists of the following components:
To build a plugin and its tests, run the following CMake scripts:
- Root `CMakeLists.txt`, which finds the OpenVINO Developer Package using the `find_package` CMake command and adds the `src` and `tests` subdirectories with plugin sources and their tests respectively:
```cmake
cmake_minimum_required(VERSION 3.13)
project(OpenVINOTemplatePlugin)
set(TEMPLATE_PLUGIN_SOURCE_DIR ${OpenVINOTemplatePlugin_SOURCE_DIR})
find_package(OpenVINODeveloperPackage REQUIRED)
if(CMAKE_COMPILER_IS_GNUCXX)
ov_add_compiler_flags(-Wall)
endif()
add_subdirectory(src)
if(ENABLE_TESTS)
include(CTest)
enable_testing()
if(ENABLE_FUNCTIONAL_TESTS)
add_subdirectory(tests/functional)
endif()
endif()
```
@snippet template/CMakeLists.txt cmake:main
> **NOTE**: The default values of the `ENABLE_TESTS`, `ENABLE_FUNCTIONAL_TESTS` options are shared via the OpenVINO Developer Package and they are the same as for the main OpenVINO build tree. You can override them during plugin build using the command below:
```bash
$ cmake -DENABLE_FUNCTIONAL_TESTS=OFF -DOpenVINODeveloperPackage_DIR=../openvino-release-build ../template-plugin
@@ -93,7 +62,7 @@ $ cmake -DENABLE_FUNCTIONAL_TESTS=OFF -DOpenVINODeveloperPackage_DIR=../openvino
- `src/CMakeLists.txt` to build a plugin shared library from sources:
@snippet template/src/CMakeLists.txt cmake:plugin
> **NOTE**: `openvino::runtime` target is imported from the OpenVINO Developer Package.
> **NOTE**: `openvino::...` targets are imported from the OpenVINO Developer Package.
- `tests/functional/CMakeLists.txt` to build a set of functional plugin tests:
@snippet template/tests/functional/CMakeLists.txt cmake:functional_tests

View File

@@ -0,0 +1,89 @@
# Compiled Model {#openvino_docs_ov_plugin_dg_compiled_model}
ov::CompiledModel class functionality:
- Compile an ov::Model instance to a backend specific graph representation
- Create an arbitrary number of ov::InferRequest objects
- Hold some common resources shared between different instances of ov::InferRequest. For example:
- ov::ICompiledModel::m_task_executor task executor to implement asynchronous execution
- ov::ICompiledModel::m_callback_executor task executor to run an asynchronous inference request callback in a separate thread
CompiledModel Class
------------------------
OpenVINO Plugin API provides the interface ov::ICompiledModel which should be used as a base class for a compiled model. Based on that, a declaration of an compiled model class can look as follows:
@snippet src/compiled_model.hpp compiled_model:header
### Class Fields
The example class has several fields:
- `m_request_id` - Tracks a number of created inference requests, which is used to distinguish different inference requests during profiling via the Intel® Instrumentation and Tracing Technology (ITT) library.
- `m_cfg` - Defines a configuration a compiled model was compiled with.
- `m_model` - Keeps a reference to transformed `ov::Model` which is used in OpenVINO reference backend computations. Note, in case of other backends with backend specific graph representation `m_model` has different type and represents backend specific graph or just a set of computational kernels to perform an inference.
- `m_loaded_from_cache` - Allows to understand that model was loaded from cache.
### CompiledModel Constructor
This constructor accepts a generic representation of a model as an ov::Model and is compiled into a backend specific device graph:
@snippet src/compiled_model.cpp compiled_model:ctor
The implementation `compile_model()` is fully device-specific.
### compile_model()
The function accepts a const shared pointer to `ov::Model` object and applies OpenVINO passes using `transform_model()` function, which defines plugin-specific conversion pipeline. To support low precision inference, the pipeline can include Low Precision Transformations. These transformations are usually hardware specific. You can find how to use and configure Low Precisions Transformations in [Low Precision Transformations](@ref openvino_docs_OV_UG_lpt) guide.
@snippet src/compiled_model.cpp compiled_model:compile_model
> **NOTE**: After all these steps, the backend specific graph is ready to create inference requests and perform inference.
### export_model()
The implementation of the method should write all data to the `model_stream`, which is required to import a backend specific graph later in the `Plugin::import_model` method:
@snippet src/compiled_model.cpp compiled_model:export_model
### create_sync_infer_request()
The method creates an synchronous inference request and returns it.
@snippet src/compiled_model.cpp compiled_model:create_sync_infer_request
While the public OpenVINO API has a single interface for inference request, which can be executed in synchronous and asynchronous modes, a plugin library implementation has two separate classes:
- [Synchronous inference request](@ref openvino_docs_ov_plugin_dg_infer_request), which defines pipeline stages and runs them synchronously in the `infer` method.
- [Asynchronous inference request](@ref openvino_docs_ov_plugin_dg_async_infer_request), which is a wrapper for a synchronous inference request and can run a pipeline asynchronously. Depending on a device pipeline structure, it can has one or several stages:
- For single-stage pipelines, there is no need to define this method and create a class derived from ov::IAsyncInferRequest. For single stage pipelines, a default implementation of this method creates ov::IAsyncInferRequest wrapping a synchronous inference request and runs it asynchronously in the `m_request_executor` executor.
- For pipelines with multiple stages, such as performing some preprocessing on host, uploading input data to a device, running inference on a device, or downloading and postprocessing output data, schedule stages on several task executors to achieve better device use and performance. You can do it by creating a sufficient number of inference requests running in parallel. In this case, device stages of different inference requests are overlapped with preprocessing and postprocessing stage giving better performance.
> **IMPORTANT**: It is up to you to decide how many task executors you need to optimally execute a device pipeline.
### create_infer_request()
The method creates an asynchronous inference request and returns it.
@snippet src/compiled_model.cpp compiled_model:create_infer_request
### get_property()
Returns a current value for a property with the name `name`. The method extracts configuration values a compiled model is compiled with.
@snippet src/compiled_model.cpp compiled_model:get_property
This function is the only way to get configuration values when a model is imported and compiled by other developers and tools.
### set_property()
The methods allows to set compiled model specific properties.
@snippet src/compiled_model.cpp compiled_model:set_property
### get_runtime_model()
The methods returns the runtime model with backend specific information.
@snippet src/compiled_model.cpp compiled_model:get_runtime_model
The next step in plugin library implementation is the [Synchronous Inference Request](@ref openvino_docs_ov_plugin_dg_infer_request) class.

View File

@@ -1,90 +0,0 @@
# Executable Network {#openvino_docs_ie_plugin_dg_executable_network}
`ExecutableNetwork` class functionality:
- Compile an InferenceEngine::ICNNNetwork instance to a backend specific graph representation
- Create an arbitrary number of `InferRequest` objects
- Hold some common resources shared between different instances of `InferRequest`. For example:
- InferenceEngine::IExecutableNetworkInternal::_taskExecutor task executor to implement asynchronous execution
- InferenceEngine::IExecutableNetworkInternal::_callbackExecutor task executor to run an asynchronous inference request callback in a separate thread
`ExecutableNetwork` Class
------------------------
Inference Engine Plugin API provides the helper InferenceEngine::ExecutableNetworkThreadSafeDefault class recommended to use as a base class for an executable network. Based on that, a declaration of an executable network class can look as follows:
@snippet src/compiled_model.hpp executable_network:header
#### Class Fields
The example class has several fields:
- `_requestId` - Tracks a number of created inference requests, which is used to distinguish different inference requests during profiling via the Intel® Instrumentation and Tracing Technology (ITT) library.
- `_cfg` - Defines a configuration an executable network was compiled with.
- `_plugin` - Refers to a plugin instance.
- `_function` - Keeps a reference to transformed `ngraph::Function` which is used in ngraph reference backend computations. Note, in case of other backends with backend specific graph representation `_function` has different type and represents backend specific graph or just a set of computational kernels to perform an inference.
- `_inputIndex` - maps a name of input with its index among all network inputs.
- `_outputIndex` - maps a name of output with its index among all network outputs.
### `ExecutableNetwork` Constructor with `ICNNNetwork`
This constructor accepts a generic representation of a neural network as an InferenceEngine::ICNNNetwork reference and is compiled into a backend specific device graph:
@snippet src/compiled_model.cpp executable_network:ctor_cnnnetwork
The implementation `CompileNetwork` is fully device-specific.
### `CompileNetwork()`
The function accepts a const shared pointer to `ngraph::Function` object and performs the following steps:
1. Applies nGraph passes using `TransformNetwork` function, which defines plugin-specific conversion pipeline. To support low precision inference, the pipeline can include Low Precision Transformations. These transformations are usually hardware specific. You can find how to use and configure Low Precisions Transformations in [Low Precision Transformations](@ref openvino_docs_OV_UG_lpt) guide.
2. Maps the transformed graph to a backend specific graph representation (for example, to CPU plugin internal graph representation).
3. Allocates and fills memory for graph weights, backend specific memory handles and so on.
@snippet src/compiled_model.cpp executable_network:map_graph
> **NOTE**: After all these steps, the backend specific graph is ready to create inference requests and perform inference.
### `ExecutableNetwork` Constructor Importing from Stream
This constructor creates a backend specific graph by importing from a stream object:
> **NOTE**: The export of backend specific graph is done in the `Export` method, and data formats must be the same for both import and export.
### `Export()`
The implementation of the method should write all data to the `model` stream, which is required to import a backend specific graph later in the `Plugin::Import` method:
@snippet src/compiled_model.cpp executable_network:export
### `CreateInferRequest()`
The method creates an asynchronous inference request and returns it. While the public Inference Engine API has a single interface for inference request, which can be executed in synchronous and asynchronous modes, a plugin library implementation has two separate classes:
- [Synchronous inference request](@ref openvino_docs_ie_plugin_dg_infer_request), which defines pipeline stages and runs them synchronously in the `Infer` method.
- [Asynchronous inference request](@ref openvino_docs_ie_plugin_dg_async_infer_request), which is a wrapper for a synchronous inference request and can run a pipeline asynchronously. Depending on a device pipeline structure, it can has one or several stages:
- For single-stage pipelines, there is no need to define this method and create a class derived from InferenceEngine::AsyncInferRequestThreadSafeDefault. For single stage pipelines, a default implementation of this method creates InferenceEngine::AsyncInferRequestThreadSafeDefault wrapping a synchronous inference request and runs it asynchronously in the `_taskExecutor` executor.
- For pipelines with multiple stages, such as performing some preprocessing on host, uploading input data to a device, running inference on a device, or downloading and postprocessing output data, schedule stages on several task executors to achieve better device use and performance. You can do it by creating a sufficient number of inference requests running in parallel. In this case, device stages of different inference requests are overlapped with preprocessing and postprocessing stage giving better performance.
> **IMPORTANT**: It is up to you to decide how many task executors you need to optimally execute a device pipeline.
@snippet src/compiled_model.cpp executable_network:create_infer_request
### `GetMetric()`
Returns a metric value for a metric with the name `name`. A metric is a static type of information about an executable network. Examples of metrics:
- EXEC_NETWORK_METRIC_KEY(NETWORK_NAME) - name of an executable network
- EXEC_NETWORK_METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS) - heuristic to denote an optimal (or at least sub-optimal) number of inference requests needed to run asynchronously to use the current device fully
- Any other executable network metric specific for a particular device. Such metrics and possible values must be declared in a plugin configuration public header, for example, `template/config.hpp`
The IE_SET_METRIC_RETURN helper macro sets metric value and checks that the actual metric type matches a type of the specified value.
### `GetConfig()`
Returns a current value for a configuration key with the name `name`. The method extracts configuration values an executable network is compiled with.
@snippet src/compiled_model.cpp executable_network:get_config
This function is the only way to get configuration values when a network is imported and compiled by other developers and tools (for example, the [Compile tool](@ref openvino_inference_engine_tools_compile_tool_README).
The next step in plugin library implementation is the [Synchronous Inference Request](@ref openvino_docs_ie_plugin_dg_infer_request) class.

View File

@@ -1,83 +1,92 @@
# Synchronous Inference Request {#openvino_docs_ie_plugin_dg_infer_request}
# Synchronous Inference Request {#openvino_docs_ov_plugin_dg_infer_request}
`InferRequest` class functionality:
- Allocate input and output blobs needed for a backend-dependent network inference.
- Define functions for inference process stages (for example, `preprocess`, `upload`, `infer`, `download`, `postprocess`). These functions can later be used to define an execution pipeline during [Asynchronous Inference Request](@ref openvino_docs_ie_plugin_dg_async_infer_request) implementation.
- Allocate input and output tensors needed for a backend-dependent network inference.
- Define functions for inference process stages (for example, `preprocess`, `upload`, `infer`, `download`, `postprocess`). These functions can later be used to define an execution pipeline during [Asynchronous Inference Request](@ref openvino_docs_ov_plugin_dg_async_infer_request) implementation.
- Call inference stages one by one synchronously.
`InferRequest` Class
InferRequest Class
------------------------
Inference Engine Plugin API provides the helper InferenceEngine::IInferRequestInternal class recommended
to use as a base class for a synchronous inference request implementation. Based of that, a declaration
OpenVINO Plugin API provides the interface ov::ISyncInferRequest which should be
used as a base class for a synchronous inference request implementation. Based of that, a declaration
of a synchronous request class can look as follows:
@snippet src/template_infer_request.hpp infer_request:header
@snippet src/sync_infer_request.hpp infer_request:header
#### Class Fields
### Class Fields
The example class has several fields:
- `_executableNetwork` - reference to an executable network instance. From this reference, an inference request instance can take a task executor, use counter for a number of created inference requests, and so on.
- `_profilingTask` - array of the `std::array<InferenceEngine::ProfilingTask, numOfStages>` type. Defines names for pipeline stages. Used to profile an inference pipeline execution with the Intel® instrumentation and tracing technology (ITT).
- `_durations` - array of durations of each pipeline stage.
- `_networkInputBlobs` - input blob map.
- `_networkOutputBlobs` - output blob map.
- `_parameters` - `ngraph::Function` parameter operations.
- `_results` - `ngraph::Function` result operations.
- `m_profiling_task` - array of the `std::array<openvino::itt::handle_t, numOfStages>` type. Defines names for pipeline stages. Used to profile an inference pipeline execution with the Intel® instrumentation and tracing technology (ITT).
- `m_durations` - array of durations of each pipeline stage.
- backend specific fields:
- `_inputTensors` - inputs tensors which wrap `_networkInputBlobs` blobs. They are used as inputs to backend `_executable` computational graph.
- `_outputTensors` - output tensors which wrap `_networkOutputBlobs` blobs. They are used as outputs from backend `_executable` computational graph.
- `_executable` - an executable object / backend computational graph.
- `m_backend_input_tensors` - input backend tensors.
- `m_backend_output_tensors` - output backend tensors.
- `m_executable` - an executable object / backend computational graph.
- `m_eval_context` - an evaluation context to save backend states after the inference.
- `m_variable_states` - a vector of variable states.
### `InferRequest` Constructor
### InferRequest Constructor
The constructor initializes helper fields and calls methods which allocate blobs:
The constructor initializes helper fields and calls methods which allocate tensors:
@snippet src/template_infer_request.cpp infer_request:ctor
@snippet src/sync_infer_request.cpp infer_request:ctor
> **NOTE**: Call InferenceEngine::CNNNetwork::getInputsInfo and InferenceEngine::CNNNetwork::getOutputsInfo to specify both layout and precision of blobs, which you can set with InferenceEngine::InferRequest::SetBlob and get with InferenceEngine::InferRequest::GetBlob. A plugin uses these hints to determine its internal layouts and precisions for input and output blobs if needed.
> **NOTE**: Use inputs/outputs information from the compiled model to understand shape and element type of tensors, which you can set with ov::InferRequest::set_tensor and get with ov::InferRequest::get_tensor. A plugin uses these hints to determine its internal layouts and element types for input and output tensors if needed.
### `~InferRequest` Destructor
### ~InferRequest Destructor
Decrements a number of created inference requests:
Destructor can contain plugin specific logic to finish and destroy infer request.
@snippet src/template_infer_request.cpp infer_request:dtor
@snippet src/sync_infer_request.cpp infer_request:dtor
### `InferImpl()`
### set_tensors_impl()
**Implementation details:** Base IInferRequestInternal class implements the public InferenceEngine::IInferRequestInternal::Infer method as following:
- Checks blobs set by users
- Calls the `InferImpl` method defined in a derived class to call actual pipeline stages synchronously
The method allows to set batched tensors in case if the plugin supports it.
@snippet src/template_infer_request.cpp infer_request:infer_impl
@snippet src/sync_infer_request.cpp infer_request:set_tensors_impl
#### 1. `inferPreprocess`
### query_state()
Below is the code of the `inferPreprocess` method to demonstrate Inference Engine common preprocessing step handling:
The method returns variable states from the model.
@snippet src/template_infer_request.cpp infer_request:infer_preprocess
@snippet src/sync_infer_request.cpp infer_request:query_state
**Details:**
* `InferImpl` must call the InferenceEngine::IInferRequestInternal::execDataPreprocessing function, which executes common Inference Engine preprocessing step (for example, applies resize or color conversion operations) if it is set by the user. The output dimensions, layout and precision matches the input information set via InferenceEngine::CNNNetwork::getInputsInfo.
* If `inputBlob` passed by user differs in terms of precisions from precision expected by plugin, `blobCopy` is performed which does actual precision conversion.
### infer()
#### 2. `startPipeline`
The method calls actual pipeline stages synchronously. Inside the method plugin should check input/output tensors, move external tensors to backend and run the inference.
Executes a pipeline synchronously using `_executable` object:
@snippet src/sync_infer_request.cpp infer_request:infer
@snippet src/template_infer_request.cpp infer_request:start_pipeline
#### 1. infer_preprocess()
#### 3. `inferPostprocess`
Below is the code of the `infer_preprocess()` method. The method checks user input/output tensors and demonstrates conversion from user tensor to backend specific representation:
Converts output blobs if precisions of backend output blobs and blobs passed by user are different:
@snippet src/sync_infer_request.cpp infer_request:infer_preprocess
@snippet src/template_infer_request.cpp infer_request:infer_postprocess
#### 2. start_pipeline()
### `GetPerformanceCounts()`
Executes a pipeline synchronously using `m_executable` object:
The method sets performance counters which were measured during pipeline stages execution:
@snippet src/sync_infer_request.cpp infer_request:start_pipeline
@snippet src/template_infer_request.cpp infer_request:get_performance_counts
#### 3. wait_pipeline()
The next step in the plugin library implementation is the [Asynchronous Inference Request](@ref openvino_docs_ie_plugin_dg_async_infer_request) class.
Waits a pipeline in case of plugin asynchronous execution:
@snippet src/sync_infer_request.cpp infer_request:wait_pipeline
#### 4. infer_postprocess()
Converts backend specific tensors to tensors passed by user:
@snippet src/sync_infer_request.cpp infer_request:infer_postprocess
### get_profiling_info()
The method returns the profiling info which was measured during pipeline stages execution:
@snippet src/sync_infer_request.cpp infer_request:get_profiling_info
The next step in the plugin library implementation is the [Asynchronous Inference Request](@ref openvino_docs_ov_plugin_dg_async_infer_request) class.

View File

@@ -1,4 +1,4 @@
# Overview of Inference Engine Plugin Library {#openvino_docs_ie_plugin_dg_overview}
# Overview of OpenVINO Plugin Library {#openvino_docs_ie_plugin_dg_overview}
@sphinxdirective
@@ -7,62 +7,67 @@
:caption: Converting and Preparing Models
:hidden:
Implement Plugin Functionality <openvino_docs_ie_plugin_dg_plugin>
Implement Executable Network Functionality <openvino_docs_ie_plugin_dg_executable_network>
Implement Synchronous Inference Request <openvino_docs_ie_plugin_dg_infer_request>
Implement Asynchronous Inference Request <openvino_docs_ie_plugin_dg_async_infer_request>
openvino_docs_ie_plugin_dg_plugin_build
openvino_docs_ie_plugin_dg_plugin_testing
Implement Plugin Functionality <openvino_docs_ov_plugin_dg_plugin>
Implement Compiled Model Functionality <openvino_docs_ov_plugin_dg_compiled_model>
Implement Synchronous Inference Request <openvino_docs_ov_plugin_dg_infer_request>
Implement Asynchronous Inference Request <openvino_docs_ov_plugin_dg_async_infer_request>
Provide Plugin Specific Properties <openvino_docs_ov_plugin_dg_properties>
Implement Remote Context <openvino_docs_ov_plugin_dg_remote_context>
Implement Remote Tensor <openvino_docs_ov_plugin_dg_remote_tensor>
openvino_docs_ov_plugin_dg_plugin_build
openvino_docs_ov_plugin_dg_plugin_testing
openvino_docs_ie_plugin_detailed_guides
openvino_docs_ie_plugin_api_references
@endsphinxdirective
The plugin architecture of the Inference Engine allows to develop and plug independent inference
The plugin architecture of the OpenVINO allows to develop and plug independent inference
solutions dedicated to different devices. Physically, a plugin is represented as a dynamic library
exporting the single `CreatePluginEngine` function that allows to create a new plugin instance.
Inference Engine Plugin Library
OpenVINO Plugin Library
-----------------------
Inference Engine plugin dynamic library consists of several main components:
OpenVINO plugin dynamic library consists of several main components:
1. [Plugin class](@ref openvino_docs_ie_plugin_dg_plugin):
- Provides information about devices of a specific type.
- Can create an [executable network](@ref openvino_docs_ie_plugin_dg_executable_network) instance which represents a Neural
Network backend specific graph structure for a particular device in opposite to the InferenceEngine::ICNNNetwork
interface which is backend-independent.
- Can import an already compiled graph structure from an input stream to an
[executable network](@ref openvino_docs_ie_plugin_dg_executable_network) object.
2. [Executable Network class](@ref openvino_docs_ie_plugin_dg_executable_network):
- Is an execution configuration compiled for a particular device and takes into account its capabilities.
- Holds a reference to a particular device and a task executor for this device.
- Can create several instances of [Inference Request](@ref openvino_docs_ie_plugin_dg_infer_request).
- Can export an internal backend specific graph structure to an output stream.
3. [Inference Request class](@ref openvino_docs_ie_plugin_dg_infer_request):
1. [Plugin class](@ref openvino_docs_ov_plugin_dg_plugin):
- Provides information about devices of a specific type.
- Can create an [compiled model](@ref openvino_docs_ov_plugin_dg_compiled_model) instance which represents a Neural Network backend specific graph structure for a particular device in opposite to the ov::Model
which is backend-independent.
- Can import an already compiled graph structure from an input stream to an
[compiled model](@ref openvino_docs_ov_plugin_dg_compiled_model) object.
2. [Compiled Model class](@ref openvino_docs_ov_plugin_dg_compiled_model):
- Is an execution configuration compiled for a particular device and takes into account its capabilities.
- Holds a reference to a particular device and a task executor for this device.
- Can create several instances of [Inference Request](@ref openvino_docs_ov_plugin_dg_infer_request).
- Can export an internal backend specific graph structure to an output stream.
3. [Inference Request class](@ref openvino_docs_ov_plugin_dg_infer_request):
- Runs an inference pipeline serially.
- Can extract performance counters for an inference pipeline execution profiling.
4. [Asynchronous Inference Request class](@ref openvino_docs_ie_plugin_dg_async_infer_request):
- Wraps the [Inference Request](@ref openvino_docs_ie_plugin_dg_infer_request) class and runs pipeline stages in parallel
on several task executors based on a device-specific pipeline structure.
4. [Asynchronous Inference Request class](@ref openvino_docs_ov_plugin_dg_async_infer_request):
- Wraps the [Inference Request](@ref openvino_docs_ov_plugin_dg_infer_request) class and runs pipeline stages in parallel on several task executors based on a device-specific pipeline structure.
5. [Plugin specific properties](@ref openvino_docs_ov_plugin_dg_properties):
- Provides the plugin specific properties.
6. [Remote Context](@ref openvino_docs_ov_plugin_dg_remote_context):
- Provides the device specific remote context. Context allows to create remote tensors.
7. [Remote Tensor](@ref openvino_docs_ov_plugin_dg_remote_tensor)
- Provides the device specific remote tensor API and implementation.
> **NOTE**: This documentation is written based on the `Template` plugin, which demonstrates plugin
development details. Find the complete code of the `Template`, which is fully compilable and up-to-date,
> **NOTE**: This documentation is written based on the `Template` plugin, which demonstrates plugin development details. Find the complete code of the `Template`, which is fully compilable and up-to-date,
at `<openvino source dir>/src/plugins/template`.
Detailed guides
-----------------------
* [Build](@ref openvino_docs_ie_plugin_dg_plugin_build) a plugin library using CMake
* Plugin and its components [testing](@ref openvino_docs_ie_plugin_dg_plugin_testing)
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks)
* [Build](@ref openvino_docs_ov_plugin_dg_plugin_build) a plugin library using CMake
* Plugin and its components [testing](@ref openvino_docs_ov_plugin_dg_plugin_testing)
* [Quantized networks](@ref openvino_docs_ov_plugin_dg_quantized_models)
* [Low precision transformations](@ref openvino_docs_OV_UG_lpt) guide
* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide
API References
-----------------------
* [Inference Engine Plugin API](@ref ie_dev_api)
* [Inference Engine Transformation API](@ref ie_transformation_api)
* [OpenVINO Plugin API](@ref ov_dev_api)
* [OpenVINO Transformation API](@ref ie_transformation_api)

View File

@@ -1,48 +1,50 @@
# Plugin {#openvino_docs_ie_plugin_dg_plugin}
# Plugin {#openvino_docs_ov_plugin_dg_plugin}
Inference Engine Plugin usually represents a wrapper around a backend. Backends can be:
OpenVINO Plugin usually represents a wrapper around a backend. Backends can be:
- OpenCL-like backend (e.g. clDNN library) for GPU devices.
- oneDNN backend for Intel CPU devices.
- NVIDIA cuDNN for NVIDIA GPUs.
The responsibility of Inference Engine Plugin:
The responsibility of OpenVINO Plugin:
- Initializes a backend and throw exception in `Engine` constructor if backend cannot be initialized.
- Provides information about devices enabled by a particular backend, e.g. how many devices, their properties and so on.
- Loads or imports [executable network](@ref openvino_docs_ie_plugin_dg_executable_network) objects.
- Loads or imports [compiled model](@ref openvino_docs_ov_plugin_dg_compiled_model) objects.
In addition to the Inference Engine Public API, the Inference Engine provides the Plugin API, which is a set of functions and helper classes that simplify new plugin development:
In addition to the OpenVINO Public API, the OpenVINO provides the Plugin API, which is a set of functions and helper classes that simplify new plugin development:
- header files in the `inference_engine/src/plugin_api` directory
- implementations in the `inference_engine/src/inference_engine` directory
- symbols in the Inference Engine Core shared library
- header files in the `src/inference/dev_api/openvino` directory
- implementations in the `src/inference/src/dev/` directory
- symbols in the OpenVINO shared library
To build an Inference Engine plugin with the Plugin API, see the [Inference Engine Plugin Building](@ref openvino_docs_ie_plugin_dg_plugin_build) guide.
To build an OpenVINO plugin with the Plugin API, see the [OpenVINO Plugin Building](@ref openvino_docs_ov_plugin_dg_plugin_build) guide.
Plugin Class
------------------------
Inference Engine Plugin API provides the helper InferenceEngine::IInferencePlugin class recommended to use as a base class for a plugin.
OpenVINO Plugin API provides the helper ov::IPlugin class recommended to use as a base class for a plugin.
Based on that, declaration of a plugin class can look as follows:
@snippet template/src/plugin.hpp plugin:header
#### Class Fields
### Class Fields
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 OpenVINO™ reference implementations.
* `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
* `_cfg` of type `Configuration`:
* `m_backend` - a backend engine that is used to perform actual computations for model inference. For `Template` plugin `ov::runtime::Backend` is used which performs computations using OpenVINO™ reference implementations.
* `m_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
* `m_cfg` of type `Configuration`:
@snippet template/src/template_config.hpp configuration:header
@snippet template/src/config.hpp configuration:header
As an example, a plugin configuration has three value parameters:
- `deviceId` - particular device ID to work with. Applicable if a plugin supports more than one `Template` device. In this case, some plugin methods, like `SetConfig`, `QueryNetwork`, and `LoadNetwork`, must support the CONFIG_KEY(KEY_DEVICE_ID) parameter.
- `perfCounts` - boolean value to identify whether to collect performance counters during [Inference Request](@ref openvino_docs_ie_plugin_dg_infer_request) execution.
- `_streamsExecutorConfig` - configuration of `InferenceEngine::IStreamsExecutor` to handle settings of multi-threaded context.
- `device_id` - particular device ID to work with. Applicable if a plugin supports more than one `Template` device. In this case, some plugin methods, like `set_property`, `query_model`, and `compile_model`, must support the ov::device::id property.
- `perf_counts` - boolean value to identify whether to collect performance counters during [Inference Request](@ref openvino_docs_ov_plugin_dg_infer_request) execution.
- `streams_executor_config` - configuration of `ov::threading::IStreamsExecutor` to handle settings of multi-threaded context.
- `performance_mode` - configuration of `ov::hint::PerformanceMode` to set the performance mode.
- `disable_transformations` - allows to disable transformations which are applied in the process of model compilation.
### Engine Constructor
### Plugin Constructor
A plugin constructor must contain code that checks the ability to work with a device of the `Template`
type. For example, if some drivers are required, the code must check
@@ -50,132 +52,120 @@ driver availability. If a driver is not available (for example, OpenCL runtime i
case of a GPU device or there is an improper version of a driver is on a host machine), an exception
must be thrown from a plugin constructor.
A plugin must define a device name enabled via the `_pluginName` field of a base class:
A plugin must define a device name enabled via the `set_device_name()` method of a base class:
@snippet template/src/plugin.cpp plugin:ctor
### `LoadExeNetworkImpl()`
### Plugin Destructor
**Implementation details:** The base InferenceEngine::IInferencePlugin class provides a common implementation
of the public InferenceEngine::IInferencePlugin::LoadNetwork method that calls plugin-specific `LoadExeNetworkImpl`, which is defined in a derived class.
A plugin destructor must stop all plugins activities, and clean all allocated resources.
This is the most important function of the `Plugin` class and creates an instance of compiled `ExecutableNetwork`,
which holds a backend-dependent compiled graph in an internal representation:
@snippet template/src/plugin.cpp plugin:dtor
@snippet template/src/plugin.cpp plugin:load_exe_network_impl
### compile_model()
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 plugin should implement two `compile_model()` methods: the first one compiles model without remote context, the second one with remote context if plugin supports.
The very important part before creation of `ExecutableNetwork` instance is to call `TransformNetwork` method which applies OpenVINO™ transformation passes.
This is the most important function of the `Plugin` class is to create an instance of compiled `CompiledModel`,
which holds a backend-dependent compiled model in an internal representation:
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.
@snippet template/src/plugin.cpp plugin:compile_model
> **NOTE**: Actual configuration map used in `ExecutableNetwork` is constructed as a base plugin
> configuration set via `Plugin::SetConfig`, where some values are overwritten with `config` passed to `Plugin::LoadExeNetworkImpl`.
> Therefore, the config of `Plugin::LoadExeNetworkImpl` has a higher priority.
@snippet template/src/plugin.cpp plugin:compile_model_with_remote
### `TransformNetwork()`
Before a creation of an `CompiledModel` instance via a constructor, a plugin may check if a provided
ov::Model object is supported by a device if it is needed.
The function accepts a const shared pointer to `ov::Model` object and performs the following steps:
Actual model compilation is done in the `CompiledModel` constructor. Refer to the [CompiledModel Implementation Guide](@ref openvino_docs_ov_plugin_dg_compiled_model) for details.
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 OpenVINO™ transformations](@ref openvino_docs_transformations) guide. See detailed topics about network representation:
> **NOTE**: Actual configuration map used in `CompiledModel` is constructed as a base plugin
> configuration set via `Plugin::set_property`, where some values are overwritten with `config` passed to `Plugin::compile_model`.
> Therefore, the config of `Plugin::compile_model` has a higher priority.
### transform_model()
The function accepts a const shared pointer to `ov::Model` object and applies common and device-specific transformations on a copied model to make it more friendly to hardware operations. For details how to write custom device-specific transformation, please, refer to [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide. See detailed topics about model representation:
* [Intermediate Representation and Operation Sets](@ref openvino_docs_MO_DG_IR_and_opsets)
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks).
* [Quantized models](@ref openvino_docs_ov_plugin_dg_quantized_models).
@snippet template/src/plugin.cpp plugin:transform_network
@snippet template/src/plugin.cpp plugin:transform_model
> **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.
> **NOTE**: After all these transformations, an `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 `transform_model` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
### `QueryNetwork()`
### query_model()
Use the method with the `HETERO` mode, which allows to distribute network execution between different
Use the method with the `HETERO` mode, which allows to distribute model execution between different
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 `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`):
The `query_model` method analyzes operations of provided `model` and returns a list of supported
operations via the ov::SupportedOpsMap structure. The `query_model` firstly applies `transform_model` passes to input `ov::Model` argument. After this, the transformed model 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 (`m_backend` has a kernel for such operation or extensions for the operation is provided) and not supported (kernel is missed in `m_backend`):
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 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`.
2. Apply `transform_model` passes. Note, the names of operations in a transformed model can be different and we need to restore the mapping in the steps below.
3. Construct `supported` map 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. `ov.SupportedOpsMap` contains only operations which are fully supported by `m_backend`.
@snippet template/src/plugin.cpp plugin:query_network
@snippet template/src/plugin.cpp plugin:query_model
### `SetConfig()`
### set_property()
Sets new values for plugin configuration keys:
Sets new values for plugin property keys:
@snippet template/src/plugin.cpp plugin:set_config
@snippet template/src/plugin.cpp plugin:set_property
In the snippet above, the `Configuration` class overrides previous configuration values with the new
ones. All these values are used during backend specific graph compilation and execution of inference requests.
ones. All these values are used during backend specific model compilation and execution of inference requests.
> **NOTE**: The function must throw an exception if it receives an unsupported configuration key.
### `GetConfig()`
### get_property()
Returns a current value for a specified configuration key:
Returns a current value for a specified property key:
@snippet template/src/plugin.cpp plugin:get_config
@snippet template/src/plugin.cpp plugin:get_property
The function is implemented with the `Configuration::Get` method, which wraps an actual configuration
key value to the InferenceEngine::Parameter and returns it.
key value to the ov::Any and returns it.
> **NOTE**: The function must throw an exception if it receives an unsupported configuration key.
### `GetMetric()`
### import_model()
Returns a metric value for a metric with the name `name`. A device metric is a static type of information
from a plugin about its devices or device capabilities.
Examples of metrics:
- METRIC_KEY(AVAILABLE_DEVICES) - list of available devices that are required to implement. In this case, you can use
all devices of the same `Template` type with automatic logic of the `MULTI` device plugin.
- METRIC_KEY(FULL_DEVICE_NAME) - full device name. In this case, a particular device ID is specified
in the `option` parameter as `{ CONFIG_KEY(KEY_DEVICE_ID), "deviceID" }`.
- METRIC_KEY(SUPPORTED_METRICS) - list of metrics supported by a plugin
- METRIC_KEY(SUPPORTED_CONFIG_KEYS) - list of configuration keys supported by a plugin that
affects their behavior during a backend specific graph compilation or an inference requests execution
- METRIC_KEY(OPTIMIZATION_CAPABILITIES) - list of optimization capabilities of a device.
For example, supported data types and special optimizations for them.
- Any other device-specific metrics. In this case, place metrics declaration and possible values to
a plugin-specific public header file, for example, `template/config.hpp`. The example below
demonstrates the definition of a new optimization capability value specific for a device:
@snippet template/config.hpp public_header:properties
The snippet below provides an example of the implementation for `GetMetric`:
> **NOTE**: If an unsupported metric key is passed to the function, it must throw an exception.
### `ImportNetwork()`
The importing network mechanism allows to import a previously exported backend specific graph and wrap it
using an [ExecutableNetwork](@ref openvino_docs_ie_plugin_dg_executable_network) object. This functionality is useful if
backend specific graph compilation takes significant time and/or cannot be done on a target host
The importing of compiled model mechanism allows to import a previously exported backend specific model and wrap it
using an [CompiledModel](@ref openvino_docs_ov_plugin_dg_compiled_model) object. This functionality is useful if
backend specific model compilation takes significant time and/or cannot be done on a target host
device due to other reasons.
During export of backend specific graph using `ExecutableNetwork::Export`, a plugin may export any
type of information it needs to import a compiled graph properly and check its correctness.
During export of backend specific model using `CompiledModel::export_model`, a plugin may export any
type of information it needs to import a compiled model properly and check its correctness.
For example, the export information may include:
- Compilation options (state of `Plugin::_cfg` structure)
- Compilation options (state of `Plugin::m_cfg` structure)
- Information about a plugin and a device type to check this information later during the import and
throw an exception if the `model` stream contains wrong data. For example, if devices have different
capabilities and a graph compiled for a particular device cannot be used for another, such type of
capabilities and a model compiled for a particular device cannot be used for another, such type of
information must be stored and checked during the import.
- Compiled backend specific graph itself
- Information about precisions and shapes set by the user
- Compiled backend specific model itself
@snippet template/src/plugin.cpp plugin:import_network
@snippet template/src/plugin.cpp plugin:import_model
@snippet template/src/plugin.cpp plugin:import_model_with_remote
### create_context()
The Plugin should implement `Plugin::create_context()` method which returns `ov::RemoteContext` in case if plugin supports remote context, in other case the plugin can throw an exception that this method is not implemented.
@snippet template/src/plugin.cpp plugin:create_context
### get_default_context()
`Plugin::get_default_context()` also needed in case if plugin supports remote context, if the plugin doesn't support it, this method can throw an exception that functionality is not implemented.
@snippet template/src/plugin.cpp plugin:get_default_context
Create Instance of Plugin Class
------------------------
Inference Engine plugin library must export only one function creating a plugin instance using IE_DEFINE_PLUGIN_CREATE_FUNCTION macro:
OpenVINO plugin library must export only one function creating a plugin instance using OV_DEFINE_PLUGIN_CREATE_FUNCTION macro:
@snippet template/src/plugin.cpp plugin:create_plugin_engine
Next step in a plugin library implementation is the [ExecutableNetwork](@ref openvino_docs_ie_plugin_dg_executable_network) class.
Next step in a plugin library implementation is the [CompiledModel](@ref openvino_docs_ov_plugin_dg_compiled_model) class.

View File

@@ -1,17 +1,16 @@
# Plugin Testing {#openvino_docs_ie_plugin_dg_plugin_testing}
# Plugin Testing {#openvino_docs_ov_plugin_dg_plugin_testing}
Inference Engine (IE) tests infrastructure provides a predefined set of functional tests and utilities. They are used to verify a plugin using the Inference Engine public API.
OpenVINO tests infrastructure provides a predefined set of functional tests and utilities. They are used to verify a plugin using the OpenVINO public API.
All the tests are written in the [Google Test C++ framework](https://github.com/google/googletest).
Inference Engine Plugin tests are included in the `IE::funcSharedTests` CMake target which is built within the OpenVINO repository
(see [Build Plugin Using CMake](@ref openvino_docs_ie_plugin_dg_plugin_build) guide). This library contains tests definitions (the tests bodies) which can be parametrized and instantiated in plugins depending on whether a plugin supports a particular feature, specific sets of parameters for test on supported operation set and so on.
OpenVINO Plugin tests are included in the `openvino::funcSharedTests` CMake target which is built within the OpenVINO repository
(see [Build Plugin Using CMake](@ref openvino_docs_ov_plugin_dg_plugin_build) guide). This library contains tests definitions (the tests bodies) which can be parametrized and instantiated in plugins depending on whether a plugin supports a particular feature, specific sets of parameters for test on supported operation set and so on.
Test definitions are split into tests class declaration (see `inference_engine/tests/functional/plugin/shared/include`) and tests class implementation (see `inference_engine/tests/functional/plugin/shared/src`) and include the following scopes of plugin conformance tests:
Test definitions are split into tests class declaration (see `src/tests/functional/plugin/shared/include`) and tests class implementation (see `src/tests/functional/plugin/shared/src`) and include the following scopes of plugin conformance tests:
1. **Behavior tests** (`behavior` sub-folder), which are a separate test group to check that a plugin satisfies basic Inference
Engine concepts: plugin creation, multiple executable networks support, multiple synchronous and asynchronous inference requests support, and so on. See the next section with details how to instantiate the tests definition class with plugin-specific parameters.
1. **Behavior tests** (`behavior` sub-folder), which are a separate test group to check that a plugin satisfies basic OpenVINO concepts: plugin creation, multiple compiled models support, multiple synchronous and asynchronous inference requests support, and so on. See the next section with details how to instantiate the tests definition class with plugin-specific parameters.
2. **Single layer tests** (`single_layer_tests` sub-folder). This groups of tests checks that a particular single layer can be inferenced on a device. An example of test instantiation based on test definition from `IE::funcSharedTests` library:
2. **Single layer tests** (`single_layer_tests` sub-folder). This groups of tests checks that a particular single layer can be inferenced on a device. An example of test instantiation based on test definition from `openvino::funcSharedTests` library:
- From the declaration of convolution test class we can see that it's a parametrized GoogleTest based class with the `convLayerTestParamsSet` tuple of parameters:
@snippet single_layer/convolution.hpp test_convolution:definition
@@ -23,29 +22,24 @@ 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 `ov::Model`) and re-used in sub-graph tests after.
> **Note**, such sub-graphs or patterns for sub-graph tests should be added to `openvino::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`).
4. **HETERO tests** (`subgraph_tests` sub-folder) contains tests for `HETERO` scenario (manual or automatic affinities settings, tests for `query_model`).
5. **Other tests**, which contain tests for other scenarios and has the following types of tests:
- Tests for execution graph
- Etc.
To use these tests for your own plugin development, link the `IE::funcSharedTests` library to your test binary and instantiate required test cases with desired parameters values.
To use these tests for your own plugin development, link the `openvino::funcSharedTests` library to your test binary and instantiate required test cases with desired parameters values.
> **NOTE**: A plugin may contain its own tests for use cases that are specific to hardware or need to be extensively tested.
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).
[Build Plugin Using CMake*](@ref openvino_docs_ov_plugin_dg_plugin_build).
### How to Extend Inference Engine Plugin Tests
### How to Extend OpenVINO 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 OpenVINO 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 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 model.
including the corresponding operation.
OpenVINO Plugin tests are open for contribution.
Add common test case definitions applicable for all plugins to the `openvino::funcSharedTests` target within the OpenVINO repository. Then, any other plugin supporting corresponding functionality can instantiate the new test.
> **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

@@ -0,0 +1,10 @@
# Plugin Properties {#openvino_docs_ov_plugin_dg_properties}
Plugin can provide own device specific properties.
Property Class
------------------------
OpenVINO API provides the interface ov::Property which allows to define the property and access rights. Based on that, a declaration of plugin specific properties can look as follows:
@snippet include/template/properties.hpp properties:public_header

View File

@@ -1,8 +1,8 @@
# Quantized networks compute and restrictions {#openvino_docs_ie_plugin_dg_quantized_networks}
# Quantized models compute and restrictions {#openvino_docs_ov_plugin_dg_quantized_models}
One of the feature of Inference Engine is the support of quantized networks with different precisions: INT8, INT4, etc.
One of the feature of OpenVINO is the support of quantized models with different precisions: INT8, INT4, etc.
However, it is up to the plugin to define what exact precisions are supported by the particular HW.
All quantized networks which can be expressed in IR have a unified representation by means of *FakeQuantize* operation.
All quantized models which can be expressed in IR have a unified representation by means of *FakeQuantize* operation.
For more details about low-precision model representation please refer to this [document](@ref openvino_docs_ie_plugin_dg_lp_representation).
### Interpreting FakeQuantize at runtime
@@ -44,6 +44,6 @@ Below we define these rules as follows:
- Per-channel quantization of activations for channel-wise and element-wise operations, e.g. Depthwise Convolution, Eltwise Add/Mul, ScaleShift.
- Symmetric and asymmetric quantization of weights and activations with the support of per-channel scales and zero-points.
- Non-unified quantization parameters for Eltwise and Concat operations.
- Non-quantized network output, i.e. there are no quantization parameters for it.
- Non-quantized models output, i.e. there are no quantization parameters for it.
[qdq_propagation]: images/qdq_propagation.png

View File

@@ -0,0 +1,49 @@
# Remote Context {#openvino_docs_ov_plugin_dg_remote_context}
ov::RemoteContext class functionality:
- Represents device specific inference context.
- Allows to create remote device specific tensor.
> **NOTE**: If plugin provides a public API for own Remote Context, the API should be header only and doesn't depend on the plugin library.
RemoteContext Class
------------------------
OpenVINO Plugin API provides the interface ov::IRemoteContext which should be used as a base class for a plugin specific remote context. Based on that, a declaration of an compiled model class can look as follows:
@snippet src/remote_context.hpp remote_context:header
### Class Fields
The example class has several fields:
- `m_name` - Device name.
- `m_property` - Device specific context properties. It can be used to cast RemoteContext to device specific type.
### RemoteContext Constructor
This constructor should initialize the remote context device name and properties.
@snippet src/remote_context.cpp remote_context:ctor
### get_device_name()
The function returns the device name from the remote context.
@snippet src/remote_context.cpp remote_context:get_device_name
### get_property()
The implementation returns the remote context properties.
@snippet src/remote_context.cpp remote_context:get_property
### create_tensor()
The method creates device specific remote tensor.
@snippet src/remote_context.cpp remote_context:create_tensor
The next step to support device specific tensors is a creation of device specific [Remote Tensor](@ref openvino_docs_ov_plugin_dg_remote_tensor) class.

View File

@@ -0,0 +1,87 @@
# Remote Tensor {#openvino_docs_ov_plugin_dg_remote_tensor}
ov::RemoteTensor class functionality:
- Provide an interface to work with device specific memory.
> **NOTE**: If plugin provides a public API for own Remote Tensor, the API should be header only and doesn't depend on the plugin library.
Device Specific Remote Tensor Public API
------------------------------------------
The public interface to work with device specific remote tensors should have header only implementation and doesn't depend on the plugin library.
@snippet include/template/remote_tensor.hpp remote_tensor:public_header
The implementation below has several methods:
### type_check()
Static method is used to understand that some abstract remote tensor can be casted to this particular remote tensor type.
### get_data()
The set of methods (specific for the example, other implementation can have another API) which are helpers to get an access to remote data.
Device Specific Internal tensor implementation
-----------------------------------------------
The plugin should have the internal implementation of remote tensor which can communicate with public API.
The example contains the implementation of remote tensor which wraps memory from stl vector.
OpenVINO Plugin API provides the interface ov::IRemoteTensor which should be used as a base class for remote tensors.
The example implementation have two remote tensor classes:
- Internal type dependent implementation which has as an template argument the vector type and create the type specific tensor.
- The type independent implementation which works with type dependent tensor inside.
Based on that, an implementation of a type independent remote tensor class can look as follows:
@snippet src/remote_context.cpp vector_impl:implementation
The implementation provides a helper to get wrapped stl tensor and overrides all important methods of ov::IRemoteTensor class and recall the type dependent implementation.
The type dependent remote tensor has the next implementation:
@snippet src/remote_context.cpp vector_impl_t:implementation
### Class Fields
The class has several fields:
- `m_element_type` - Tensor element type.
- `m_shape` - Tensor shape.
- `m_strides` - Tensor strides.
- `m_data` - Wrapped vector.
- `m_dev_name` - Device name.
- `m_properties` - Remote tensor specific properties which can be used to detect the type of the remote tensor.
### VectorTensorImpl()
The constructor of remote tensor implementation. Creates a vector with data, initialize device name and properties, updates shape, element type and strides.
### get_element_type()
The method returns tensor element type.
### get_shape()
The method returns tensor shape.
### get_strides()
The method returns tensor strides.
### set_shape()
The method allows to set new shapes for the remote tensor.
### get_properties()
The method returns tensor specific properties.
### get_device_name()
The method returns tensor specific device name.

View File

@@ -6,13 +6,13 @@
:maxdepth: 1
:hidden:
openvino_docs_ie_plugin_dg_quantized_networks
openvino_docs_ov_plugin_dg_quantized_models
openvino_docs_OV_UG_lpt
@endsphinxdirective
The guides below provides extra information about specific features of OpenVINO needed for understanding during OpenVINO plugin development:
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks)
* [Quantized networks](@ref openvino_docs_ov_plugin_dg_quantized_models)
* [Low precision transformations](@ref openvino_docs_OV_UG_lpt) guide
* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide

View File

@@ -6,12 +6,12 @@
:maxdepth: 1
:hidden:
../groupie_dev_api
../groupov_dev_api
../groupie_transformation_api
@endsphinxdirective
The guides below provides extra API references needed for OpenVINO plugin development:
* [OpenVINO Plugin API](@ref ie_dev_api)
* [OpenVINO Plugin API](@ref ov_dev_api)
* [OpenVINO Transformation API](@ref ie_transformation_api)

View File

@@ -2,9 +2,9 @@
<navindex>
<!-- Steps -->
<tab type="usergroup" url="index.html" visibile="yes" title="GUIDE">
<tab type="usergroup" url="index.html" title="Developer Guide for Inference Engine Plugin Library">
<tab type="usergroup" url="index.html" title="Developer Guide for OpenVINO Plugin Library">
<tab type="user" url="@ref plugin" visibile="yes" title="Implement Plugin Functionality"/>
<tab type="user" url="@ref executable_network" visibile="yes" title="Implement Executable Network Functionality">
<tab type="user" url="@ref compiled_model" visibile="yes" title="Implement Executable Network Functionality">
<tab type="usergroup" title="Low Precision Transformations" url="@ref openvino_docs_OV_UG_lpt">
<tab type="user" title="Attributes" url="@ref openvino_docs_OV_UG_lpt_attributes">
<tab type="user" title="AvgPoolPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved"/>
@@ -25,6 +25,7 @@
<tab type="user" title="CreateAttribute" url="@ref openvino_docs_OV_UG_lpt_CreateAttribute"/>
<tab type="user" title="CreatePrecisionsDependentAttribute" url="@ref openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute"/>
<tab type="user" title="MarkupAvgPoolPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved"/>
<tab type="user" title="MarkupBias" url="@ref openvino_docs_OV_UG_lpt_MarkupBias"/>
<tab type="user" title="MarkupCanBeQuantized" url="@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized"/>
<tab type="user" title="MarkupPerTensorQuantization" url="@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization"/>
<tab type="user" title="MarkupPrecisions" url="@ref openvino_docs_OV_UG_lpt_MarkupPrecisions"/>
@@ -79,6 +80,9 @@
</tab>
<tab type="user" url="@ref infer_request" visibile="yes" title="Implement Synchronous Inference Request"/>
<tab type="user" url="@ref async_infer_request" visibile="yes" title="Implement Asynchronous Inference Request"/>
<tab type="user" url="@ref properties" visibile="yes" title="Provide Plugin Specific Properties"/>
<tab type="user" url="@ref remote_context" visibile="yes" title="Implement Remote Context"/>
<tab type="user" url="@ref remote_tensor" visibile="yes" title="Implement Remote Tensor"/>
</tab>
</tab>
<!-- Additional resources -->
@@ -89,10 +93,10 @@
</tab>
<!-- API References -->
<tab type="usergroup" title="API REFERENCE">
<!-- IE Plugin API -->
<tab type="user" url="group__ie__dev__api.html" visible="yes" title="Inference Engine Plugin API Reference"/>
<!-- IE Transformations API -->
<tab type="user" url="group__ie__transformation__api.html" visible="yes" title="Inference Engine Transformations API Reference"/>
<!-- OpenVINO Plugin API -->
<tab type="user" url="group__ov__dev__api.html" visible="yes" title="OpenVINO Plugin API Reference"/>
<!-- OpenVINO Transformations API -->
<tab type="user" url="group__ie__transformation__api.html" visible="yes" title="OpenVINO Transformations API Reference"/>
</tab>
<tab type="usergroup" title="MAIN OPENVINO™ DOCS" url="../index.html"/>
</navindex>

View File

@@ -128,6 +128,7 @@ The model on this step is changed. There are more details in developer guide [Pr
### Step 2. Markup
This step creates runtime attributes for operations. These attributes will be used in next step. Transformations:
* [MarkupBias](@ref openvino_docs_OV_UG_lpt_MarkupBias)
* [MarkupCanBeQuantized](@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized)
* [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions)
* [MarkupPerTensorQuantization](@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization)

View File

@@ -2,18 +2,20 @@
This step defines the optimal `FakeQuantize` decomposition precisions for the best inference performance via operations markup with runtime attribute instances. Attributes are created for input and output ports and operations. Transformations do not change the operation output port precisions. A model markup low precision logic is decomposed and implemented into the following common markup transformations. The order of transformations is important:
1. [MarkupCanBeQuantized](@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized)
2. [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions)
3. [MarkupPerTensorQuantization](@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization)
4. [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved)
5. [PropagatePrecisions](@ref openvino_docs_OV_UG_lpt_PropagatePrecisions)
6. [AlignQuantizationIntervals](@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals)
7. [AlignQuantizationParameters](@ref openvino_docs_OV_UG_lpt_AlignQuantizationParameters)
1. [MarkupBias](@ref openvino_docs_OV_UG_lpt_MarkupBias)
2. [MarkupCanBeQuantized](@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized)
3. [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions)
4. [MarkupPerTensorQuantization](@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization)
5. [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved)
6. [PropagatePrecisions](@ref openvino_docs_OV_UG_lpt_PropagatePrecisions)
7. [AlignQuantizationIntervals](@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals)
8. [AlignQuantizationParameters](@ref openvino_docs_OV_UG_lpt_AlignQuantizationParameters)
The table of transformations and used attributes:
| Transformation name | Create attributes | Use attributes |
|---------------------------------|-------------------------------|-------------------------------------------|
| MarkupBias | Bias | |
| MarkupCanBeQuantized | Precisions | |
| MarkupPrecisions | Precisions,PrecisionPreserved | |
| MarkupPerTensorQuantization | PerTensorQuantization | |

View File

@@ -0,0 +1,3 @@
# MarkupBias transformation {#openvino_docs_OV_UG_lpt_MarkupBias}
ngraph::pass::low_precision::MarkupBias class represents the `MarkupBias` transformation.

View File

@@ -1,5 +1,8 @@
# Legal Information {#openvino_docs_Legal_Information}
@sphinxdirective
Performance varies by use, configuration and other factors. Learn more at [www.intel.com/PerformanceIndex](https://www.intel.com/PerformanceIndex).
Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available updates. See backup for configuration details. No product or component can be absolutely secure.
@@ -12,9 +15,16 @@ OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Kh
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.
## OpenVINO™ Logo
OpenVINO™ Logo
###########################################################
To build equity around the project, the OpenVINO logo was created for both Intel and community usage. The logo may only be used to represent the OpenVINO toolkit and offerings built using the OpenVINO toolkit.
## Logo Usage Guidelines
Logo Usage Guidelines
###########################################################
The OpenVINO logo must be used in connection with truthful, non-misleading references to the OpenVINO toolkit, and for no other purpose.
Modification of the logo or use of any separate element(s) of the logo alone is not allowed.
Modification of the logo or use of any separate element(s) of the logo alone is not allowed.
@endsphinxdirective

View File

@@ -15,102 +15,128 @@
openvino_docs_MO_DG_FP16_Compression
openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ
@endsphinxdirective
Model Optimizer is a cross-platform command-line tool that facilitates the transition between training and deployment environments, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices.
To use it, you need a pre-trained deep learning model in one of the supported formats: TensorFlow, PyTorch, PaddlePaddle, MXNet, Caffe, Kaldi, or ONNX. Model Optimizer converts the model to the OpenVINO Intermediate Representation format (IR), which you can infer later with [OpenVINO™ Runtime](../OV_Runtime_UG/openvino_intro.md).
To use it, you need a pre-trained deep learning model in one of the supported formats: TensorFlow, PyTorch, PaddlePaddle, MXNet, Caffe, Kaldi, or ONNX. Model Optimizer converts the model to the OpenVINO Intermediate Representation format (IR), which you can infer later with :doc:`OpenVINO™ Runtime <openvino_docs_OV_UG_OV_Runtime_User_Guide>`.
Note that Model Optimizer does not infer models.
The figure below illustrates the typical workflow for deploying a trained deep learning model:
![](img/BASIC_FLOW_MO_simplified.svg)
.. image:: _static/images/BASIC_FLOW_MO_simplified.svg
where IR is a pair of files describing the model:
* <code>.xml</code> - Describes the network topology.
* ``.xml`` - Describes the network topology.
* <code>.bin</code> - Contains the weights and biases binary data.
* ``.bin`` - Contains the weights and biases binary data.
The OpenVINO IR can be additionally optimized for inference by [Post-training optimization](../../tools/pot/docs/Introduction.md) that applies post-training quantization methods.
The OpenVINO IR can be additionally optimized for inference by :doc:`Post-training optimization <pot_introduction>` that applies post-training quantization methods.
## How to Run Model Optimizer
How to Run Model Optimizer
##########################
To convert a model to IR, you can run Model Optimizer by using the following command:
```sh
mo --input_model INPUT_MODEL
```
.. code-block:: sh
If the out-of-the-box conversion (only the `--input_model` parameter is specified) is not successful, use the parameters mentioned below to override input shapes and cut the model:
mo --input_model INPUT_MODEL
- Model Optimizer provides two parameters to override original input shapes for model conversion: `--input` and `--input_shape`.
For more information about these parameters, refer to the [Setting Input Shapes](prepare_model/convert_model/Converting_Model.md) guide.
If the out-of-the-box conversion (only the ``--input_model`` parameter is specified) is not successful, use the parameters mentioned below to override input shapes and cut the model:
- Model Optimizer provides two parameters to override original input shapes for model conversion: ``--input`` and ``--input_shape``.
For more information about these parameters, refer to the :doc:`Setting Input Shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
- To cut off unwanted parts of a model (such as unsupported operations and training sub-graphs),
use the `--input` and `--output` parameters to define new inputs and outputs of the converted model.
For a more detailed description, refer to the [Cutting Off Parts of a Model](prepare_model/convert_model/Cutting_Model.md) guide.
use the ``--input`` and ``--output`` parameters to define new inputs and outputs of the converted model.
For a more detailed description, refer to the :doc:`Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>` guide.
You can also insert additional input pre-processing sub-graphs into the converted model by using
the `--mean_values`, `scales_values`, `--layout`, and other parameters described
in the [Embedding Preprocessing Computation](prepare_model/Additional_Optimizations.md) article.
the ``--mean_values``, ``scales_values``, ``--layout``, and other parameters described
in the :doc:`Embedding Preprocessing Computation <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` article.
The `--compress_to_fp16` compression parameter in Model Optimizer allows generating IR with constants (for example, weights for convolutions and matrix multiplications) compressed to `FP16` data type. For more details, refer to the [Compression of a Model to FP16](prepare_model/FP16_Compression.md) guide.
The ``--compress_to_fp16`` compression parameter in Model Optimizer allows generating IR with constants (for example, weights for convolutions and matrix multiplications) compressed to ``FP16`` data type. For more details, refer to the :doc:`Compression of a Model to FP16 <openvino_docs_MO_DG_FP16_Compression>` guide.
To get the full list of conversion parameters available in Model Optimizer, run the following command:
```sh
mo --help
```
.. code-block:: sh
## Examples of CLI Commands
mo --help
Examples of CLI Commands
########################
Below is a list of separate examples for different frameworks and Model Optimizer parameters:
1. Launch Model Optimizer for a TensorFlow MobileNet model in the binary protobuf format:
```sh
mo --input_model MobileNet.pb
```
Launch Model Optimizer for a TensorFlow BERT model in the SavedModel format with three inputs. Specify input shapes explicitly
where the batch size and the sequence length equal 2 and 30 respectively:
```sh
mo --saved_model_dir BERT --input mask,word_ids,type_ids --input_shape [2,30],[2,30],[2,30]
```
For more information, refer to the [Converting a TensorFlow Model](prepare_model/convert_model/Convert_Model_From_TensorFlow.md) guide.
.. code-block:: sh
mo --input_model MobileNet.pb
Launch Model Optimizer for a TensorFlow BERT model in the SavedModel format with three inputs. Specify input shapes explicitly where the batch size and the sequence length equal 2 and 30 respectively:
.. code-block:: sh
mo --saved_model_dir BERT --input mask,word_ids,type_ids --input_shape [2,30],[2,30],[2,30]
For more information, refer to the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
2. Launch Model Optimizer for an ONNX OCR model and specify new output explicitly:
```sh
mo --input_model ocr.onnx --output probabilities
```
For more information, refer to the [Converting an ONNX Model](prepare_model/convert_model/Convert_Model_From_ONNX.md) guide.
> **NOTE**: PyTorch models must be exported to the ONNX format before conversion into IR. More information can be found in [Converting a PyTorch Model](prepare_model/convert_model/Convert_Model_From_PyTorch.md).
.. code-block:: sh
mo --input_model ocr.onnx --output probabilities
For more information, refer to the :doc:`Converting an ONNX Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>` guide.
.. note::
PyTorch models must be exported to the ONNX format before conversion into IR. More information can be found in :doc:`Converting a PyTorch Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>`.
3. Launch Model Optimizer for a PaddlePaddle UNet model and apply mean-scale normalization to the input:
```sh
mo --input_model unet.pdmodel --mean_values [123,117,104] --scale 255
```
For more information, refer to the [Converting a PaddlePaddle Model](prepare_model/convert_model/Convert_Model_From_Paddle.md) guide.
.. code-block:: sh
mo --input_model unet.pdmodel --mean_values [123,117,104] --scale 255
For more information, refer to the :doc:`Converting a PaddlePaddle Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>` guide.
4. Launch Model Optimizer for an Apache MXNet SSD Inception V3 model and specify first-channel layout for the input:
```sh
mo --input_model ssd_inception_v3-0000.params --layout NCHW
```
For more information, refer to the [Converting an Apache MXNet Model](prepare_model/convert_model/Convert_Model_From_MxNet.md) guide.
.. code-block:: sh
mo --input_model ssd_inception_v3-0000.params --layout NCHW
For more information, refer to the :doc:`Converting an Apache MXNet Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_MxNet>` guide.
5. Launch Model Optimizer for a Caffe AlexNet model with input channels in the RGB format which needs to be reversed:
```sh
mo --input_model alexnet.caffemodel --reverse_input_channels
```
For more information, refer to the [Converting a Caffe Model](prepare_model/convert_model/Convert_Model_From_Caffe.md) guide.
.. code-block:: sh
mo --input_model alexnet.caffemodel --reverse_input_channels
For more information, refer to the :doc:`Converting a Caffe Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe>` guide.
6. Launch Model Optimizer for a Kaldi LibriSpeech nnet2 model:
```sh
mo --input_model librispeech_nnet2.mdl --input_shape [1,140]
```
For more information, refer to the [Converting a Kaldi Model](prepare_model/convert_model/Convert_Model_From_Kaldi.md) guide.
- To get conversion recipes for specific TensorFlow, ONNX, PyTorch, Apache MXNet, and Kaldi models,
refer to the [Model Conversion Tutorials](prepare_model/convert_model/Convert_Model_Tutorials.md).
- For more information about IR, see [Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™](IR_and_opsets.md).
.. code-block:: sh
mo --input_model librispeech_nnet2.mdl --input_shape [1,140]
For more information, refer to the :doc:`Converting a Kaldi Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Kaldi>` guide.
- To get conversion recipes for specific TensorFlow, ONNX, PyTorch, Apache MXNet, and Kaldi models, refer to the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>`.
- For more information about IR, see :doc:`Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ <openvino_docs_MO_DG_IR_and_opsets>`.
@endsphinxdirective

View File

@@ -1,102 +1,156 @@
# Embedding Preprocessing Computation {#openvino_docs_MO_DG_Additional_Optimization_Use_Cases}
Input data for inference can be different from the training dataset and requires additional preprocessing before inference.
To accelerate the whole pipeline including preprocessing and inference, Model Optimizer provides special parameters such as `--mean_values`,
@sphinxdirective
`--scale_values`, `--reverse_input_channels`, and `--layout`. Based on these parameters, Model Optimizer generates OpenVINO IR with additionally
inserted sub-graphs to perform the defined preprocessing. This preprocessing block can perform mean-scale normalization of input data,
reverting data along channel dimension, and changing the data layout.
See the following sections for details on the parameters, or the [Overview of Preprocessing API](../../OV_Runtime_UG/preprocessing_overview.md) for the same functionality in OpenVINO Runtime.
Input data for inference can be different from the training dataset and requires
additional preprocessing before inference. To accelerate the whole pipeline including
preprocessing and inference, Model Optimizer provides special parameters such as ``--mean_values``,
## Specifying Layout
``--scale_values``, ``--reverse_input_channels``, and ``--layout``. Based on these
parameters, Model Optimizer generates OpenVINO IR with additionally inserted sub-graphs
to perform the defined preprocessing. This preprocessing block can perform mean-scale
normalization of input data, reverting data along channel dimension, and changing
the data layout. See the following sections for details on the parameters, or the
:doc:`Overview of Preprocessing API <openvino_docs_OV_UG_Preprocessing_Overview>`
for the same functionality in OpenVINO Runtime.
You may need to set input layouts, as it is required by some preprocessing, for example, setting a batch, applying mean or scales, and reversing input channels (BGR<->RGB).
Specifying Layout
#################
Layout defines the meaning of dimensions in shape and can be specified for both inputs and outputs. Some preprocessing requires to set input layouts, for example, setting a batch, applying mean or scales, and reversing input channels (BGR<->RGB).
You may need to set input layouts, as it is required by some preprocessing, for
example, setting a batch, applying mean or scales, and reversing input channels (BGR<->RGB).
For the layout syntax, check the [Layout API overview](../../OV_Runtime_UG/layout_overview.md).
To specify the layout, you can use the `--layout` option followed by the layout value.
Layout defines the meaning of dimensions in shape and can be specified for both
inputs and outputs. Some preprocessing requires to set input layouts, for example,
setting a batch, applying mean or scales, and reversing input channels (BGR<->RGB).
For example, the following command specifies the `NHWC` layout for a Tensorflow `nasnet_large` model that was exported to the ONNX format:
For the layout syntax, check the :doc:`Layout API overview <openvino_docs_OV_UG_Layout_Overview>`.
To specify the layout, you can use the ``--layout`` option followed by the layout value.
```
mo --input_model tf_nasnet_large.onnx --layout nhwc
```
For example, the following command specifies the ``NHWC`` layout for a Tensorflow
``nasnet_large`` model that was exported to the ONNX format:
Additionally, if a model has more than one input or needs both input and output layouts specified, you need to provide the name of each input or output to apply the layout.
.. code-block:: sh
For example, the following command specifies the layout for an ONNX `Yolo v3 Tiny` model with its first input `input_1` in `NCHW` layout and second input `image_shape` having two dimensions: batch and size of the image expressed as the `N?` layout:
mo --input_model tf_nasnet_large.onnx --layout nhwc
```
mo --input_model yolov3-tiny.onnx --layout input_1(nchw),image_shape(n?)
```
## Changing Model Layout
Additionally, if a model has more than one input or needs both input and output
layouts specified, you need to provide the name of each input or output to apply the layout.
For example, the following command specifies the layout for an ONNX ``Yolo v3 Tiny``
model with its first input ``input_1`` in ``NCHW`` layout and second input ``image_shape``
having two dimensions: batch and size of the image expressed as the ``N?`` layout:
.. code-block:: sh
mo --input_model yolov3-tiny.onnx --layout input_1(nchw),image_shape(n?)
Changing Model Layout
#####################
Changing the model layout may be necessary if it differs from the one presented by input data.
Use either `--layout` or `--source_layout` with `--target_layout` to change the layout.
Use either ``--layout`` or ``--source_layout`` with ``--target_layout`` to change the layout.
For example, for the same `nasnet_large` model mentioned previously, you can use the following commands to provide data in the `NCHW` layout:
For example, for the same ``nasnet_large`` model mentioned previously, you can use
the following commands to provide data in the ``NCHW`` layout:
```
mo --input_model tf_nasnet_large.onnx --source_layout nhwc --target_layout nchw
mo --input_model tf_nasnet_large.onnx --layout "nhwc->nchw"
```
.. code-block:: sh
Again, if a model has more than one input or needs both input and output layouts specified, you need to provide the name of each input or output to apply the layout.
mo --input_model tf_nasnet_large.onnx --source_layout nhwc --target_layout nchw
mo --input_model tf_nasnet_large.onnx --layout "nhwc->nchw"
For example, to provide data in the `NHWC` layout for the `Yolo v3 Tiny` model mentioned earlier, use the following commands:
```
mo --input_model yolov3-tiny.onnx --source_layout "input_1(nchw),image_shape(n?)" --target_layout "input_1(nhwc)"
mo --input_model yolov3-tiny.onnx --layout "input_1(nchw->nhwc),image_shape(n?)"
```
Again, if a model has more than one input or needs both input and output layouts
specified, you need to provide the name of each input or output to apply the layout.
## Specifying Mean and Scale Values
Neural network models are usually trained with the normalized input data. This means that the input data values are converted to be in a specific range,
for example, `[0, 1]` or `[-1, 1]`. Sometimes, the mean values (mean images) are subtracted from the input data values as part of the preprocessing.
For example, to provide data in the ``NHWC`` layout for the `Yolo v3 Tiny` model
mentioned earlier, use the following commands:
.. code-block:: sh
mo --input_model yolov3-tiny.onnx --source_layout "input_1(nchw),image_shape(n?)" --target_layout "input_1(nhwc)"
mo --input_model yolov3-tiny.onnx --layout "input_1(nchw->nhwc),image_shape(n?)"
Specifying Mean and Scale Values
################################
Neural network models are usually trained with the normalized input data. This
means that the input data values are converted to be in a specific range, for example,
``[0, 1]`` or ``[-1, 1]``. Sometimes, the mean values (mean images) are subtracted
from the input data values as part of the preprocessing.
There are two cases of how the input data preprocessing is implemented.
* The input preprocessing operations are a part of a model.
In this case, the application does not perform a separate preprocessing step: everything is embedded into the model itself. Model Optimizer will generate the OpenVINO IR format with required preprocessing operations, and no `mean` and `scale` parameters are required.
* The input preprocessing operations are not a part of a model and the preprocessing is performed within the application which feeds the model with input data.
* The input preprocessing operations are a part of a model.
In this case, information about mean/scale values should be provided to Model Optimizer to embed it to the generated OpenVINO IR format.
In this case, the application does not perform a separate preprocessing step:
everything is embedded into the model itself. Model Optimizer will generate the
OpenVINO IR format with required preprocessing operations, and no ``mean`` and
``scale`` parameters are required.
* The input preprocessing operations are not a part of a model and the preprocessing
is performed within the application which feeds the model with input data.
Model Optimizer provides command-line parameters to specify the values: `--mean_values`, `--scale_values`, `--scale`.
Using these parameters, Model Optimizer embeds the corresponding preprocessing block for mean-value normalization of the input data
In this case, information about mean/scale values should be provided to Model
Optimizer to embed it to the generated OpenVINO IR format.
Model Optimizer provides command-line parameters to specify the values: ``--mean_values``,
``--scale_values``, ``--scale``. Using these parameters, Model Optimizer embeds the
corresponding preprocessing block for mean-value normalization of the input data
and optimizes this block so that the preprocessing takes negligible time for inference.
For example, the following command runs Model Optimizer for the PaddlePaddle UNet model and applies mean-scale normalization to the input data:
For example, the following command runs Model Optimizer for the PaddlePaddle UNet
model and applies mean-scale normalization to the input data:
```sh
mo --input_model unet.pdmodel --mean_values [123,117,104] --scale 255
```
.. code-block:: sh
## Reversing Input Channels <a name="when_to_reverse_input_channels"></a>
Sometimes, input images for your application can be of the RGB (or BGR) format and the model is trained on images of the BGR (or RGB) format,
which is in the opposite order of color channels. In this case, it is important to preprocess the input images by reverting the color channels before inference.
mo --input_model unet.pdmodel --mean_values [123,117,104] --scale 255
To embed this preprocessing step into OpenVINO IR, Model Optimizer provides the `--reverse_input_channels` command-line parameter to shuffle the color channels.
The `--reverse_input_channels` parameter can be used to preprocess the model input in the following cases:
* Only one dimension in the input shape has a size equal to 3.
* One dimension has an undefined size and is marked as `C` channel using `layout` parameters.
Reversing Input Channels
########################
Using the `--reverse_input_channels` parameter, Model Optimizer embeds the corresponding preprocessing block for reverting
the input data along channel dimension and optimizes this block so that the preprocessing takes only negligible time for inference.
Sometimes, input images for your application can be of the RGB (or BGR) format
and the model is trained on images of the BGR (or RGB) format, which is in the
opposite order of color channels. In this case, it is important to preprocess the
input images by reverting the color channels before inference.
For example, the following command launches Model Optimizer for the TensorFlow AlexNet model and embeds the `reverse_input_channel` preprocessing block into OpenVINO IR:
To embed this preprocessing step into OpenVINO IR, Model Optimizer provides the
``--reverse_input_channels`` command-line parameter to shuffle the color channels.
```sh
mo --input_model alexnet.pb --reverse_input_channels
```
The ``--reverse_input_channels`` parameter can be used to preprocess the model
input in the following cases:
> **NOTE**: If both mean and scale values are specified, the mean is subtracted first and then the scale is applied regardless of the order of options
in the command-line. Input values are *divided* by the scale value(s). If the `--reverse_input_channels` option is also used, `reverse_input_channels`
will be applied first, then `mean` and after that `scale`. The data flow in the model looks as follows:
`Parameter -> ReverseInputChannels -> Mean apply-> Scale apply -> the original body of the model`.
* Only one dimension in the input shape has a size equal to ``3``.
* One dimension has an undefined size and is marked as ``C`` channel using ``layout`` parameters.
Using the ``--reverse_input_channels`` parameter, Model Optimizer embeds the corresponding
preprocessing block for reverting the input data along channel dimension and optimizes
this block so that the preprocessing takes only negligible time for inference.
For example, the following command launches Model Optimizer for the TensorFlow AlexNet
model and embeds the ``reverse_input_channel`` preprocessing block into OpenVINO IR:
.. code-block:: sh
mo --input_model alexnet.pb --reverse_input_channels
.. note::
If both mean and scale values are specified, the mean is subtracted first and
then the scale is applied regardless of the order of options in the command-line.
Input values are *divided* by the scale value(s). If the ``--reverse_input_channels``
option is also used, ``reverse_input_channels`` will be applied first, then ``mean``
and after that ``scale``. The data flow in the model looks as follows:
``Parameter -> ReverseInputChannels -> Mean apply-> Scale apply -> the original body of the model``.
Additional Resources
####################
* :doc:`Overview of Preprocessing API <openvino_docs_OV_UG_Preprocessing_Overview>`
@endsphinxdirective
## Additional Resources
* [Overview of Preprocessing API](../../OV_Runtime_UG/preprocessing_overview.md)

View File

@@ -1,20 +1,29 @@
# Compressing a Model to FP16 {#openvino_docs_MO_DG_FP16_Compression}
Model Optimizer can convert all floating-point weights to `FP16` data type. The resulting IR is called
compressed `FP16` model. The resulting model will occupy about twice as less space in the file system,
but it may have some accuracy drop. For most models, the accuracy drop is negligible.
@sphinxdirective
To compress the model, use the `--compress_to_fp16` option:
> **NOTE**: Starting from the 2022.3 release, option --data_type is deprecated.
> Instead of --data_type FP16 use --compress_to_fp16.
> Using `--data_type FP32` will give no result and will not force `FP32` precision in
> the model. If the model has `FP16` constants, such constants will have `FP16` precision in IR as well.
Model Optimizer by default converts all floating-point weights to ``FP16`` data type.
The resulting IR is called compressed ``FP16`` model. The resulting model will occupy
about twice as less space in the file system, but it may have some accuracy drop.
For most models, the accuracy drop is negligible. But in case if accuracy drop is
significant user can disable compression explicitly.
```
mo --input_model INPUT_MODEL --compress_to_fp16
```
By default, models are compressed to ``FP16``, but you can disable compression by
specifying ``--compress_to_fp16=False``:
For details on how plugins handle compressed `FP16` models, see [Working with devices](../../OV_Runtime_UG/supported_plugins/Device_Plugins.md).
.. code-block:: sh
> **NOTE**: `FP16` compression is sometimes used as the initial step for `INT8` quantization.
> Refer to the [Post-training optimization](../../../tools/pot/docs/Introduction.md) guide for more information about that.
mo --input_model INPUT_MODEL --compress_to_fp16=False
For details on how plugins handle compressed ``FP16`` models, see
:doc:`Working with devices <openvino_docs_OV_UG_Working_with_devices>`.
.. note::
``FP16`` compression is sometimes used as the initial step for ``INT8`` quantization.
Refer to the :doc:`Post-training optimization <pot_introduction>` guide for more
information about that.
@endsphinxdirective

View File

@@ -1,109 +1,168 @@
# Getting Performance Numbers {#openvino_docs_MO_DG_Getting_Performance_Numbers}
This guide explains how to use the benchmark_app to get performance numbers. It also explains how the performance numbers are reflected through internal inference performance counters and execution graphs. It also includes information on using ITT and Intel® VTune™ Profiler to get performance insights.
## Test performance with the benchmark_app
@sphinxdirective
### Prerequisites
This guide explains how to use the benchmark_app to get performance numbers. It also explains how the performance
numbers are reflected through internal inference performance counters and execution graphs. It also includes
information on using ITT and Intel® VTune™ Profiler to get performance insights.
To run benchmarks, you need both OpenVINO developer tools and Runtime installed. Follow the [Installation guide](../../install_guides/installing-model-dev-tools.md) and make sure to install the latest general release package with support for frameworks of the models you want to test.
Test performance with the benchmark_app
###########################################################
To test performance of your model, make sure you [prepare the model for use with OpenVINO](../../Documentation/model_introduction.md). For example, if you use [OpenVINO's automation tools](@ref omz_tools_downloader), these two lines of code will download the resnet-50-tf and convert it to OpenVINO IR.
Prerequisites
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To run benchmarks, you need both OpenVINO developer tools and Runtime installed. Follow the
:doc:`Installation guide <openvino_docs_install_guides_install_dev_tools>` and make sure to install the latest
general release package with support for frameworks of the models you want to test.
To test performance of your model, make sure you :doc:`prepare the model for use with OpenVINO <openvino_docs_model_processing_introduction>`.
For example, if you use :doc:`OpenVINO's automation tools <omz_tools_downloader>`, these two lines of code will download the
resnet-50-tf and convert it to OpenVINO IR.
.. code-block:: bash
```bash
omz_downloader --name resnet-50-tf
omz_converter --name resnet-50-tf
```
### Running the benchmark application
For a detailed description, see the dedicated articles: [benchmark_app for C++](../../../samples/cpp/benchmark_app/README.md) and [benchmark_app for Python](../../../tools/benchmark_tool/README.md).
Running the benchmark application
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
For a detailed description, see the dedicated articles:
:doc:`benchmark_app for C++ <openvino_inference_engine_samples_benchmark_app_README>` and
:doc:`benchmark_app for Python <openvino_inference_engine_tools_benchmark_tool_README>`.
The benchmark_app includes a lot of device-specific options, but the primary usage is as simple as:
```bash
.. code-block:: bash
benchmark_app -m <model> -d <device> -i <input>
```
Each of the [OpenVINO supported devices](../../OV_Runtime_UG/supported_plugins/Supported_Devices.md) offers performance settings that contain command-line equivalents in the Benchmark app.
While these settings provide really low-level control for the optimal model performance on the _specific_ device, it is recommended to always start performance evaluation with the [OpenVINO High-Level Performance Hints](../../OV_Runtime_UG/performance_hints.md) first, like so:
Each of the :doc:`OpenVINO supported devices <openvino_docs_OV_UG_supported_plugins_Supported_Devices>` offers
performance settings that contain command-line equivalents in the Benchmark app.
While these settings provide really low-level control for the optimal model performance on the *specific* device,
it is recommended to always start performance evaluation with the :doc:`OpenVINO High-Level Performance Hints <openvino_docs_OV_UG_Performance_Hints>` first, like so:
.. code-block:: bash
```bash
# for throughput prioritization
benchmark_app -hint tput -m <model> -d <device>
# for latency prioritization
benchmark_app -hint latency -m <model> -d <device>
```
## Additional benchmarking considerations
### 1 - Select a Proper Set of Operations to Measure
Additional benchmarking considerations
###########################################################
1 - Select a Proper Set of Operations to Measure
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When evaluating performance of a model with OpenVINO Runtime, it is required to measure a proper set of operations.
- Avoid including one-time costs such as model loading.
- Track operations that occur outside OpenVINO Runtime (such as video decoding) separately.
> **NOTE**: Some image pre-processing can be baked into OpenVINO IR and accelerated accordingly. For more information, refer to [Embedding the Pre-processing](Additional_Optimizations.md) and [General Runtime Optimizations](../../optimization_guide/dldt_deployment_optimization_common.md).
### 2 - Try to Get Credible Data
.. note::
Performance conclusions should be build upon reproducible data. As for the performance measurements, they should be done with a large number of invocations of the same routine. Since the first iteration is almost always significantly slower than the subsequent ones, an aggregated value can be used for the execution time for final projections:
- 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.
- If the time values range too much, consider geomean.
- Be aware of the throttling and other power oddities. A device can exist in one of several different power states. When optimizing your model, consider fixing the device frequency for better performance data reproducibility. However, the end-to-end (application) benchmarking should also be performed under real operational conditions.
Some image pre-processing can be baked into OpenVINO IR and accelerated accordingly. For more information,
refer to :doc:`Embedding Pre-processing <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` and
:doc:`General Runtime Optimizations <openvino_docs_deployment_optimization_guide_common>`.
### 3 - Compare Performance with Native/Framework Code
2 - Try to Get Credible Data
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Performance conclusions should be build upon reproducible data. As for the performance measurements, they should
be done with a large number of invocations of the same routine. Since the first iteration is almost always significantly
slower than the subsequent ones, an aggregated value can be used for the execution time for final projections:
- 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.
- If the time values range too much, consider geomean.
- Be aware of the throttling and other power oddities. A device can exist in one of several different power states.
When optimizing your model, consider fixing the device frequency for better performance data reproducibility.
However, the end-to-end (application) benchmarking should also be performed under real operational conditions.
3 - Compare Performance with Native/Framework Code
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When comparing the OpenVINO Runtime performance with the framework or another reference code, make sure that both versions are as similar as possible:
- Wrap the exact inference execution (refer to the [Benchmark app](../../../samples/cpp/benchmark_app/README.md) for examples).
- Wrap the exact inference execution (for examples, see :doc:`Benchmark app <openvino_inference_engine_samples_benchmark_app_README>`).
- Do not include model loading time.
- Ensure that the inputs are identical for OpenVINO Runtime and the framework. For example, watch out for random values that can be used to populate the inputs.
- In situations when any user-side pre-processing should be tracked separately, consider [image pre-processing and conversion](../../OV_Runtime_UG/preprocessing_overview.md).
- When applicable, leverage the [Dynamic Shapes support](../../OV_Runtime_UG/ov_dynamic_shapes.md).
- If possible, demand the same accuracy. For example, TensorFlow allows `FP16` execution, so when comparing to that, make sure to test the OpenVINO Runtime with the `FP16` as well.
- In situations when any user-side pre-processing should be tracked separately, consider :doc:`image pre-processing and conversion <openvino_docs_OV_UG_Preprocessing_Overview>`.
- When applicable, leverage the :doc:`Dynamic Shapes support <openvino_docs_OV_UG_DynamicShapes>`.
- If possible, demand the same accuracy. For example, TensorFlow allows ``FP16`` execution, so when comparing to that, make sure to test the OpenVINO Runtime with the ``FP16`` as well.
### Internal Inference Performance Counters and Execution Graphs <a name="performance-counters"></a>
Internal Inference Performance Counters and Execution Graphs
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
More detailed insights into inference performance breakdown can be achieved with device-specific performance counters and/or execution graphs.
Both [C++](../../../samples/cpp/benchmark_app/README.md) and [Python](../../../tools/benchmark_tool/README.md) versions of the `benchmark_app` support a `-pc` command-line parameter that outputs internal execution breakdown.
Both :doc:`C++ <openvino_inference_engine_samples_benchmark_app_README>` and :doc:`Python <openvino_inference_engine_tools_benchmark_tool_README>`
versions of the *benchmark_app* support a ``-pc`` command-line parameter that outputs internal execution breakdown.
For example, the table shown below is part of performance counters for quantized [TensorFlow implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on [CPU Plugin](../../OV_Runtime_UG/supported_plugins/CPU.md).
Keep in mind that since the device is CPU, the `realTime` wall clock and the `cpu` time layers are the same. Information about layer precision is also stored in the performance counters.
| layerName | execStatus | layerType | execType | realTime (ms) | cpuTime (ms) |
| --------------------------------------------------------- | ---------- | ------------ | -------------------- | ------------- | ------------ |
| resnet\_model/batch\_normalization\_15/FusedBatchNorm/Add | EXECUTED | Convolution | jit\_avx512\_1x1\_I8 | 0.377 | 0.377 |
| resnet\_model/conv2d\_16/Conv2D/fq\_input\_0 | NOT\_RUN | FakeQuantize | undef | 0 | 0 |
| resnet\_model/batch\_normalization\_16/FusedBatchNorm/Add | EXECUTED | Convolution | jit\_avx512\_I8 | 0.499 | 0.499 |
| resnet\_model/conv2d\_17/Conv2D/fq\_input\_0 | NOT\_RUN | FakeQuantize | undef | 0 | 0 |
| resnet\_model/batch\_normalization\_17/FusedBatchNorm/Add | EXECUTED | Convolution | jit\_avx512\_1x1\_I8 | 0.399 | 0.399 |
| resnet\_model/add\_4/fq\_input\_0 | NOT\_RUN | FakeQuantize | undef | 0 | 0 |
| resnet\_model/add\_4 | NOT\_RUN | Eltwise | undef | 0 | 0 |
| resnet\_model/add\_5/fq\_input\_1 | NOT\_RUN | FakeQuantize | undef | 0 | 0 |
For example, the table shown below is part of performance counters for quantized
`TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf>`__
model inference on :doc:`CPU Plugin <openvino_docs_OV_UG_supported_plugins_CPU>`.
Keep in mind that since the device is CPU, the ``realTime`` wall clock and the ``cpu`` time layers are the same.
Information about layer precision is also stored in the performance counters.
The `exeStatus` column of the table includes the following possible values:
- `EXECUTED` - the layer was executed by standalone primitive.
- `NOT_RUN` - the layer was not executed by standalone primitive or was fused with another operation and executed in another layer primitive.
The `execType` column of the table includes inference primitives with specific suffixes. The layers could have the following marks:
* The `I8` suffix is for layers that had 8-bit data type input and were computed in 8-bit precision.
* The `FP32` suffix is for layers computed in 32-bit precision.
=========================================================== ============= ============== ===================== ================= ==============
layerName execStatus layerType execType realTime (ms) cpuTime (ms)
=========================================================== ============= ============== ===================== ================= ==============
resnet\_model/batch\_normalization\_15/FusedBatchNorm/Add EXECUTED Convolution jit\_avx512\_1x1\_I8 0.377 0.377
resnet\_model/conv2d\_16/Conv2D/fq\_input\_0 NOT\_RUN FakeQuantize undef 0 0
resnet\_model/batch\_normalization\_16/FusedBatchNorm/Add EXECUTED Convolution jit\_avx512\_I8 0.499 0.499
resnet\_model/conv2d\_17/Conv2D/fq\_input\_0 NOT\_RUN FakeQuantize undef 0 0
resnet\_model/batch\_normalization\_17/FusedBatchNorm/Add EXECUTED Convolution jit\_avx512\_1x1\_I8 0.399 0.399
resnet\_model/add\_4/fq\_input\_0 NOT\_RUN FakeQuantize undef 0 0
resnet\_model/add\_4 NOT\_RUN Eltwise undef 0 0
resnet\_model/add\_5/fq\_input\_1 NOT\_RUN FakeQuantize undef 0 0
=========================================================== ============= ============== ===================== ================= ==============
All `Convolution` layers are executed in `int8` precision. The rest of the layers are fused into Convolutions using post-operation optimization, as described in [CPU Device](../../OV_Runtime_UG/supported_plugins/CPU.md).
This contains layer names (as seen in OpenVINO IR), type of the layer, and execution statistics.
| The ``exeStatus`` column of the table includes the following possible values:
| - ``EXECUTED`` - the layer was executed by standalone primitive.
| - ``NOT_RUN`` - the layer was not executed by standalone primitive or was fused with another operation and executed in another layer primitive.
|
| The ``execType`` column of the table includes inference primitives with specific suffixes. The layers could have the following marks:
| - The ``I8`` suffix is for layers that had 8-bit data type input and were computed in 8-bit precision.
| - The ``FP32`` suffix is for layers computed in 32-bit precision.
|
| All ``Convolution`` layers are executed in ``int8`` precision. The rest of the layers are fused into Convolutions using post-operation optimization,
as described in :doc:`CPU Device <openvino_docs_OV_UG_supported_plugins_CPU>`. This contains layer names
(as seen in OpenVINO IR), type of the layer, and execution statistics.
Both `benchmark_app` versions also support the `exec_graph_path` command-line option. It requires OpenVINO to output the same execution statistics per layer, but in the form of plugin-specific [Netron-viewable](https://netron.app/) graph to the specified file.
Especially when performance-debugging the [latency](../../optimization_guide/dldt_deployment_optimization_latency.md), note that the counters do not reflect the time spent in the `plugin/device/driver/etc` queues. If the sum of the counters is too different from the latency of an inference request, consider testing with less inference requests. For example, running single [OpenVINO stream](../../optimization_guide/dldt_deployment_optimization_tput.md) with multiple requests would produce nearly identical counters as running a single inference request, while the actual latency can be quite different.
Both *benchmark_app* versions also support the ``exec_graph_path`` command-line option. It requires OpenVINO to output the same execution
statistics per layer, but in the form of plugin-specific `Netron-viewable <https://netron.app/>`__ graph to the specified file.
Lastly, the performance statistics with both performance counters and execution graphs are averaged, so such data for the [inputs of dynamic shapes](../../OV_Runtime_UG/ov_dynamic_shapes.md) should be measured carefully, preferably by isolating the specific shape and executing multiple times in a loop, to gather the reliable data.
Especially when performance-debugging the :doc:`latency <openvino_docs_deployment_optimization_guide_latency>`, note that the counters
do not reflect the time spent in the ``plugin/device/driver/etc`` queues. If the sum of the counters is too different from the latency
of an inference request, consider testing with less inference requests. For example, running single
:doc:`OpenVINO stream <openvino_docs_deployment_optimization_guide_tput>` with multiple requests would produce nearly identical
counters as running a single inference request, while the actual latency can be quite different.
Lastly, the performance statistics with both performance counters and execution graphs are averaged,
so such data for the :doc:`inputs of dynamic shapes <openvino_docs_OV_UG_DynamicShapes>` should be measured carefully,
preferably by isolating the specific shape and executing multiple times in a loop, to gather reliable data.
Use ITT to Get Performance Insights
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
In general, OpenVINO and its individual plugins are heavily instrumented with Intel® Instrumentation and Tracing Technology (ITT).
Therefore, you can also compile OpenVINO from the source code with ITT enabled and use tools like
`Intel® VTune™ Profiler <https://software.intel.com/en-us/vtune>`__ to get detailed inference performance breakdown and additional
insights in the application-level performance on the timeline view.
@endsphinxdirective
### Use ITT to Get Performance Insights
In general, OpenVINO and its individual plugins are heavily instrumented with Intel® Instrumentation and Tracing Technology (ITT). Therefore, you can also compile OpenVINO from the source code with ITT enabled and use tools like [Intel® VTune™ Profiler](https://software.intel.com/en-us/vtune) to get detailed inference performance breakdown and additional insights in the application-level performance on the timeline view.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,85 +1,99 @@
# Converting a Caffe Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe}
<a name="Convert_From_Caffe"></a>To convert a Caffe model, run Model Optimizer with the path to the input model `.caffemodel` file:
@sphinxdirective
To convert a Caffe model, run Model Optimizer with the path to the input model ``.caffemodel`` file:
.. code-block:: cpp
mo --input_model <INPUT_MODEL>.caffemodel
```sh
mo --input_model <INPUT_MODEL>.caffemodel
```
The following list provides the Caffe-specific parameters.
```
Caffe-specific parameters:
--input_proto INPUT_PROTO, -d INPUT_PROTO
Deploy-ready prototxt file that contains a topology
structure and layer attributes
--caffe_parser_path CAFFE_PARSER_PATH
Path to python Caffe parser generated from caffe.proto
-k K Path to CustomLayersMapping.xml to register custom
layers
--disable_omitting_optional
Disable omitting optional attributes to be used for
custom layers. Use this option if you want to transfer
all attributes of a custom layer to IR. Default
behavior is to transfer the attributes with default
values and the attributes defined by the user to IR.
--enable_flattening_nested_params
Enable flattening optional params to be used for
custom layers. Use this option if you want to transfer
attributes of a custom layer to IR with flattened
nested parameters. Default behavior is to transfer the
attributes without flattening nested parameters.
```
.. code-block:: cpp
### CLI Examples Using Caffe-Specific Parameters
Caffe-specific parameters:
--input_proto INPUT_PROTO, -d INPUT_PROTO
Deploy-ready prototxt file that contains a topology
structure and layer attributes
--caffe_parser_path CAFFE_PARSER_PATH
Path to python Caffe parser generated from caffe.proto
-k K Path to CustomLayersMapping.xml to register custom
layers
--disable_omitting_optional
Disable omitting optional attributes to be used for
custom layers. Use this option if you want to transfer
all attributes of a custom layer to IR. Default
behavior is to transfer the attributes with default
values and the attributes defined by the user to IR.
--enable_flattening_nested_params
Enable flattening optional params to be used for
custom layers. Use this option if you want to transfer
attributes of a custom layer to IR with flattened
nested parameters. Default behavior is to transfer the
attributes without flattening nested parameters.
* Launching Model Optimizer for [bvlc_alexnet.caffemodel](https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet) with a specified `prototxt` file.
This is needed when the name of the Caffe model and the `.prototxt` file are different or are placed in different directories. Otherwise, it is enough to provide only the path to the input `model.caffemodel` file.
```sh
mo --input_model bvlc_alexnet.caffemodel --input_proto bvlc_alexnet.prototxt
```
* Launching Model Optimizer for [bvlc_alexnet.caffemodel](https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet) with a specified `CustomLayersMapping` file.
This is the legacy method of quickly enabling model conversion if your model has custom layers. This requires the Caffe system on the computer.
Example of `CustomLayersMapping.xml` can be found in `<OPENVINO_INSTALLATION_DIR>/mo/front/caffe/CustomLayersMapping.xml.example`. The optional parameters without default values and not specified by the user in the `.prototxt` file are removed from the Intermediate Representation, and nested parameters are flattened:
```sh
mo --input_model bvlc_alexnet.caffemodel -k CustomLayersMapping.xml --disable_omitting_optional --enable_flattening_nested_params
```
This example shows a multi-input model with input layers: `data`, `rois`
```
layer {
name: "data"
type: "Input"
top: "data"
input_param {
shape { dim: 1 dim: 3 dim: 224 dim: 224 }
}
}
layer {
name: "rois"
type: "Input"
top: "rois"
input_param {
shape { dim: 1 dim: 5 dim: 1 dim: 1 }
}
}
```
* Launching the Model Optimizer for a multi-input model with two inputs and providing a new shape for each input in the order they are passed to the Model Optimizer. In particular, for data, set the shape to `1,3,227,227`. For rois, set the shape to `1,6,1,1`:
```sh
mo --input_model /path-to/your-model.caffemodel --input data,rois --input_shape (1,3,227,227),[1,6,1,1]
```
## Custom Layer Definition
CLI Examples Using Caffe-Specific Parameters
++++++++++++++++++++++++++++++++++++++++++++
* Launching Model Optimizer for `bvlc_alexnet.caffemodel <https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet>`__ with a specified `prototxt` file. This is needed when the name of the Caffe model and the `.prototxt` file are different or are placed in different directories. Otherwise, it is enough to provide only the path to the input `model.caffemodel` file.
.. code-block:: cpp
mo --input_model bvlc_alexnet.caffemodel --input_proto bvlc_alexnet.prototxt
* Launching Model Optimizer for `bvlc_alexnet.caffemodel <https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet>`__ with a specified `CustomLayersMapping` file. This is the legacy method of quickly enabling model conversion if your model has custom layers. This requires the Caffe system on the computer. Example of ``CustomLayersMapping.xml`` can be found in ``<OPENVINO_INSTALLATION_DIR>/mo/front/caffe/CustomLayersMapping.xml.example``. The optional parameters without default values and not specified by the user in the ``.prototxt`` file are removed from the Intermediate Representation, and nested parameters are flattened:
.. code-block:: cpp
mo --input_model bvlc_alexnet.caffemodel -k CustomLayersMapping.xml --disable_omitting_optional --enable_flattening_nested_params
This example shows a multi-input model with input layers: ``data``, ``rois``
.. code-block:: cpp
layer {
name: "data"
type: "Input"
top: "data"
input_param {
shape { dim: 1 dim: 3 dim: 224 dim: 224 }
}
}
layer {
name: "rois"
type: "Input"
top: "rois"
input_param {
shape { dim: 1 dim: 5 dim: 1 dim: 1 }
}
}
* Launching the Model Optimizer for a multi-input model with two inputs and providing a new shape for each input in the order they are passed to the Model Optimizer. In particular, for data, set the shape to ``1,3,227,227``. For rois, set the shape to ``1,6,1,1``:
.. code-block:: cpp
mo --input_model /path-to/your-model.caffemodel --input data,rois --input_shape (1,3,227,227),[1,6,1,1]
Custom Layer Definition
########################
Internally, when you run Model Optimizer, it loads the model, goes through the topology, and tries to find each layer type in a list of known layers. Custom layers are layers that are not included in the list. If your topology contains such kind of layers, Model Optimizer classifies them as custom.
## Supported Caffe Layers
For the list of supported standard layers, refer to the [Supported Framework Layers](@ref openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers) page.
Supported Caffe Layers
#######################
## Frequently Asked Questions (FAQ)
For the list of supported standard layers, refer to the :doc:`Supported Framework Layers <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>` page.
Model Optimizer provides explanatory messages when it is unable to complete conversions due to typographical errors, incorrectly used options, or other issues. A message describes the potential cause of the problem and gives a link to [Model Optimizer FAQ](@ref openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ) which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections to help you understand what went wrong.
Frequently Asked Questions (FAQ)
################################
## Summary
Model Optimizer provides explanatory messages when it is unable to complete conversions due to typographical errors, incorrectly used options, or other issues. A message describes the potential cause of the problem and gives a link to :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>` which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections to help you understand what went wrong.
Summary
#######
In this document, you learned:
@@ -87,5 +101,10 @@ In this document, you learned:
* Which Caffe models are supported.
* How to convert a trained Caffe model by using Model Optimizer with both framework-agnostic and Caffe-specific command-line options.
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific Caffe models.
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific Caffe models.
@endsphinxdirective

View File

@@ -1,65 +1,86 @@
# Converting a Kaldi Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Kaldi}
> **NOTE**: 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. The support of the [nnet3](http://kaldi-asr.org/doc/dnn3.html) format is limited.
@sphinxdirective
.. note::
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. The support of the `nnet3 <http://kaldi-asr.org/doc/dnn3.html>`__ format is limited.
<a name="Convert_From_Kaldi"></a>To convert a Kaldi model, run Model Optimizer with the path to the input model `.nnet` or `.mdl` file:
To convert a Kaldi model, run Model Optimizer with the path to the input model ``.nnet`` or ``.mdl`` file:
```sh
mo --input_model <INPUT_MODEL>.nnet
```
.. code-block:: cpp
## Using Kaldi-Specific Conversion Parameters <a name="kaldi_specific_conversion_params"></a>
mo --input_model <INPUT_MODEL>.nnet
Using Kaldi-Specific Conversion Parameters
##########################################
The following list provides the Kaldi-specific parameters.
```sh
Kaldi-specific parameters:
--counts COUNTS A file name with full path to the counts file or empty string to utilize count values from the model file
--remove_output_softmax
Removes the Softmax that is the output layer
--remove_memory Remove the Memory layer and add new inputs and outputs instead
```
.. code-block:: cpp
## Examples of CLI Commands
Kaldi-specific parameters:
--counts COUNTS A file name with full path to the counts file or empty string to utilize count values from the model file
--remove_output_softmax
Removes the Softmax that is the output layer
--remove_memory Remove the Memory layer and add new inputs and outputs instead
* To launch Model Optimizer for the `wsj_dnn5b_smbr` model with the specified `.nnet` file:
```sh
mo --input_model wsj_dnn5b_smbr.nnet
```
Examples of CLI Commands
########################
* To launch Model Optimizer for the `wsj_dnn5b_smbr` model with the existing file that contains counts for the last layer with biases:
```sh
mo --input_model wsj_dnn5b_smbr.nnet --counts wsj_dnn5b_smbr.counts
```
* To launch Model Optimizer for the ``wsj_dnn5b_smbr`` model with the specified ``.nnet`` file:
.. code-block:: cpp
mo --input_model wsj_dnn5b_smbr.nnet
* To launch Model Optimizer for the ``wsj_dnn5b_smbr`` model with the existing file that contains counts for the last layer with biases:
.. code-block:: cpp
mo --input_model wsj_dnn5b_smbr.nnet --counts wsj_dnn5b_smbr.counts
* The Model Optimizer normalizes сounts in the following way:
\f[
S = \frac{1}{\sum_{j = 0}^{|C|}C_{j}}
\f]
\f[
C_{i}=log(S*C_{i})
\f]
where \f$C\f$ - the counts array, \f$C_{i} - i^{th}\f$ element of the counts array,
\f$|C|\f$ - number of elements in the counts array;
.. math::
S = \frac{1}{\sum_{j = 0}^{|C|}C_{j}}
.. math::
C_{i}=log(S\*C_{i})
where :math:`C` - the counts array, :math:`C_{i} - i^{th}` element of the counts array, :math:`|C|` - number of elements in the counts array;
* The normalized counts are subtracted from biases of the last or next to last layer (if last layer is SoftMax).
.. note:: Model Optimizer will show a warning if a model contains values of counts and the `--counts` option is not used.
> **NOTE**: Model Optimizer will show a warning if a model contains values of counts and the `--counts` option is not used.
* If you want to remove the last SoftMax layer in the topology, launch the Model Optimizer with the `--remove_output_softmax` flag:
.. code-block:: cpp
* If you want to remove the last SoftMax layer in the topology, launch the Model Optimizer with the
`--remove_output_softmax` flag:
```sh
mo --input_model wsj_dnn5b_smbr.nnet --counts wsj_dnn5b_smbr.counts --remove_output_softmax
```
The Model Optimizer finds the last layer of the topology and removes this layer only if it is a SoftMax layer.
The Model Optimizer finds the last layer of the topology and removes this layer only if it is a SoftMax layer.
> **NOTE**: Model Optimizer can remove SoftMax layer only if the topology has one output.
.. note:: Model Optimizer can remove SoftMax layer only if the topology has one output.
* You can use the *OpenVINO Speech Recognition* sample application for the sample inference of Kaldi models. This sample supports models with only one output. If your model has several outputs, specify the desired one with the `--output` option.
* You can use the *OpenVINO Speech Recognition* sample application for the sample inference of Kaldi models. This sample supports models with only one output. If your model has several outputs, specify the desired one with the ``--output`` option.
## Supported Kaldi Layers
For the list of supported standard layers, refer to the [Supported Framework Layers ](@ref openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers) page.
Supported Kaldi Layers
######################
For the list of supported standard layers, refer to the :doc:`Supported Framework Layers <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>` page.
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific Kaldi models. Here are some examples:
* :doc:`Convert Kaldi ASpIRE Chain Time Delay Neural Network (TDNN) Model <openvino_docs_MO_DG_prepare_model_convert_model_kaldi_specific_Aspire_Tdnn_Model>`
@endsphinxdirective
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific Kaldi models. Here are some examples:
* [Convert Kaldi ASpIRE Chain Time Delay Neural Network (TDNN) Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_kaldi_specific_Aspire_Tdnn_Model)

View File

@@ -1,51 +1,61 @@
# Converting an MXNet Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_MxNet}
<a name="ConvertMxNet"></a>To convert an MXNet model, run Model Optimizer with the path to the *`.params`* file of the input model:
@sphinxdirective
```sh
mo --input_model model-file-0000.params
```
To convert an MXNet model, run Model Optimizer with the path to the ``.params`` file of the input model:
.. code-block:: sh
mo --input_model model-file-0000.params
Using MXNet-Specific Conversion Parameters
##########################################
## Using MXNet-Specific Conversion Parameters <a name="mxnet_specific_conversion_params"></a>
The following list provides the MXNet-specific parameters.
```
MXNet-specific parameters:
--input_symbol <SYMBOL_FILE_NAME>
Symbol file (for example, "model-symbol.json") that contains a topology structure and layer attributes
--nd_prefix_name <ND_PREFIX_NAME>
Prefix name for args.nd and argx.nd files
--pretrained_model_name <PRETRAINED_MODEL_NAME>
Name of a pre-trained MXNet model without extension and epoch
number. This model will be merged with args.nd and argx.nd
files
--save_params_from_nd
Enable saving built parameters file from .nd files
--legacy_mxnet_model
Enable Apache MXNet loader to make a model compatible with the latest Apache MXNet version.
Use only if your model was trained with Apache MXNet version lower than 1.0.0
--enable_ssd_gluoncv
Enable transformation for converting the gluoncv ssd topologies.
Use only if your topology is one of ssd gluoncv topologies
```
.. code-block:: sh
> **NOTE**: By default, Model Optimizer does not use the Apache MXNet loader. It transforms the topology to another format which is compatible with the latest
> version of Apache MXNet. However, the Apache MXNet loader is required for models trained with lower version of Apache MXNet. If your model was trained with an Apache MXNet version lower than 1.0.0, specify the
> `--legacy_mxnet_model` key to enable the Apache MXNet loader. Note that the loader does not support models with custom layers. In this case, you must manually
> recompile Apache MXNet with custom layers and install it in your environment.
MXNet-specific parameters:
--input_symbol <SYMBOL_FILE_NAME>
Symbol file (for example, "model-symbol.json") that contains a topology structure and layer attributes
--nd_prefix_name <ND_PREFIX_NAME>
Prefix name for args.nd and argx.nd files
--pretrained_model_name <PRETRAINED_MODEL_NAME>
Name of a pre-trained MXNet model without extension and epoch
number. This model will be merged with args.nd and argx.nd
files
--save_params_from_nd
Enable saving built parameters file from .nd files
--legacy_mxnet_model
Enable Apache MXNet loader to make a model compatible with the latest Apache MXNet version.
Use only if your model was trained with Apache MXNet version lower than 1.0.0
--enable_ssd_gluoncv
Enable transformation for converting the gluoncv ssd topologies.
Use only if your topology is one of ssd gluoncv topologies
## Custom Layer Definition
.. note::
By default, Model Optimizer does not use the Apache MXNet loader. It transforms the topology to another format which is compatible with the latest version of Apache MXNet. However, the Apache MXNet loader is required for models trained with lower version of Apache MXNet. If your model was trained with an Apache MXNet version lower than 1.0.0, specify the ``--legacy_mxnet_model`` key to enable the Apache MXNet loader. Note that the loader does not support models with custom layers. In this case, you must manually recompile Apache MXNet with custom layers and install it in your environment.
Custom Layer Definition
#######################
Internally, when you run Model Optimizer, it loads the model, goes through the topology, and tries to find each layer type in a list of known layers. Custom layers are layers that are not included in the list. If your topology contains such kind of layers, Model Optimizer classifies them as custom.
## Supported MXNet Layers
For the list of supported standard layers, refer to the [Supported Framework Layers](@ref openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers) page.
Supported MXNet Layers
#######################
## Frequently Asked Questions (FAQ)
For the list of supported standard layers, refer to the :doc:`Supported Framework Layers <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>` page.
Model Optimizer provides explanatory messages when it is unable to complete conversions due to typographical errors, incorrectly used options, or other issues. A message describes the potential cause of the problem and gives a link to [Model Optimizer FAQ](@ref openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ) which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections to help you understand what went wrong.
Frequently Asked Questions (FAQ)
################################
## Summary
Model Optimizer provides explanatory messages when it is unable to complete conversions due to typographical errors, incorrectly used options, or other issues. A message describes the potential cause of the problem and gives a link to :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>` which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections to help you understand what went wrong.
Summary
########
In this document, you learned:
@@ -53,7 +63,13 @@ In this document, you learned:
* Which MXNet models are supported.
* How to convert a trained MXNet model by using the Model Optimizer with both framework-agnostic and MXNet-specific command-line options.
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific MXNet models. Here are some examples:
* [Convert MXNet GluonCV Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_mxnet_specific_Convert_GluonCV_Models)
* [Convert MXNet Style Transfer Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_mxnet_specific_Convert_Style_Transfer_From_MXNet)
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific MXNet models. Here are some examples:
* :doc:`Convert MXNet GluonCV Model <openvino_docs_MO_DG_prepare_model_convert_model_mxnet_specific_Convert_GluonCV_Models>`
* :doc:`Convert MXNet Style Transfer Model <openvino_docs_MO_DG_prepare_model_convert_model_mxnet_specific_Convert_Style_Transfer_From_MXNet>`
@endsphinxdirective

View File

@@ -1,28 +1,40 @@
# Converting an ONNX Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX}
## Introduction to ONNX
[ONNX](https://github.com/onnx/onnx) is a representation format for deep learning models that allows AI developers to easily transfer models between different frameworks. It is hugely popular among deep learning tools, like PyTorch, Caffe2, Apache MXNet, Microsoft Cognitive Toolkit, and many others.
@sphinxdirective
## Converting an ONNX Model <a name="Convert_From_ONNX"></a>
Introduction to ONNX
####################
This page provides instructions on how to convert a model from the ONNX format to the OpenVINO IR format using Model Optimizer. To use Model Optimizer, install OpenVINO Development Tools by following the [installation instructions](@ref openvino_docs_install_guides_install_dev_tools).
`ONNX <https://github.com/onnx/onnx>`__ is a representation format for deep learning models that allows AI developers to easily transfer models between different frameworks. It is hugely popular among deep learning tools, like PyTorch, Caffe2, Apache MXNet, Microsoft Cognitive Toolkit, and many others.
Converting an ONNX Model
########################
This page provides instructions on how to convert a model from the ONNX format to the OpenVINO IR format using Model Optimizer. To use Model Optimizer, install OpenVINO Development Tools by following the :doc:`installation instructions <openvino_docs_install_guides_install_dev_tools>`.
The Model Optimizer process assumes you have an ONNX model that was directly downloaded from a public repository or converted from any framework that supports exporting to the ONNX format.
To convert an ONNX model, run Model Optimizer with the path to the input model `.onnx` file:
To convert an ONNX model, run Model Optimizer with the path to the input model ``.onnx`` file:
```sh
mo --input_model <INPUT_MODEL>.onnx
```
.. code-block:: sh
There are no ONNX specific parameters, so only framework-agnostic parameters are available to convert your model. For details, see the *General Conversion Parameters* section in the [Converting a Model to Intermediate Representation (IR)](@ref openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model) guide.
mo --input_model <INPUT_MODEL>.onnx
## Supported ONNX Layers
For the list of supported standard layers, refer to the [Supported Framework Layers](@ref openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers) page.
There are no ONNX specific parameters, so only framework-agnostic parameters are available to convert your model. For details, see the *General Conversion Parameters* section in the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific ONNX models. Here are some examples:
* [Convert ONNX Faster R-CNN Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Faster_RCNN)
* [Convert ONNX GPT-2 Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_GPT2)
* [Convert ONNX Mask R-CNN Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Mask_RCNN)
Supported ONNX Layers
#####################
For the list of supported standard layers, refer to the :doc:`Supported Framework Layers <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>` page.
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific ONNX models. Here are some examples:
* :doc:`Convert ONNX Faster R-CNN Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Faster_RCNN>`
* :doc:`Convert ONNX GPT-2 Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_GPT2>`
* :doc:`Convert ONNX Mask R-CNN Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Mask_RCNN>`
@endsphinxdirective

View File

@@ -1,23 +1,29 @@
# Converting a PaddlePaddle Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle}
To convert a PaddlePaddle model, use the `mo` script and specify the path to the input `.pdmodel` model file:
@sphinxdirective
To convert a PaddlePaddle model, use the ``mo`` script and specify the path to the input ``.pdmodel`` model file:
.. code-block:: sh
mo --input_model <INPUT_MODEL>.pdmodel
```sh
mo --input_model <INPUT_MODEL>.pdmodel
```
**For example,** this command converts a yolo v3 PaddlePaddle network to OpenVINO IR network:
```sh
mo --input_model=yolov3.pdmodel --input=image,im_shape,scale_factor --input_shape=[1,3,608,608],[1,2],[1,2] --reverse_input_channels --output=save_infer_model/scale_0.tmp_1,save_infer_model/scale_1.tmp_1
```
.. code-block:: sh
## Supported PaddlePaddle Layers
For the list of supported standard layers, refer to the [Supported Framework Layers](@ref openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers) page.
mo --input_model=yolov3.pdmodel --input=image,im_shape,scale_factor --input_shape=[1,3,608,608],[1,2],[1,2] --reverse_input_channels --output=save_infer_model/scale_0.tmp_1,save_infer_model/scale_1.tmp_1
Supported PaddlePaddle Layers
#############################
For the list of supported standard layers, refer to the :doc:`Supported Framework Layers <openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers>` page.
Officially Supported PaddlePaddle Models
########################################
## Officially Supported PaddlePaddle Models
The following PaddlePaddle models have been officially validated and confirmed to work (as of OpenVINO 2022.1):
@sphinxdirective
.. list-table::
:widths: 20 25 55
:header-rows: 1
@@ -67,10 +73,16 @@ The following PaddlePaddle models have been officially validated and confirmed t
* - BERT
- language representation
- Models are exported from `PaddleNLP <https://github.com/PaddlePaddle/PaddleNLP/tree/v2.1.1>`_. Refer to `README.md <https://github.com/PaddlePaddle/PaddleNLP/tree/develop/examples/language_model/bert#readme>`_.
Frequently Asked Questions (FAQ)
################################
When Model Optimizer is unable to run to completion due to typographical errors, incorrectly used options, or other issues, it provides explanatory messages. They describe the potential cause of the problem and give a link to the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`, which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in the Model Optimizer Developer Guide to help you understand what went wrong.
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PaddlePaddle models.
@endsphinxdirective
## Frequently Asked Questions (FAQ)
When Model Optimizer is unable to run to completion due to typographical errors, incorrectly used options, or other issues, it provides explanatory messages. They describe the potential cause of the problem and give a link to the [Model Optimizer FAQ](@ref openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ), which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in the Model Optimizer Developer Guide to help you understand what went wrong.
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific PaddlePaddle models.

View File

@@ -1,39 +1,49 @@
# Converting a PyTorch Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch}
@sphinxdirective
The PyTorch framework is supported through export to the ONNX format. In order to optimize and deploy a model that was trained with it:
1. [Export a PyTorch model to ONNX](#export-to-onnx).
2. [Convert the ONNX model](Convert_Model_From_ONNX.md) to produce an optimized [Intermediate Representation](@ref openvino_docs_MO_DG_IR_and_opsets) of the model based on the trained network topology, weights, and biases values.
1. `Export a PyTorch model to ONNX <#exporting-a-pytorch-model-to-onnx-format>`__.
2. :doc:`Convert the ONNX model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>` to produce an optimized :doc:`Intermediate Representation <openvino_docs_MO_DG_IR_and_opsets>` of the model based on the trained network topology, weights, and biases values.
## Exporting a PyTorch Model to ONNX Format <a name="export-to-onnx"></a>
PyTorch models are defined in Python. To export them, use the `torch.onnx.export()` method. The code to
Exporting a PyTorch Model to ONNX Format
########################################
PyTorch models are defined in Python. To export them, use the ``torch.onnx.export()`` method. The code to
evaluate or test the model is usually provided with its code and can be used for its initialization and export.
The export to ONNX is crucial for this process, but it is covered by PyTorch framework, therefore, It will not be covered here in detail.
For more information, refer to the [Exporting PyTorch models to ONNX format](https://pytorch.org/docs/stable/onnx.html) guide.
For more information, refer to the `Exporting PyTorch models to ONNX format <https://pytorch.org/docs/stable/onnx.html>`__ guide.
To export a PyTorch model, you need to obtain the model as an instance of `torch.nn.Module` class and call the `export` function.
To export a PyTorch model, you need to obtain the model as an instance of ``torch.nn.Module`` class and call the ``export`` function.
```python
import torch
.. code-block:: py
# Instantiate your model. This is just a regular PyTorch model that will be exported in the following steps.
model = SomeModel()
# Evaluate the model to switch some operations from training mode to inference.
model.eval()
# Create dummy input for the model. It will be used to run the model inside export function.
dummy_input = torch.randn(1, 3, 224, 224)
# Call the export function
torch.onnx.export(model, (dummy_input, ), 'model.onnx')
```
import torch
## Known Issues
# Instantiate your model. This is just a regular PyTorch model that will be exported in the following steps.
model = SomeModel()
# Evaluate the model to switch some operations from training mode to inference.
model.eval()
# Create dummy input for the model. It will be used to run the model inside export function.
dummy_input = torch.randn(1, 3, 224, 224)
# Call the export function
torch.onnx.export(model, (dummy_input, ), 'model.onnx')
* As of version 1.8.1, not all PyTorch operations can be exported to ONNX opset 9 which is used by default.
It is recommended to export models to opset 11 or higher when export to default opset 9 is not working. In that case, use `opset_version`
option of the `torch.onnx.export`. For more information about ONNX opset, refer to the [Operator Schemas](https://github.com/onnx/onnx/blob/master/docs/Operators.md) page.
## Additional Resources
See the [Model Conversion Tutorials](@ref openvino_docs_MO_DG_prepare_model_convert_model_tutorials) page for a set of tutorials providing step-by-step instructions for converting specific PyTorch models. Here are some examples:
* [Convert PyTorch BERT-NER Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Bert_ner)
* [Convert PyTorch RCAN Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RCAN)
* [Convert PyTorch YOLACT Model](@ref openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_YOLACT)
Known Issues
####################
As of version 1.8.1, not all PyTorch operations can be exported to ONNX opset 9 which is used by default.
It is recommended to export models to opset 11 or higher when export to default opset 9 is not working. In that case, use ``opset_version`` option of the ``torch.onnx.export``. For more information about ONNX opset, refer to the `Operator Schemas <https://github.com/onnx/onnx/blob/master/docs/Operators.md>`__ page.
Additional Resources
####################
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PyTorch models. Here are some examples:
* :doc:`Convert PyTorch BERT-NER Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Bert_ner>`
* :doc:`Convert PyTorch RCAN Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RCAN>`
* :doc:`Convert PyTorch YOLACT Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_YOLACT>`
@endsphinxdirective

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