Commit Graph

420 Commits

Author SHA1 Message Date
Ivan Tikhonov cfd42bd2cb
Handle Reshape's special zero in SimplifySecondInputOfReshape (#20785) (#20820)
* Handle Reshape's special zero in SimplifySecondInputOfReshape

SimplifySecondInputOfReshape detects ShapeOf->Gather->Concat
subgraphs on Reshape's second input and replaces ShapeOf->Gather
with a Constant with zero(s). Currently it works only with Reshapes
that have special_zero set to true, but it can work for Reshapes
with special_zero == false if non-Gather inputs to Concat are Constants
and don't contain any zero.

Ticket: CVS-123434

* fix no default output

Co-authored-by: Mateusz Tabaka <mateusz.tabaka@intel.com>
2023-11-02 17:43:25 +04:00
Andrei Kochin 663bf04208
Revert Bitwise ops in PyTorch FE (#20813)
* revert bitwise op for PT FE

* revert coverity fixes
2023-11-02 13:08:55 +00:00
Nikolay Shchegolev 57571d36e6
[CPU] NMSRotated operation implementation. (#20410) 2023-10-31 12:10:52 +00:00
Vladislav Golubev 2932e9e938
ReshapeBMatMul and ReshapeAMatMul: avoid circular dependencies creation (#20771) 2023-10-31 15:00:52 +04:00
Mateusz Mikolajczyk fdb22c8610
[Opset13][PT FE] Update torch bitwise operators (#20339)
* Add opset-13 bitwise implementation

* Improvements in test

* Add transformation BitwiseOps->LogicalOps for bool

* Improve existing tests to better tests dtypes

* Disable transformatiions for supported bitwise ops

* Improvebitwise test inputs

* Update src/common/transformations/src/transformations/op_conversions/convert_bitwise_to_logical_bool.cpp

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

* Update src/common/transformations/src/transformations/op_conversions/convert_bitwise_to_logical_bool.cpp

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

* Update src/common/transformations/src/transformations/op_conversions/convert_bitwise_to_logical_bool.cpp

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

* Update src/common/transformations/src/transformations/op_conversions/convert_bitwise_to_logical_bool.cpp

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

* Update to REGISETR_PASS

---------

Co-authored-by: Katarzyna Mitrus <katarzyna.mitrus@intel.com>
2023-10-30 13:11:14 +00:00
Pavel Esir 539b5a83ba
keep disable_fp16_compression rt_info (#20625)
* keep disable_fp16_compression rt_info

* style fix

* style fix 2

* cleanup init_node_info.cpp; redefining a class for rt_info in Serialize

* move rt_info refreshing inside serialize.cpp

* rename rt_info name in IR

* add rt_info serialize test

* add ticket number

* updated comments

* code style fix

---------

Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
2023-10-27 22:41:37 +00:00
Pawel Raasz 751d844b24
[shape infer]Review Reshape class for shape inference aspects (#18679)
* Add static shape adapter
- Adapters holds CPU dimension which can be reference to it or vector
- Add ov::optional for holding optional result from shape inference
- Add new `infer` function in `IStaticShapeInfer`

* Temporary support of StaticShape

* Minor corrections in ShapeInferenceTA

* Migrate shape_infer to new interface version

* Replace StaticShape by adapter implementation

* Replace IShapeInferCommon by IStaticShapeInfer

* Correct code formatting

* Fix build issues

* NodeValidationFailure::create for StaticShapeRef

* Review shape inference for reshape operator
- review shape_infer implementation
- add more unit test for static and dynamic shapes

* Fix build issues

* Correct minus one dim calculation

* Fix build issues on windows

* Improve resolving special minus one

* Use NODE_SHAPE_INFER_CHECK

* Update product in/out calculations

* Temporary add ngraph header to solve build issue

* Correct minus one dim calc when static part same

* Add check for scalar input

* Remove debug message

* Fix `minus one` dynamic dimension calculation

* Fix `minus one` dynamic dimension calculation

* Fix merge issues in reshape
Minor refactor reshape evaluate

* Don't pass input label on minus one pattern
when input dimension will be modified.
2023-10-27 16:56:25 +02:00
Ivan Tikhonov 69e1258cc5
Support dynamic seq lenghts in ConvertSequenceToTensorIterator transformation (#20671) 2023-10-27 16:55:52 +04:00
Evgenya Nugmanova f2b26962fa
De-Reshape MatMul (#20396)
* De-Reshape MatMul

* Fixed includes

* Comments resolved

* Style

* comment adressed
2023-10-25 09:04:04 +00:00
Vladimir Paramuzov 3313d1ce7a
[GPU] FC with 4-bit weights compression support for iGPU (#20572) 2023-10-25 12:45:31 +04:00
Oleksii Khovan 984e4dbf35
[GPU] NMSRotated-13 (#20411)
* Add Rotation support to primitive and kernel

* Add unit tests

* Add transformation for NMSRotated

* add single-layer tests

* Fix: angle value for the same box may have its sign changed several times passing through iterations of batch and class loops.

* fix review comments
2023-10-24 21:36:02 +02:00
Evgeny Kotov 22184c32f4
fix random layer names and count (#20323)
* add sorting for fix sporadic failure in SharedOpOptimization shared_node_optimization

* fix Output and Input comparison

* remove unneed sorting from transformation

* add unit test

* code review fixes

* code review fixes

* code review fixes

* code review fixes

---------

Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com>
2023-10-24 18:18:50 +02:00
Evgeny Kotov 251602636c
Fuse GeLU (#20428)
* add transformation + test

* move transformation to GeluFusion

* add comments

* code review fixes

* fix

* code review fixes

* code style fix

* fix windows build warning
2023-10-24 18:23:14 +04:00
Mateusz Tabaka b7406247ff
Add TransposeMatMul transformation to MOC (#20460)
Transformation fuses Transpose on first or second MatMul's input
and sets MatMul's transpose_a/transpose_b accordingly.

TransposeMatMul is already part of SmartReshape, but it can be added
to MOCTransformations as well so native models that are don't use reshape
can benefit from that.

Ticket: CVS-118908
2023-10-24 14:40:36 +02:00
Mateusz Tabaka 2668f68816
CompressQuantizeWeights - fix zero point calculation (#20541)
Current implementation tries to leverage branchless approach, but it's not correct
if scale is 0. In that case - zero point can can become inf or nan and multiplication
by 0 doesn't change its value. That causes another issue - infinite or NaN zero point
cannot be optimized out later.

Ticket: CVS-122931

Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com>
2023-10-24 10:21:06 +02:00
Vladislav Golubev afda7ad70f
[Transformations] FuseU4WeightsAndZeroPoint transformation (#20503) 2023-10-24 09:44:26 +04:00
Roman Kazantsev 009ef5657c
[TF FE] Provide full support of TF1 Control flow and TensorArray* ops (#20270)
* [TF FE] Provide full support of TF1 Control flow and TensorArray ops

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

* Add missed header for TensorArrayV3 op

* Temporarily disable GRU cell fusion

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

* Fix a case when element_shape for TensorArrayV3

* Fix translator for TensorArrayCloseV3

* Update summarize graph with TensorArrayCloseV3

* Add layer tests for TensorArrayScatterV3, Close, Size, Array

* Fix output shape for Merge node

* Remove unused variable

* Fix translator for TensorArrayConcatV3

* Fix translator for TensorArrayConcatV3

* Add layer tests for TensorArrayWriteV3, Gather, and Concat

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

* Add translator for GatherTree

* Fix TF FE unit-test for GatherTree

* Fix GatherTree translator

* Fix GatherTree translator to handle 1d end_token

* Fix undeclared parameter issue

* Fix GatherTree unit-test

* Add TensorArrayV3Replacer transformation

* Temporarily disable dangling transformation

* Recover RemoveMultiSubGraphOpDanglingParamsResults transformation

* Recover GRUCellFusion transformation

* Simplify check for GRUCellFusion transformation

* Use proper name for unit-tests

* Simplify translator for TensorArrayWriteV3

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

* Fix RemoveMultiSubgraphOpDanglingParamsResults transformation

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

* Additional fix for remove_multi_subgraph_op_dangling_params

* Make static TI run a dynamic subgraph

* Dedicated SL test

* Change condition to respect stat shapes

* Adjust test to cover the code path properly

* Recover fallback for still failing case GNMT

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
Co-authored-by: Maksim Kutakov <maksim.kutakov@intel.com>
2023-10-23 22:50:26 +02: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
Ivan Tikhonov cd4623d2f6
Transformations: API 2.0 transition part 4 (#20445)
* Transformations: API 2.0 transition part 4

* fix code style
2023-10-14 00:27:43 +02:00
Ilya Lavrenov 56d74a82cb
Relocatable developer package (#20327)
* Merge Linux CC + static build + clang compiler

* Improvements

* Removed ie prefixes from cmake scripts

* Fixes for NPU

* Initial relocatable OpenVINO Developer package

* Improvements

* Try to fix

* improvements

* Export a lot of headers

* Removed NVIDIA pipeline; make it to be a job

* Fixes

* Fixes 2

* Try ilya-lavrenov repo

* Clean-up

* More imrpovements

* Even more improvements

* Override export, install

* Override export, install

* Disable pythonwheel generation for relocatable OV dev package

* Fixed issues with versions

* Fixed android build

* Fixed android build

* Fixed NPU build

* Update src/bindings/python/CMakeLists.txt
2023-10-12 22:59:04 +00:00
Nadezhda Ageeva 4426486e6f
[nGraph Transformations] Add missing rtinfo copy in ConvertPrecision transformation (#20347) 2023-10-10 13:47:52 +00:00
Evgeny Kotov 4d9f2f3cd7
Support new operations in TS: Selu, Swish, HSwish, Tile, CumSum, HardSigmoid (#19990)
* add new operations as unary

* get unary as input(0) instead of iterating pattern map

* add CumSum + unit tests

* add Tile + unit tests

* add tile

* fix ts_tile

* code review fix: use ADD_MATCHER

* fix bug CI tests
2023-10-10 15:06:10 +04:00
Mateusz Tabaka 4a3ce48f7a
CompressQuantizeWeights optimizations (#20025)
* Optimize CompressQuantizeWeights transformation

- remove CoordinateTransform usage from FakeQuantize reference implementation
- move ZeroPointOptimizer functionality inside CompressQuantizeWeights
- compute scale and zero point in the same loop

Ticket: CVS-119273

* review comments

* clang format

* fix comments
2023-10-10 13:10:05 +04:00
Anton Voronov aa6adcd261
Gather: removed indices normalization pass and added some checks for Gather-8 -> Gather-7 conversion (#19666)
* Do not normalize negative indices for Gather v8

* code style fix

* added transformation test with accuracy check for Gather-v8

* removed GatherNegativeConstIndicesNormalize transformation at all

* ConvertGather8ToGather7 conversion: added more checks

* Introduced shared Gather8withIndicesDataLayerTest: added CPU, GPU instances

* code style fix

* small fix

* review fixes

* do negative indices normalization if possible

* code style fix

* refactor cpu test instances

* code style fix
2023-10-10 11:17:33 +04:00
Ilya Lavrenov d6c2a10b38
Merge Linux CC + static build + clang compiler (#20243)
* Merge Linux CC + static build + clang compiler

* Improvements

* Fixes
2023-10-06 00:30:11 +04:00
Ivan Tikhonov 3d6fb85a99
Model builders refactoring: rename dirs, targets, file names (#19885)
* Model builders refactoring

* Apply review comments

* resolve review commets: update cmake target names

* fix build: use correct headers

* fix headers

* fix build

* fix docs
2023-10-04 18:08:24 +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
Andrei Beleiu b5f4087f66
[transformations][WeightsDequantizeToFakeQuantize] Extend pattern matching (#19772)
* [transformations] WeightsDequantizeToFakeQuantize: Extend pattern matching with the case when both Subtract inputs are Convert

* [transformations] WeightsDequantizeToFakeQuantize: Added new tests to cover the extention added to pattern match

* Fix review comments
2023-09-27 10:06:06 +01:00
Roman Lyamin 1ba8005688
[GPU] Disabling redundant copying of constant weights (#18949) 2023-09-26 18:43:57 +04:00
Mateusz Tabaka 5384fe43df
Add EnableShapeOfConstantFolding transformation (#19880)
* Add EnableShapeOfConstantFolding transformation

Transpose sinking (that is used in TF frontend) disables ShapeOf constant folding
which prevents some optimizations further in the pipeline.
This patch introduces EnableShapeOfConstantFolding that removes DisableConstantFolding
from ShapeOf nodes.

Ticket: CVS-118890

* add description

* review comments

* headers
2023-09-26 15:53:23 +02:00
Nadezhda Ageeva 9e7938106b
[Transformations] Fix unroll if transformation rt info (#20047)
* [Transformations] Fix unroll if transformation rt info

* Update test to check body names
2023-09-26 13:13:52 +00:00
Anton Voronov 3ce48fc3d6
Fixed OV static build issues (#19976) 2023-09-26 10:23:00 +04:00
Pavel Esir efe54362fd
fix f16/f32 el type mismatch for shape subgraphs: Parameter type should not be fused for precision sensitive nodes (#19959)
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-09-22 02:06:39 +04:00
Vladislav Golubev 0e0e1b0ee6
SmartReshape: ReshapeMatMul transformations are fixed (#19987)
* SmartReshape: ReshapeMatMul transformations are fixed

* clang-format fixes
2023-09-21 19:49:07 +02:00
Maxim Vafin d0ef28e541
Reverse infer deduce second Squeeze input (#19923)
* Reverse infer deduce second Squeeze input

* Fix build

* Fix tf tests

* Small optimization

* Fix type

* Fix tests
2023-09-21 17:37:33 +02:00
Tomasz Jankowski c4adf80ec6
[Core] Move SlicePlan to Dev API (#19971)
* Move SlicePlan to Dev API

* Recover legacy API

---------

Co-authored-by: Evgenya Nugmanova <evgeniia.nugmanova@intel.com>
2023-09-21 14:41:01 +02:00
Evgenya Nugmanova c1a8380052
Symbolic shape inference and graph optimizations (#19392)
* Symbolic shape inference and graph optimizations
- Prepares a place in CommonOptimizations pipeline for symbolic optimizations
- Introduces symbolic propagation and symbolic optimizations for ChainedMaximum, NopBroadcast and shape sub-graph optimization
- Introduces utility runtime info for TableOfEquivalence passing and disabling of value invalidation during shape inference

* Executes NgramFusion in a symbolic environment. Relaxes Ngram fusion pattern utilizing symbolic knowledge

* Remove debug model visualization

* rt_info copying to new Add operation

* Fix visualization and place validation in nicer place in symbolic transformation

* Fix Slice operation not to propagate labels if input and output dimension is fully dynamic

* Covering Vladislav comments

* Replace value invalidation followed by validation to revalidation since it does the same thing

* Adding back invalidation of cached values to Symbolic Propagation pass

* Fix StridedSlice label propagation. Code style

* Update src/common/transformations/tests/symbolic_transformations/nop_broadcast.cpp
2023-09-20 18:00:07 +04:00
Evgeny Kotov 35d0d92ef7
fix TSGatherForward transformation (#19821)
* fix ts_gather_forward

* remove unneeded header
2023-09-19 13:55:43 +04:00
Ilya Lavrenov 54609e7b72
Removed FixRtInfo pass (#16870)
* Removed FixRtInfo pass

* Removed FixRtInfo pass

* Fixed macOS compilation
2023-09-19 00:07:59 +04:00
Ilya Lavrenov 35a0706dff
Replaced several cmake utilities with new ov_ prefix (#19819)
* Replaced several cmake utilities with new ov_ prefix

* Replaced several cmake utilities with new ov_ prefix
2023-09-14 16:22:50 +04:00
Mateusz Tabaka d0dda74fc2
Handle negative values in GroupedSliceToVSplitOptimization (#19495)
* Handle negative values in GroupedSliceToVSplitOptimization

CVS-118897

* change the way of getting slice inputs

* clamp value

---------

Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com>
2023-09-11 18:31:39 +04:00
Mateusz Tabaka a55b5381d3
Move BroadcastTransition to MOC (#19543)
* Move BroadcastTransition to MOC

Broadcast that could be eliminated by BroadcastElementwiseFusion are moved down the graph
(by BroadcastTransition registered in the plugins). That prevents BroadcastElementwiseFusion
to eliminate them.

Ticket: CVS-118899

* dont count const layers

* remove virtual inheritance
2023-09-08 11:05:54 +04:00
Ilya Churaev 1d62f0141d
Rename cmake ie_ macros and ie_parallel script (#19606)
* Rename cmake ie_ macros and ie_parallel script

* Add warning messages
2023-09-05 19:31:52 +02:00
Evgenya Stepyreva fef4d4d641
Auto batch lost label fix (#19535)
* Restored opset1::Reshape label peropagation for -1 special value

* Lets opset1::Reshape keep same shape infer. Makes FindBatch transformation keep labels in output shapes of Result node

* uses Parameter from correct namespace
2023-09-04 17:11:09 +02:00
Mateusz Tabaka bd0c156a70
PullReshapeThroughReduce - skip transformation if Reshape doesn't unsqueeze input (#19477)
Ticket: CVS-118905
2023-09-04 13:58:53 +02:00
Tomasz Jankowski 51df17912b
[Ref_Impl] Change namespace from nG to OV (#19363)
* Use quotes for openvino includes

* Drop runtime from openvino::reference

* Drop runtime::reference

* Replace ngraph::reference with ov::reference - defs

* Replace ngraph::reference with ov::reference - uses

* Drop redundant nesting

* Fix non arch64 builds

* Move coordinate*pp files under openvino

* Move Coordinate... helpers under ov:: namespace

* Revert not needed changes

* Fix missing namespace scope

* Fix compilation

* Fix code style

* Use ov suppress deprecated macro instead of ngraph

---------

Co-authored-by: Raasz, Pawel <pawel.raasz@intel.com>
2023-09-04 08:07:06 +04:00
Mateusz Tabaka 441adcc122
SplitSqueezeConcatFusion - handle Squeeze nodes without second input (#19512)
Ticket: CVS-119330
2023-09-01 23:35:17 +04:00
Nadezhda Ageeva b81cad6ae5
Update ConvertReduceToReshape transformation to support ReduceProd (#19532) 2023-09-01 10:52:05 +00:00
Mateusz Tabaka 120a81ff5e
Disallow LeakyReluFusion when alpha is greater than one (#19446)
Tickets: CVS-118898, CVS-82454
2023-08-31 14:41:46 +04:00
Mateusz Tabaka 6ad11108b5
Fix include path in TS ShapeOf tests (#19507) 2023-08-30 17:00:03 +02:00