Commit Graph

393 Commits

Author SHA1 Message Date
Pawel Raasz 3077bad26f
[core]Migrate Sigmoid operator to new API (#20780)
* Migrate Sigmoid operator to new API

* Add missing include
2023-10-31 12:11:29 +01:00
Pawel Raasz 38cd138d0d
[core]Migrate Sqrt operator to new API (#20632)
* Migrate Sqrt operator to new API

* Remove 'visit_attributes' is same as base
2023-10-31 08:34:49 +00:00
Pawel Raasz 246410b0dd
[core]Migrate NotEqual operator to new API (#20648)
* Migrate NotEqual operator to new API

* Remove `visit_attributes` is same as base

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-31 00:01:27 +00:00
Pawel Raasz ac176beb33
[core]Migrate Clamp operator to new API (#20676)
* Migrate Clamp operator to new API

* Remove not used function add comment
2023-10-30 22:58:35 +00:00
Tomasz Jankowski 142a72d0f0
[core] Migrate SpaceToBatch operator to new API (#20510)
* Drop HostTensor and move to ov namespace

* Style

* Optimize vector assignment

* Optimize vector assignment

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-30 12:52:56 +00:00
Pawel Raasz e2ea571926
Migrate Maximum operator to new API (#20602)
Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-30 12:08:26 +01:00
Pawel Raasz 7cfeb413d4
[core]Migrate Concat operator to new API (#20600)
* Migrate Concat op to new API

* Move shape validation to shape_infer

* Fix getting concat axis in shape inference

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-30 12:07:36 +01:00
Pawel Raasz cec6535eaa
[core]Migrate Transpose operator to new API (#20647)
* Migrate Transpose to new API

* Move shape validation to shape_infer

* Remove visit_attributes is same as base

* Correct transpose order shape check
for static shapes
- correct creation of order shape for static shape tests

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-30 07:05:17 +01:00
Pawel Raasz a8a14eba9d
[core]Migrate Equal operator to new API (#20688)
* Migrate Equal to new API

* Remove `visit_attributes` is same as base

* Remove i4, u4 from evaluate in Equal
reference implementation not handle binary precisions correctly

* Sync precisions in `has_evaluate` with `evaluate`

* Fix all equal check for lower bound
- make broadcast test assertion more strict
- remove deprecated functions from broadcast test
2023-10-27 07:27:11 +04:00
Tomasz Jankowski 301ea0beb0
[core] Migrate SpaceToDepth operator to new API (#20530)
* Drop HostTensor and move to ov namespace

* Drop HostTensor

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-26 08:35:38 +02:00
Pawel Raasz b3eb2810d7
[core]Migrate Negative operator to new API (#20609)
* Migrate Negative operator to new API

* Remove `visit_attributes` is same as base

* Use std::negate instead of lambda

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-25 10:39:50 +02:00
Pawel Raasz e1a33f10d5
[core]Migrate Slice to new API (#20417)
* Migrate slice to new API

* Remove visit_attributes, is same as base class

* Move shape checks to shape_infer
- minor refactor Slice op

* Move `get_tensors_partial_shapes` to dev API

* Correct comment

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

---------

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
2023-10-25 08:19:14 +00:00
Tomasz Jankowski 973b194776
[core] Migrate DepthToSpace operator to new API (#20515)
* Move into ov namespace

* Use ov::Tensor in place of HostTensor

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-25 07:10:54 +02:00
Pawel Raasz 5fee2ef67e
Migrate LessEqual and GreaterEqual to new API (#20645)
Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-25 07:26:31 +04:00
Pawel Raasz 2b65855793
[core]Migrate Less and Greater operators to new API (#20628)
* Migrate Less operator to new API

* Migrate Greater operator to new API
- use less implementation in greater to reduce bin size

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-25 07:25:05 +04:00
Ilya Churaev 124f2bc5c9
Remove NF4 Convert from public API (#20666)
* Remove NF4 Convert from public API

* Fixed build
2023-10-24 19:19:16 +04:00
Pawel Raasz 5ffde7d8d6
[core]Migrate Minimum operator to new API (#20597)
* Migrate Minimum op to new API

* Refactor evaluates to reduce binary size
- add infer_broadcast_shape, get shapes from tensors reduce OV_ASSERT
- refactor Evaluate structures to reduce binary size

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-10-24 14:48:09 +02:00
Pawel Raasz 750f62fd04
[shape_infer]Add preserve partial values on inputs for Mod operator (#20169)
* Preserve partial values on mod inputs
- static values full range of integers
- intervals only if not negatives

* Fix bounds evaluate when inputs are scalars
2023-10-24 14:53:54 +04:00
Ilya Churaev 7ceff55b71
Add AlignedBuffer to OpenVINO developer API (#20532)
* Add AlignedBuffer to OpenVINO developer API

* Fixed build

* Fixed code style and remove opset deprecation

* Fixed Windows build

* Fixed GNA

* Fixed comment
2023-10-24 06:13:23 +00:00
Maxim Vafin 8d0381b0fe
[PT FE] Implement custom op for types alignment (#20431)
* [PT FE] Implement custom op for types alignment

* Fix code style

* Fix inplace ops

* Fix layer tests

* Remove no longer needed change

* Fix ovc tests

* Fix fe tests
2023-10-23 22:54:08 +02:00
Evgenya Nugmanova 94a63605d1
Clear error message in the Constant::cast_vector (#20629) 2023-10-22 01:03:42 +04:00
Sergey Lyalin 46935e0a00
Partial GPTQ int4 models conversion support + Swap nibbles in u4/i4 element type (#20371)
* Reference implementation for u4 constant compression from pytorch model based on bitwise ops pattern

* Fixed order of 4-bit halfs in byte

* Switched PyTorch FE to dev mode: in case if model cannot be fully converted, give partially converted model with PTFrameworkNode's with a printed warning (normally would raise an exception in case).

* Moved u4 compression to utils_quantize. Implemented not-interleaved version of u4 compression

* Removed debug output

* Added aten::matmul to the list of exceptions in may_produce_alias as a workaround for gptq models

* Added patching for gptq models applied automatically in convert_model

* WA for an inssue with u4 with earlier convert to fp16

* U4 blocked repacking for gptq patched model layout

* Deleted obsolete u4 re-packing based on aten::cat. Fixed the resulting u4 constant shape. Removed debug output.

* Revert "Switched PyTorch FE to dev mode: in case if model cannot be fully converted, give partially converted model with PTFrameworkNode's with a printed warning (normally would raise an exception in case)."

This reverts commit 0ef1455e70.

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

* Check mask and shift values in u4 pattern. deque -> OutputVector for u4_compression_stack

* Convert to a given floating type instead of half in gptq patching. Better structured code.

* Code style fix

* Removed deque include

* Code style fixes

* Trailing space removed

* Fixed patched_forward and ts_decoder after unvalidated commits.

* Swap nibbles in u4/i4

* Better exception handling around jit.trace and gptq.patch_model

* Update src/bindings/python/src/openvino/frontend/pytorch/gptq.py

Co-authored-by: Alexander Kozlov <alexander.kozlov@intel.com>

* Update src/bindings/python/src/openvino/frontend/pytorch/gptq.py

Co-authored-by: Alexander Kozlov <alexander.kozlov@intel.com>

* Code style

* Revers int4 byte order

* Fixed core tests

* Fixed unguarded dynamic_cast result

Co-authored-by: Evgenya Nugmanova <eva.my.link@gmail.com>

* Fixed transformation tests

* Update src/bindings/python/src/openvino/frontend/pytorch/gptq.py

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

* Prevent patching of non-gptq models

* Removed extra calling of quantized weights decompression patterns

* Better detection of supported AutoGPTQ models + more diagnostics

* Accurate diagnostics in case when aten::stack has multiple axes

---------

Co-authored-by: Alexander Kozlov <alexander.kozlov@intel.com>
Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
Co-authored-by: Evgenya Nugmanova <eva.my.link@gmail.com>
Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-10-18 21:06:17 +04:00
Pawel Raasz f2549f2d59
[core]Migrate VariadicSplit op to new API (#20416)
* Migrate VariadicSlice to new API
- refactor to reduce bin size

* Move `get_tensors_partial_shapes` to dev API

* Use get_tensors_partial_shapes in VariadicSplit

* Remove `visit_attributes` is same as base
2023-10-18 15:02:18 +02:00
Pawel Raasz 9fb40b0007
[core]Migrate LogicalNot to new API (#20438)
* Migrate LogicalNot to new API

* Rename file not.hpp -> logical_not.hpp

* Apply code style
2023-10-18 09:16:12 +00:00
Pawel Raasz 2415f0c7cf
[core]Migrate BatchToSpace to new API (#20450)
* Migrate BatchToSpace to new API

* Remove not required suppression macro
2023-10-18 09:09:27 +00:00
Pawel Raasz 7515b042e8
[core]Migrate squeeze operator to new API (#20282)
* Migrate Squeeze to new API

* Remove visit_attributes as same as base class
2023-10-17 19:17:49 +02:00
Tomasz Jankowski e1a29ae96e
[core] Migrate MaxPool operator to new API (#20424)
* Use API 2.0 in MaxPool v1

* Use API 2.0 in MaxPool v8

* Fix type selection

* Fix type selection

* Avoid redundant local copies
2023-10-17 13:30:18 +04:00
Pawel Raasz fb93638cb2
[core]Migrate LogicalOr to new API (#20421)
* Migrate LogicalOr to new API

* Remove leftovers
2023-10-16 08:56:24 +04:00
Pawel Raasz 893517dd4a
Migrate LogicalAnd to new API (#20423) 2023-10-16 08:54:38 +04:00
Pawel Raasz f107b7663f
Migrate Split operator to new API (#20263) 2023-10-16 08:16:43 +04:00
Pawel Raasz a13eb5bf9d
[core]Migrate TopK operator to new API (#20254)
* Migrate TopK to new API

* Refactor compare_max for TopK

* Unify check of k for const and non-const input

* Update src/core/include/openvino/op/util/evaluate_helpers.hpp

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

* Move `get_tensors_partial_shapes` to dev API

---------

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
2023-10-13 14:53:58 +04:00
Pawel Raasz 7bc8e0fb8f
[core]Shape and Node util functions size optimization (#20206)
* Refactor shape_size util to reduce bin size

* Make `check_new_args_count` non-template function

* Use as not template check_new_args_count
in multi-nominal
2023-10-13 14:10:35 +04:00
Pawel Raasz 075333e94d
[core]Migrate Tile operator to new API (#20255)
* Migrate Tile to new API

* Remove visit_attributes as is same as base class
2023-10-12 10:51:04 +00:00
Pawel Raasz ac11751e9c
[core]Migrate Eye to new API (#20258)
* Migrate Eye to new API

* Fix `matrix_offset` initialization

* get_tensors_shapes -> get_tensors_partial_shapes
2023-10-11 13:50:29 +04:00
Ilya Churaev 8020530e67
Reduce ngraph namespace usage from core component (#20309)
* Reduce ngraph namespace usage from core component

* Fixed build

* Fixed build 2

* Added missed opset to legacy API
2023-10-11 07:09:04 +04:00
Ilya Churaev 7c847cecba
Remove ngraph namespace from operations without evaluate (#20252)
* Remove ngraph namespace from operations without namespace

* Try to fix build

* Additional fixes

* More fixes

* More fixs

* Fix reverse op

* Fixed tests

* Throw an exception if somebody tries to reallocate tensor

* Revert "Throw an exception if somebody tries to reallocate tensor"

This reverts commit 8e06d6d576.

* Remove python test

* Revert "Remove python test"

This reverts commit 37b12148d3.

* Changed evaluate model behavior
2023-10-06 12:54:11 +04:00
Piotr Krzemiński 48164e2279
[Ref][Core][Opset13] Add Multinomial Operation (#19655)
* [Ref] Multinomial base file

* [Ref] Add core & reference implementation reusing other ops

* [Ref] Fix reference implementation, add missing parameters, add tests

* [Core] Add opset13, register multinomial, add shape inference

* [Ref][Core] Fix compile errors

* [Ref][Core] Clang fix

* [TEMPLATE] Remove bf16, f16, f64 types

* [TEMPLATE] Remove incorrect input types for 'input' parameter

* [Ref][Tests] Remove deleted test types

* [Ref] Fix & optimize  shape inference

* [PT FE] Apply suggestions from review

* [Template] Migrate to new API

* [Core] Add a clause for dynamic input in shape inference

* [Tests] Add missing type_prop test (?)

* Update multinomial_shape_inference.hpp

* Update multinomial.hpp

* [Ref] Fix build issues

* [Ref] Fix clang and style

* [Ref] Fix tests without replacement

* [Ref] Fix with_replacement sampling error

* [Ref] Remove debugging artifacts

* [Ref] Cast to 64-bit size for 32-bit systems

* Update multinomial.hpp

* [Ref] Add missing type_prop tests, add shape inference tests

* Update multinomial.cpp

* Update multinomial_shape_inference_test.cpp

* Update multinomial.cpp

* Update multinomial.hpp

* [Ref] Fix compilation errors from shape inference test

* [Ref] Fix compilation error of type_prop, apply recommendations from review

* [Ref] Add multiple shape inference tests

* [Ref] Change TEST to TEST_F, add more type_prop tests

* [Ref] Clang fixes

* [Ref] Fix shape inference tests with mismatching args

* [Ref] Fix remaining type_prop errors

* [Ref] Replace HostTensor with normal Tensor in shape inference tests

* Update opset.cpp

* [Ref] Possible fix for 'function empty' error

* [Ref] Add a cast to remove conversion warning

* [Ref] Add conformance test of Multinomial

* [Ref] Match style of conf test to the remaining tests

* Update single_op_graph.cpp
2023-10-04 17:14:32 +02:00
Mateusz Mikolajczyk 7926302d35
[Ref][Core][Opset13] BitwiseAnd, BitwiseOr and BitwiseXor core shell and reference (#20058)
* Add Bitwise binary core and refs

* Add draft for tests

* Formatting, build issues and tests

* Fix tests

* Add reference tests

* Apply requested changes

* Add requested changes

* Rename

* uncomment test

* Update src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp

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

* change reference

---------

Co-authored-by: Tomasz Jankowski <tomasz1.jankowski@intel.com>
2023-10-04 09:38:33 +02:00
Pawel Raasz f8881dd2a4
[core]Api 2.0/migrate Subtract op to new API (#20108)
* Migrate Subtract to new API

* Sync has_evaluate precision with evaluate
2023-10-03 10:55:20 +02:00
Ilya Churaev 23e5964c5d
Remove HostTensor from ov namespace (#20168)
* Remove HostTensor from ov namespace

* Fixed build
2023-10-03 09:13:18 +04:00
Katarzyna Mitrus 86bf038417
[Ref][Core][Opset13] NMSRotated-13 core shell and reference implementation (#19907)
* nms_r_init

* Add tests

* Update nms refs

* Update onnx import

* Add nms rotated utils

* Remove soft sigma and align constructors

* Fix typo

* Style apply

* Add namespace for iou

* Update opset comment

* Revert cpu changes

* onnx test cleanup

* Update input types validation

* Align shape_infer boxes

* Test update

* Fix warning

* Temporary evaluate support for tests

* Add counterclockwise support

* Remove box_encoding attr

* Fix clockwise box idx

* More tests

* Update opset test

* Update boxes shape validation

* Type prop tests

* HostTensor to ov Tensor migration

* Update output_type set get output_type_attr

* Move setters and getters to cpp

* Add visitor test

* Cleanup

* Remove temp eval

* Headers adjustment

* use float for division

* Fix ref tests run

* Tests and style code refactor

* Move type check into box_last_dim

* Update visitor test namespace

* Check input type loop

* Remove nms_rotated namespace and rename ref function

* avoid copies in filling output tensor

* Update shape var name

* remove static from riou func

* Update nms_rot utils

* Move nms rot util to ov reference namespace

* use std::cos and std:::sin

* Update struct name

* Explain usage of postprocessing

* Update element type desc in error message

* Add more comments

* Adjust rotated util float types

* Fix name conflicts and warnings

* Update opset test ops number

* Move int input check to the loop

* Short box_def_size init

* Move remove static_output from shape_infer params

* Align float zero

* Update third-party-programs

* Fix TensorIt for CI

* Add op check test
2023-09-29 17:48:45 +00:00
andreyanufr b73b2502b1
Introduce NF4 data type (#19900)
* NF4 reference initial commit

* Compilable version.

* Executable NF4.

* Fixed nf4 unpacking.

* 1) Fixed warnings with nf4.
2) Removed unused functions.

* Added one test for nf4.

* Fixed code-style errors.

* Fixed code-style errors.

* Fixed NamingConventionCheck errors.

* Fixed test with nf4.

* Fixed windows compilation.

* Fixed casting warning.

* Fixed incorrect changes.

* Changed order of elements in nf4 pack/unpack.

* 1) Made Convert only on direction nf4->other type.
2) Applied reviewers suggestions.

* Fixed code style.

* Fised code style.

* 1) Added array header.
2) Added Bitsandbytes to third-party-programs.txt.

* 1) Removed unused code.
2) Fixed style typos.
3) Revert submodule version.

* Added test for nf4 compression.

* NF4 test refactoring.

* Added cpp tests for NF4.

* Removed model compilation from NF4 tests.

* Reverted submodule version.
2023-09-28 20:56:57 +04:00
Pawel Raasz 197e954846
[core]Migrate reduce ops max min mean prod sum evaluate to new API (#19756)
* Migrate ReduceL1, ReduceL2 to new API
- add some new utils which are deprecated

* Hide helper functions from public API

* Migrate reductions ops to new API

* Migrate get_constant_from_source to dev API

* Rename ref max to reduce_max

* Rename ref min to reduce_min

* Rename ref mean to reduce_mean

* Rename ref sum to reduce_sum

* Rename ref product to reduce_prod
- minor optimization in ReduceProd operator

* Restore custom isfinite for ov float types

* Fix type name in reduce_max.hpp

* Add missing include in shape_util.hpp

* Make count same type as data type in reduce mean

* Correct reduce sum doxy comment
2023-09-28 10:12:21 +00:00
Mateusz Mikolajczyk f5fe664fb7
[Ref][Core][Opset13] Add BitwiseNot operation (#19956)
* [Ref][Core][Opset13] Add bitwise_not operation

* Fix CI issues + add missing test

* improve test

* formatting

* Requested changes

* Remove unused include

* Add requested changes

* Try to fix test problems

* Fix CI

* Fix type validation

* Add checks in template eval
2023-09-27 08:17:53 +02:00
Pawel Raasz 519f13a177
[core]Api 2.0/migrate logical reduce ops to new API (#20043)
* Migrate ReduceLogicalOr to new API

* Migrate ReduceLogicalAnd to new API
2023-09-26 14:45:19 +02:00
Pawel Raasz 7d1b7b6bec
[core] Api 2.0/migrate operators without evaluate (#19988)
* Migrate ops evaluate

* Remove using ngraph and std from ops

* Use OPENVINO_ASSERT instead of NGRAPH_CHECK

* Move `shape_util.hpp` to `dev_api/openvino/core/`

* Remove visit_attributes, same as base impl

* Fix build issues

* Fix build issues
2023-09-25 14:22:59 +04:00
Katarzyna Mitrus 37271c1e7c
[Opset13][CPP] Initialization of Opset13 (#20005)
* Opset13 init

* Update test pattern ops

* Update remaining files
2023-09-25 10:20:37 +02:00
Pawel Raasz efb8484124
[core] Api 2.0/migrate swish op to new API (#19934)
* Migrate Swish operator to new API

* Remove `visit_attributes` as is same in base class
2023-09-22 16:38:24 +04:00
Pawel Raasz e7c1344d3c
[core] Api 2.0/migrate Add operator to new API (#19984)
* Migrate Add operator to new API

* Remove `visit_attributes` as it calls base impl

* Use shape inference to calculate broadcast shape
2023-09-22 11:57:02 +04:00
Pawel Raasz aa293c09ac
[core]Api 2.0/migrate ceiling op to new API (#19909)
* Migrate Ceiling op to new API

* Remove f16 precision from evaluate

* Correct ceiling reference doxy comments
- correct functor arg to be const
2023-09-22 10:53:41 +04:00