Commit Graph

661 Commits

Author SHA1 Message Date
Maxim Vafin
ec50afd22b [PT FE] Support non boolean inputs for __or__ and __and__ operations (#19272)
Add test for __or__
2023-08-21 13:13:25 +02:00
Anastasiia Pnevskaia
3ef345095c Set CF=False. (#19223) 2023-08-17 11:22:26 +04:00
Anastasiia Pnevskaia
7a566313e5 Fixed 'output_model' logic in OVC. (#19171)
* Fixed output_model logic.

* Removed not needed code.

* Used os.path.basename, added comments.

* Removed loop.

* Test corrections.
2023-08-17 09:47:18 +04:00
Anastasiia Pnevskaia
3e23908983 Improvements and fixes in OVC convert_model (#19184)
* Added support of tuple in input, removed type syntax from OVC tool.

* Removed type syntax tests.

* Apply suggestions from code review

* Method annotation corrected.

* Type annotation corrected.

---------

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>
2023-08-17 09:45:30 +04:00
Ivan Tikhonov
8509737d0a Fix TransposeSinking for Gather (#19202)
* Fix TS gather

* enable pytest

* revert auto replaced comment
2023-08-15 16:23:01 +00:00
Sergey Lyalin
bf607a1238 Remove example_output for ovc and ovc.convert_model (#19079)
* Removed 'example_output' from ovc and ovc.convert_model, used output for this purpose

* Update tools/ovc/openvino/tools/ovc/convert.py

* Update tools/ovc/openvino/tools/ovc/convert_impl.py

* Reverted mo parts not affected by remove of example_output

* fix PDPD convert_model tests

---------

Co-authored-by: Xiuchuan Zhai <xiuchuan.zhai@intel.com>
2023-08-15 15:14:25 +04:00
Mateusz Mikolajczyk
f1d61f72ac [PT FE] Add aten::tensor_split transformation (#19144)
* Add aten::tensor_split

* Fix formating

* Reduce number of test cases

* fix requested changes
2023-08-14 18:31:38 +02:00
Piotr Krzemiński
e77070890a [PT FE] Fix Sporadic Quantized Ops Errors (#18962)
* [PT FE] Fix sporadics with round & 0 zero_pt, 1.0 scale

* [PT FE] Change scale and round input in quantized cat tests

* [PT FE] Add rounding to conv & linear tests

* Update test_quantized_cat.py

* Update test_quantized_cat.py

* [PT FE] Replace randn with rand for consistency in convnd
2023-08-14 15:41:36 +02:00
Ilya Lavrenov
2830b20d73 Removed 'wheel' upper bound in requirements.txt (#19170) 2023-08-14 17:40:25 +04:00
Maxim Vafin
b10b773f0c [PT FE] Support aten::randint and aten::index_put_ on mask (#19158)
* [PT FE] Support aten::randint and aten::index_put_ on mask

* Fix code style
2023-08-14 15:08:08 +02:00
Roman Kazantsev
329abd8864 [TF FE][TF Hub] Support UnsortedSegmentSum operation (#19165)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-13 17:49:38 +00:00
Roman Kazantsev
545c5bbde1 [TF FE][TF Hub] Support FakeQuantWithMinMaxArgs operation (#19154)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-11 16:58:35 +00:00
Ekaterina Aidova
9fd8a13fe6 [PT FE] aten::concat (#19101)
* [PT FE] aten::concat

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

* add out

* fix tests
2023-08-11 15:49:18 +04:00
Anastasiia Pnevskaia
6bf75f569c Fix of tensor names loosing for cf=True flag in MOC transformations. (#19014)
* Added shape and type infer for result nodes in MOC transformations.

* Clang format.

* Added validate_nodes_and_infer_types() pass at the end of MOC pipeline.

* Clang format.

* Added test.

* Clang format.
2023-08-11 15:19:07 +04:00
Maxim Vafin
cc08b0091e [PT FE] Remove torch strides compensation (#19129) 2023-08-11 10:46:04 +02:00
Anastasiia Pnevskaia
59872ee072 Removed InputCutInfo, disabled input cut in OVC. (#18927)
* Fixed output_model logic.

* Removed InputCutInfo, disabled input cut in ovc.

* Disabled output cut, added tests for setting shapes or types for not all inputs.

* Returned support of numpy type.

* Separated MO and OVC python API tests.

* Small corrections.

* Added output dir test, exceptions test.

* Tests fixed.

* Corrected extension param description.

* Corrected input description, minor code corrections.
2023-08-10 23:47:27 +04:00
Maxim Vafin
5f71679fb9 [PT FE] Use weight share switch in frontend (#18993)
* [PT FE] Use weight share switch in frontend

* Return static for function

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

* Fix issue with quantized constants

* Add tests for shared
2023-08-10 19:28:38 +00:00
Maxim Vafin
f5f221a3a9 [PT FE] Refactor aten::flatten and aten::transpose conversion (#19098)
* [PT FE] Refactor aten::flatten and aten::transpose conversion

* Fix code style

* Fix codestyle
2023-08-10 10:28:36 +02:00
Stefania Hergane
24f8c4105e [EISW-89824] [master] Rename VPUX to NPU (#19004)
* Change `VPUX`/`VPU` occurrences to `NPU`

* Switch `HARDWARE_AWARE_IGNORED_PATTERNS` VPU to NPU

* Rename `MYRIAD plugin`

* Rename vpu_patterns to npu_patterns in tools/pot

* Rename vpu.json to npu.json in tools/pot

* Rename restrict_for_vpu to restrict_for_npu in tools/pot

* Change keembayOptimalBatchNum to npuOptimalBatchNum

---------

Co-authored-by: Dan <mircea-aurelian.dan@intel.com>
2023-08-10 00:20:07 +04:00
Roman Kazantsev
1939dd1df0 [TF FE] [TF Hub] Support MaxPoolWithArgmax operation (#19085)
* [TF FE] Support MaxPoolWithArgmax operation

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

* Add ticket number for TS crash

* Correct error message

* Skip crashing tests

* Set additional tensor name for MaxPool

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-09 20:18:27 +04:00
Maxim Vafin
c44df9907b [MO] Do not create example inputs based on input or input_shape (#18975) 2023-08-09 18:01:35 +02:00
Roman Kazantsev
8d343ef0de [TF FE][TF Hub] Support UnravelIndex operation (#19060)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-08 21:00:04 +04:00
Maxim Vafin
542842b0c0 [PT FE] Fix sporadic issue in round layer tests (#19051)
* [PT FE] Fix sporadic issue in round tests

* Better comment
2023-08-08 14:14:38 +00:00
Roman Kazantsev
5a1dc93034 [TF FE][TF Hub] Support AdjustContrastv2 operation (#19029)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-08 13:49:52 +04:00
Ekaterina Aidova
c92f8ee86c [PT FE]: support aten::masked_scatter (#19038) 2023-08-08 09:35:55 +00:00
Maxim Vafin
70c8cf2a5f [PT FE] Support dynamic rank for aten::t (#19030)
* Support dynamic rank for aten::t

* Fix code style
2023-08-08 00:06:30 +04:00
Roman Kazantsev
710a46cb47 [TF FE][TF Hub] Support InvertPermutation and CheckNumerics operations (#19020) 2023-08-07 23:05:23 +04:00
Roman Kazantsev
b1db7223fd [TF FE][TF Hub] Support DivNoNan and EnsureShape operations (#19007)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-07 17:50:30 +04:00
Mateusz Mikolajczyk
a22c5f16b6 [PT FE] Add aten::linspace (#18998)
* Add linspace

* Add linspace tests

* Cleanup

* Format schema
2023-08-07 12:07:51 +02:00
Przemyslaw Wysocki
4ad072e55c [PyOV] Add temporary workaround for wheel building issue (#19011)
* Add upper bound

* Minor changes
2023-08-07 13:06:02 +04:00
Ekaterina Aidova
d2947e2385 [PT FE]: support aten::view_as and aten::std (#18960)
* [PT FE]: support aten::view_as and aten::std

* fix tests
2023-08-06 15:14:54 +04:00
Pawel Raasz
2385c2769e [PT FE] Improved MaxPool convert by PyTorch FE (#18965)
* Improved MaxPool convert by PyTorch FE

* Mark xfail corner cases for AvgPool

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

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

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

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

* Fix build issues

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-08-04 15:07:33 +00:00
Ekaterina Aidova
3c4beb1f16 [PT FE]: support aten::outer op (#18903) 2023-08-04 10:26:40 +02:00
Maxim Vafin
da36633c08 [PT FE] Raise graceful exception when model has incorrect type (#18976)
* [PT FE] Raise graceful exception when model has incorrect type

* Improve message
2023-08-04 09:36:09 +02:00
Roman Kazantsev
b44f915a9d [TF FE] Support ShapeN operation (#18913)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-02 15:28:39 +02:00
Anastasiia Pnevskaia
0769af959e "static_shape" parameter fix. (#18843)
* Fixed static_shape param.

* Removed wrong change.

* Fixed unit test.

* Corrected mistakes in tests, switched on smart_reshape.

* Removed not used method.

* Corrected test.
2023-08-02 13:03:38 +04:00
Ekaterina Aidova
968edc9375 [PT FE]: support aten::broadcast_to (#18899) 2023-08-02 08:38:34 +04:00
Andrey Kashchikhin
b6a32694a5 unskip tests in GHA (#18906) 2023-08-02 00:42:37 +04:00
Anastasiia Pnevskaia
c7cde6a102 Removed saved_model_tags from OVC, improved help. (#18785)
* Removed saved_model_tags, improved help.

* Fixed help, removed to string conversion of params.

* Help corrections.

* Small correction.

* Corrected wrong changes.

* Corrected wrong changes.

* Fixed arguments creating in cli parser.

* Renamed extensions parameter to extension.
2023-07-28 15:46:47 +04:00
Pavel Esir
98df87099a [MO] compress_to_fp16=True by default (2nd attempt) (#18652)
* [MO] compress_to_fp16=True by default (2dn attempt)

* fix unit-tests

* second round of fixin unit-tests

* set compress_to_fp16 default to True in ovc/cli_parser.py

* use save_model in mo_python_api_tests

* enforce compress_to_fp16=False in test_zero_copy

* selectively compress depending on the path user has chosen to generate IR

* corrected doc

* allow compress_to_fp16=False/True for ovc

* doc and unit-tests failing fix

* user save_model in ovc cli tool

* revert back serialize and compress_model but into main instead of moc_emit_ir

* cover more argument combinations for cli tool and convert_model
2023-07-27 12:32:50 +04:00
Mateusz Mikolajczyk
a0a1102499 [PT FE] Add quantized::cat (#18750)
* Add quantized cat

* Add quantized cat

* Format

* Improve tests

* Fix merge conflict
2023-07-27 10:32:17 +02:00
Surya Siddharth Pemmaraju
d42b53c070 Torchfx backend (#18244)
* Added Torchscript Backend

* First commit for backend with Torch FX Decoder

* Merging changes from Torch FX branch

* Torch FX initial fixes (Temporary)

* Fixed type/shape issues in Torch FX decoder

* Added translation for built-in getitem

* MaxPool update & Output shape fix (Torch FX)

* Torch FX graph outputs fix

* Torch FX support for sigmoid and slu_

* Torch FX graph module caching

* Torch Fx partitioner cache removed

* Torch FX initial getitem replacer added

* Index check for torch fx getitem replacer

* Debug print removed from partitioner

* Added environment variables for pytorch tracing mode and openvino device

* FX translation fix for getitem & getitem replacer removed

* Added checks for PyTorch tracing mode environment variable

* Adding compile mode for fallback

* Added more ops for resnet18

* Added a check for environment variable

* Generalized addmm to work with torchscript and torchfx

* Added the missing batch_norm.default translation

* fx_backend: include get_attr ops to the partitions

* AddeTODO note t to improvget_attr algorithm

* created function for adding get_attr nodes

* fx_backend: added aten.mul.Tensor, re-enabled aten.empty.memory_format

* fx_backend: Additional op support/improvement for Inception V3

* Added comment for fix 64-bit to 32-bit max int conversion

* fx_backend: Update for avg_poolnd to support 3 inputs

* Fixed erorr in decoder.py

* TorchFX caching fix

* Torch backend, op support for Stable Diff. & BERT

* Arranged ops in order and added torch tensor mapping

* Added support for more ops for super glue

* TorchFX: Initial permanent fallback

* TorchFX: New ops for improved TorchVision support

* TorchFX backend optimizations for partitioning and tmp fallback

* working operator updates for superglue

* Updates to operators for superglue

* Removed max.dim and stack

* Cleanup

* Cleanup

* Fixed a couple of syntax issues

* Fixed a couple of syntax issues

* Added missing method to TorchFX Decoder

* Added missing method to TorchFX Decoder

* Removed redundant code for transpose

* TorchFX: Initial StableDiffusion support

* PyTorch decoder ovtype to ctype fix for int64

* Added ops for distilbert

* Fixed few unnecessary include statements

* Seperated TorchFX and TorchScript decoders

* Modified import statements to reflect two decoders

* f64 fix for TorchFX

* Import fix for PyTorch backend modules

* TorchFX serialize graph for debugging (Temporary)

* Serialize and load back feature enabled for TorchFX

* Temporary optimization to remove Broadcast

* Temporary SoftmaxRehapeElimination pass is added

* TorchFX custom model cache directory

* PyTorch bitwise translation, conversion checks enabled

* Naming fix in make_list_construct

* TorchFX: Added comments to Softmax and Slice translations

* translate_chunk temporarily removed for TS backend

* Fixed linter issues

* Addressed clang formatting issues

* Fixed few more clang and linter issues

* Fixed tests to use ts_decoder

* Fixed naming convention issues

* Added missing import

* Added inlined_inputs to TorchScriptDecoder

* Added tests for torch fx backend

* Removed magic numbers in PyTorch decoder utils

* TorchFX decoder data type fix

* Added cast from size_t to int

* TorchFX output handling code cleanup

* TorchFX: Use detached input tensor

* Added missing cast from size_t to int

* Added static cast in group_norm

* Fixed casting issue in split

---------

Co-authored-by: ynimmaga <yamini.nimmagadda@intel.com>
Co-authored-by: Cavus Mustafa <mustafa.cavus@intel.com>
2023-07-26 16:23:42 +02:00
Anastasiia Pnevskaia
5aad9ee652 Used share_memory param in tf.Graph decoder. (#18747) 2023-07-25 11:16:17 +02:00
Ekaterina Aidova
016eb43741 [PT FE]: fix issues with squeeze producing dynamic rank (#18748)
* [PT FE]: fix issues with squeeze producing dynamic rank

* Update test_squeeze.py

* Update test_squeeze.py

* Update test_slice.py

* Apply suggestions from code review
2023-07-24 20:10:20 +04:00
Maxim Vafin
bc734dfaaa [PT FE] Enable quantized conv and linear tests (#18723) 2023-07-24 13:33:11 +02:00
Maxim Vafin
f96f021920 [PT FE] Add helper for regular ops on quantized values (#18692)
* Add helper for regular ops

* Update op_table.cpp

* Support ops with more then 1 output

* Uncheck ops that return integer/boolean type
2023-07-22 16:47:44 +02:00
Piotr Krzemiński
e076ed4726 [PT FE] Quantized Add, Add_ReLU, Mul, Hardswish (#18510)
* Support GetAttr with packed params

* Apply suggestions from code review

* [PT FE] Add quantized types as normal types to decoder

* [PT FE] Add decoder dequantize, add dtypes to quantize

* [PT FE] Add dequantize example

* [PT FE] Implement replacer for quantized nodes

* [PT FE] Register replacer for quantize/dequantize

* [PT FE] Remove unwanted junk from previous version

* [PT FE] Fix building mistakes for frontend

* [PT FE] Clang fix

* [PT FE] Ease of use upgrade to quantize funcs

* [PT FE] Clang format

* [PT FE] Introduce new version of quantize/dequantize

* [PT FE] Remove unwanted files from new version

* [PT FE] Fix style

* [PT FE] Add QuantizedPtNode replacer, fix accuracy error

* [PT FE] Quantized add

* [PT FE] Add improved version of quantize/dequantize with shared_ptrs

* [PT FE] Quantized Add Relu

* [PT FE] Fix utils shared ptr reference error

* [PT FE] Quantized Hardswish & tests

* [PT FE] Add quantized_add_relu test

* [PT FE] Quantize now takes correct input for operations

* [PT FE] Add dtype to tests

* [PT FE] Increase matrix size in the tests to cover more edge cases

* [PT FE] Upgrade quantize method

* [PT FE] Add BFS for dequantize, add quantize_per_channel

* [PT FE] Add missing replacer to frontend, improve tests

* [PT FE] Rename replacer -> remover, remove unwanted header files

* [PT FE] Change function declarations to return ov::Output instead of shared ptr

* [PT FE] Add missing context mark node

* [PT FE] Remove unknown modifications to ie_c_api

* [PT FE] Remove fp16 support, turn off int32 tests

* [PT FE] Clang format

* [PT FE] Fix quantize_per_tensor

* [PT FE] Minor fixes from review

* [PT FE] Remove dequantize, remove helpers, replacer now removes nodes instead

* [PT FE] Rename Replacer to Remover for dequantize nodes

* [PT FE] Clang format

* [PT FE] Move comments to header files, minor import fixes

* [PT FE] Enable add, add_relu, mul, hardswish with newest quantize ops

* [PT FE] Fix clang format

* [PT FE] Fix dtype issue

* [PT FE] Reenable hardswish tests

* [PT FE] Fix building error for quantized ops

* [PT FE] Tests now use rand instead of randn

* [PT FE] Remove int32 support from tests

* [PT FE] Fix quantize_per_channel tests

* Apply suggestions from code review

Removing sporadic tests from precommit

* Apply suggestions from code review

* [PT FE] Mark qint32 with skip, remove precommit flag due to sporadic errors

* [PT FE] Introduce quantized test for PytorchTestClass

* [PT FE] Add missing tensor size in the errors count computation

* Update pytorch_layer_test_class.py

* [PT FE] Apply suggestions from review - remove contexts, log100 for errors, add precommit flags

* Apply suggestions from code review

* [PT FE] Fix quantize per channel test after merge

* Update tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py

* Update pytorch_layer_test_class.py

* Update test_quantize.py

* Apply suggestions from code review

* [PT FE] Fix quantized mul by changing default quantization dtype

* Update pytorch_layer_test_class.py

* Update tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py

* Update src/frontends/pytorch/src/utils_quantize.cpp

* Update src/frontends/pytorch/src/utils_quantize.cpp

* Update tests/layer_tests/pytorch_tests/test_quantized_mul.py

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-07-21 10:27:35 +00:00
Maxim Vafin
12b1df5db3 Disable sporadically failing tests (#18694) 2023-07-20 21:34:43 +00:00
Anastasiia Pnevskaia
8d5a0b1d53 OVC cleanup. (#18649)
* WIP: parameters cleanup

* Removed debug output, fixed CLI

* Fixed python objects conversion

* Finally renamed mmap to share_weights

* Fixed TF conversion from a file or a directory

* Fixed obvious errors in unit tests

* Deleted layouts from OVC. Fixed most of the fails in ovc unit tests (there are still failures)

* Clenaup other references to layouts and fixed --version

* Fixed case when two model files are passed in TF case

* Fixed multiple model parts passing in ovc command line

* Tests fixed, support of unnamed input in cli parser.

* Remove convert_model from runtime.

* Changed silent to verbose.

* Removed transform param.

* Removed example_input, share_weights from ovc cli tool.

* Remove wrong change.

* Test fix.

* Code corrections.

* Returned comment.

* WA to fix process hanging after extension loading.

* Removed not needed code.

* Added comment.

---------

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>
2023-07-20 20:11:28 +00:00
Mateusz Mikolajczyk
bc261424ef [PT FE] Add quantized::conv2d and quantized::conv2d_relu (#18651)
* Add quantized conv2d

* Fix schema

* Remove mark_output

* Remove tests from pre-commit
2023-07-20 15:35:11 +00:00