Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pytorch fronted]: Added support for Search Sorted op #26976

Conversation

pkowalc1
Copy link
Contributor

@pkowalc1 pkowalc1 commented Oct 9, 2024

Details:

  • Added support for SearchSorted op with unittest.

Tickets:

Depends on:

pkowalc1 and others added 30 commits October 2, 2024 12:25
Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
….hpp

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

Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
…notoolkit#26768)

### Details:
- Add check return value of node's evaluate in
`ov::interval_bound_evaluator` function. This check allows to replace
check if tensors are not empty (initialized), as when evaluate returns
true the result is valid.

### Tickets:
 - CVS-153113
### Details:
- Add definition of `OVAny` to `addon.ts` to encapsulate the concept of
[ov::Any](https://docs.openvino.ai/2024/api/c_cpp_api/classov_1_1_any.html)
from C++ API in a way that's clear and can be easily updated if the
underlying C++ type changes. Improved readability and maintainability.
-- 'OVAny' corresponds to Python API
[OVAny](https://docs.openvino.ai/2024/api/ie_python_api/_autosummary/openvino.OVAny.html)
- In future updates to Node.js API, the OVAny type is expected to be
enhanced with additional functionality.
 - Missed linter changes to `core.test.js` due to upstream merges

### Tickets:
 - [CVS-149319](https://jira.devtools.intel.com/browse/CVS-149319)
…6865)

### Details:
 - *Add documentation for batching on NPU plugin*
 - *...*

### Tickets:
 - *EISW-118045*

---------

Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>
Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
…toolkit#26869)

### Details:
- *Add subgraph identificator for operation name, so one operation in
two subgraphs can be distinguished as two different operations*
 - *...*

### Tickets:
 - *EISW-139849*

---------

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
…nce and adjust the NRMSE and PSNR metrics (openvinotoolkit#26020)

### Details:
Small improvements for SIT:
- Disable [dynamic quantization
feature](https://github.com/openvinotoolkit/openvino/blob/master/src/inference/include/openvino/runtime/properties.hpp#L574),
which is used by default by CPU pipeline to generate the reference
outputs and affects accuracy for some particular models
 - Increase number of decimals for reported NRMSE metric to improve
- For PSNR metric report fails only when the accuracy decrease not when
it increase above the target

### Tickets:
 - *[CVS-143420](https://jira.devtools.intel.com/browse/CVS-143420)*
…penvinotoolkit#26848)

### Details:
 - Update `fc_bf_tiled_kernel_dyn_quan` for osv_is_yx_osv64_isv2 support

### Tickets:
 - 153232
…nd NumPy 2.X (openvinotoolkit#26886)

**Details:** Run PT FE layer tests on Ubuntu 24.04 with Python 3.12 and
NumPy 2.X
Also, this PR contains fixes:
- WA sporadic bug on Windows in case parallel run
- support PT FE and TF FE layer tests on MacOS x86
- leftovers from code-review

**Tickets:** 154003, 153800

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
### Details:
 - Fix double constant definition
…otoolkit#26885)

This PR adds unit tests on

1. unpack routines within NPUW
2. main online partitioning functionality (smaller unit tests on Graph,
Group, Repeated, etc will be added separately)

Brings back openvinotoolkit#25780 

Local run:

```
[----------] Global test environment tear-down
[==========] 334 tests from 6 test suites ran. (3379 ms total)
[  PASSED  ] 334 tests.
```

---------

Co-authored-by: Alexey Smirnov <alexey.smirnov@intel.com>
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
…olkit#26892)

### Details:
 - Support complex tensors for `ExpandDims` operation + tests

### Tickets:
 - [None](openvinotoolkit#22950)
### Details:
- Debug code in network::execute() method is extracted to separate
class/file to improve code readability
@pkowalc1 pkowalc1 changed the title [Pytorch fronted]: Added support for Search Sorted op. [Pytorch fronted]: Added support for Search Sorted op Oct 11, 2024

@pytest.mark.nightly
@pytest.mark.precommit
@pytest.mark.parametrize(("sorted", "values"), [([[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]], [[3, 6, 9], [3, 6, 9]]),([1, 3, 5, 7, 9], [[3, 6, 9],[0, 5, 20]])])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this op contains type promotion and input conversion done internally in torch may affect out values, maybe test data should include also few handpicked values with fractional part just to be sure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - will prepare a malicious case just for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIxed.

Output<Node> values;
std::tie(sorted, values) = get_inputs_with_promoted_types(context, 0, 1);
const bool out_int32 = context.const_input<bool>(2);
PYTORCH_OP_CONVERSION_CHECK(out_int32 == false, "aten::searchsorted(out_int32=true) unsupported");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not just the output type of the operation? Can it be supported by just inserting Convert to i32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a part of aten::searchsorted API and it is(that flag) not supported at the moment as it is not needed.

PYTORCH_OP_CONVERSION_CHECK(out_int32 == false, "aten::searchsorted(out_int32=true) unsupported");
const bool right_mode = context.const_input<bool>(3);
PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(4), "aten::searchsorted(side) unsupported");
PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(5), "aten::searchsorted(sorter) unsupported");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@pkowalc1 pkowalc1 requested a review from a team as a code owner October 18, 2024 12:09
@github-actions github-actions bot added category: CI OpenVINO public CI github_actions Pull requests that update GitHub Actions code labels Oct 18, 2024
@github-actions github-actions bot removed category: CI OpenVINO public CI github_actions Pull requests that update GitHub Actions code labels Oct 21, 2024
PYTORCH_OP_CONVERSION_CHECK(out_int32 == false, "aten::searchsorted(out_int32=true) unsupported");
const bool right_mode = context.const_input<bool>(3);
PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(4), "aten::searchsorted(side) unsupported");
PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(5), "aten::searchsorted(out) unsupported");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same can be said about out_i32 which is just a Convert to i32

Copy link
Contributor Author

@pkowalc1 pkowalc1 Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task was to add minimal version that supports some roblox model - not a full scale op. out_i32 parameter and out parameter are not used in that model and as such are omitted. If needed - they can be always enabled later with proper testing etc.

The original deadline for enabling this minimal version is today(22 Oct 2024). This PR has been in review for 2 weeks now - if you don't see any issues for minimal version which is now in this PR, please pass it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm supporting this approach
Please create a list of leftovers/improvements we could pickup in a scope of next release. For this one let's focus on specific request to deliver it on time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fine, just please ensure we have a ticket for improved support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkowalc1
Copy link
Contributor Author

Dear reviewers, if you do not see any serious issues with this PR - please approve it, or add proper comment.

@pkowalc1
Copy link
Contributor Author

NOTE: Failing tests on ARM is a known issue and will be fixed after #27217 is merged.

@mlukasze mlukasze added this pull request to the merge queue Oct 24, 2024
Merged via the queue into openvinotoolkit:master with commit 6a8a69c Oct 24, 2024
156 of 159 checks passed
@pkowalc1 pkowalc1 deleted the add_search_sorted_op_to_pytroch_frontend branch October 30, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: PyTorch FE OpenVINO PyTorch Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.