Commit Graph

91 Commits

Author SHA1 Message Date
Ekaterina Aidova
fb4efe7203 [PT FE]: support flip operation (#17705)
* [PT FE]: support flip operation

* more tests
2023-05-31 12:07:24 +02:00
Ekaterina Aidova
2d7db5e3d3 [PT FE]: support aten::cdist and aten::pairwise_distance (#17718)
* [PT FE]: support aten::cdist and aten::pairwise_distance

* p and eps non-const
2023-05-31 12:07:12 +02:00
Mateusz Mikolajczyk
a1a753bb03 [PT FE] Add translation for aten::__range_length and aten::__derive_index (#17618)
* Add operators and tests

* Fix op kind

* Merge tests

* Fix freeze issue as separate bug

* Fix indent

* Fix print placement

* Fix dtype
2023-05-29 13:34:08 +00:00
Ekaterina Aidova
3300543eac [PT FE]: support frobenius norm and fix aten::norm (#17701)
* [PT FE]: support frobenius norm and fix aten::norm

* fix code style
2023-05-29 11:14:16 +04:00
Mateusz Mikolajczyk
6501d963fc Add aten::item (#17730) 2023-05-26 18:05:24 +02:00
Ekaterina Aidova
b2aaa10ef6 [PT FE]: support aten::unflatten (#17736)
* [PT FE]: support aten::unflatten

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

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-05-26 15:27:05 +00:00
Ekaterina Aidova
307b666d99 [PT FE]: support boolean data type in sum operation (#17715) 2023-05-26 15:44:50 +04:00
Maxim Vafin
fe1ac700f0 [PT FE] Fix issues in multiple operations (#17418)
* Fix issues in aten::chunk and aten::split_with_sizes replacers

* Fix code style

* Fix compute issue

* Fix code style

* Support 1 chunk

* Fix issues in meshgrid, sqrt, rsqrt and exp operations

* Use Interpolate-11

* Fix unary ops

* Add tests for unary ops

* Fix unary ops tests

* Add changes in utils

* Fix mo test

* Remove extra line

* Fix mo tests for int
2023-05-22 10:35:34 +02:00
Mateusz Mikolajczyk
9b52a77531 [PT FE] Fix aten::conv2d conversion issues related to bias (#17228)
* Allow for conversion

* Check for const

* Apply requested changes

* Improve tests
2023-05-22 09:59:02 +02:00
Ekaterina Aidova
dcd034fb4d [PT FE]: support aten::argmax and aten::argmin (#17489) 2023-05-19 15:55:36 +00:00
Surya Siddharth Pemmaraju
e14d1b2a07 Torchscript backend (#17132)
* Added torch script backend

* Added ts_backend to pytorch layer tests

* Added use_ts_backend fixture to the test suite to activate the
torchscript backend

* Fixed failing test_dict layer test

* Added USE_TS_BACKEND as an env variable

* Removed use_ts_backend fixture

* Added more tests for ts backend

* Added more information in the comments about usage

* Removed convolution3d test from precommit_ts_backend

* Added some torchscript backend tests to ci

* Removed tests from CI as torch.compile doesn't support 3.11 currently

* Fixed linter issues

* Addressed PR comments and linter issues
2023-05-17 14:58:38 +02:00
Anastasia Kuporosova
75fa11c80f [PyOV] Remove deprecated (#17512)
* [PyOV] Remove deprecated

* remove deprecated api

* remove tests

* update pot
2023-05-16 21:48:39 +02:00
Ekaterina Aidova
66e1af18b5 [Pt FE]: aten::embedding_bag (#17098)
* [Pt FE]: aten::embedding_bag

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

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-05-10 09:44:08 +02:00
Maxim Vafin
48604e9092 Support sizes input as list to upsample ops (#17350) 2023-05-07 19:23:51 +02:00
Maxim Vafin
c1933fcaf0 [PT FE] Support default strides for avg and max pooling (#17337)
* Support default strides for avg and max pooling

* Fix code style

* Remove changes from other ticket
2023-05-04 09:27:10 +02:00
Piotr Krzemiński
1c286e4636 [PT FE] Add aten::all implementation (#16901)
* [PT FE] aten::all implementation with tests

* [PT FE] Add non-dynamic type check

* [PT FE] Update tests, temporarily turn off uint8 tests

* [PT FE] Fix dtype for uint8

* [PT FE] Apply suggested optimizations

---------

Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
2023-05-02 21:12:12 +02:00
Maxim Vafin
89d3eaa67f Fix issue with Pow when both inputs are scalars (#17305)
* Fix issue with Pow when both inputs are scalars

* Fix code style
2023-05-02 16:49:42 +02:00
Piotr Krzemiński
b7311d8907 [PT FE] Fix aten::chunk for dynamic shapes (#16902)
* [PT FE] Add replacer for chunk+getitem

* [PT FE] Fix missing replaced nodes, fix incorrent chunk size calculation

* [PT FE] Fix incorrect item shape, reduce tests count

* [PT FE] Convert back with frontend

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-05-01 09:32:10 +00:00
Maxim Vafin
10392644e3 [PT FE] Enable stable sort layer tests (#17229)
* [PT FE] Enable stable sort layer tests

* Remove unused code
2023-04-26 18:24:38 +02:00
Ekaterina Aidova
6389f423bf [PT FE]: implement scaled dot product attention (#17178)
* [PT FE]: implement scaled dot product attention

* Apply suggestions from code review

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

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

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

---------

Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
2023-04-26 12:51:02 +04:00
Ekaterina Aidova
39ed9a624f [PT FE]: extend batch norm to support training mode (#17040) 2023-04-25 11:27:00 +02:00
Piotr Krzemiński
22a81e0e58 [PT FE] Enable stable tests for sort & argsort (#16415)
* [PT FE] Enable stable tests for sort & argsort

* Update test_argsort.py

* [PT FE] Update to opset11

* [PT FE] Remove redundant argument from argsort test

---------

Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com>
2023-04-25 01:21:16 +04:00
Maxim Vafin
25015f9790 [PT FE] Support prim::DictConstruct on the output (#16894)
* Support dict on the output

* Preserve output order
2023-04-13 16:42:17 +00:00
Ekaterina Aidova
ca2265395d [PT FE]: fix aten::mean behaviour for provided dtype (#16790) 2023-04-11 14:29:29 +04:00
Ekaterina Aidova
d41663694c [PT FE]: aten::gather (#16784)
* [PT FE]: aten::gather

* add detach and sign
2023-04-11 14:28:05 +04:00
Ekaterina Aidova
d407bc1b3b [PT FE] fix invalid reshape shape after aten::index (#16821)
* [PT FE] fix invalid reshape shape after aten::index

* support aten::index_select
2023-04-11 12:41:59 +03: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
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
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
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
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
Ekaterina Aidova
179403ddc9 [PT FE]: improve integration into mo.convert_model (#16243) 2023-03-24 16:55:07 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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