Skip to content

[OpenVINO Backend] support ops.slice_update #21362

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mohamed-Ashraf273
Copy link
Contributor

@Mohamed-Ashraf273 Mohamed-Ashraf273 commented Jun 6, 2025

Hi @rkazants ,
I've supported ops,silce_update for my GSoC project, but I can't enable tests for it until getting __getitem__ merge.

It could be implemented more easily if we use opset15 instead of opset14.

@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2025

Codecov Report

Attention: Patch coverage is 92.15686% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.82%. Comparing base (d55a767) to head (8093d51).

Files with missing lines Patch % Lines
keras/src/backend/openvino/core.py 92.15% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21362      +/-   ##
==========================================
+ Coverage   82.81%   82.82%   +0.01%     
==========================================
  Files         565      565              
  Lines       55520    55571      +51     
  Branches     8664     8673       +9     
==========================================
+ Hits        45977    46025      +48     
- Misses       7428     7429       +1     
- Partials     2115     2117       +2     
Flag Coverage Δ
keras 82.63% <92.15%> (+0.01%) ⬆️
keras-jax 63.32% <0.00%> (-0.06%) ⬇️
keras-numpy 58.53% <0.00%> (-0.06%) ⬇️
keras-openvino 34.05% <92.15%> (+0.06%) ⬆️
keras-tensorflow 63.77% <0.00%> (-0.07%) ⬇️
keras-torch 63.44% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mohamed-Ashraf273 Mohamed-Ashraf273 force-pushed the support_slice_update branch 6 times, most recently from 004626b to aef0743 Compare June 7, 2025 01:38
@gbaned gbaned added this to PR Queue Jun 11, 2025
@github-project-automation github-project-automation bot moved this to Assigned Reviewer in PR Queue Jun 11, 2025
@gbaned gbaned requested a review from mattdangerw June 11, 2025 02:26
@rkazants
Copy link
Contributor

let us wait until slice_update tests are switched on

@Mohamed-Ashraf273
Copy link
Contributor Author

@rkazants
I've switched on tests for slice_update.

@@ -810,9 +810,83 @@ def prepare_slice_index(val):


def slice_update(inputs, start_indices, updates):
Copy link
Contributor

Choose a reason for hiding this comment

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

please add comments for each block

@Mohamed-Ashraf273 Mohamed-Ashraf273 force-pushed the support_slice_update branch 2 times, most recently from 799ecfa to 7ef40d5 Compare June 24, 2025 12:58
@Mohamed-Ashraf273
Copy link
Contributor Author

Mohamed-Ashraf273 commented Jun 24, 2025

@rkazants
I can't change it to opest15 because I'm facing a lot of segfaults when compiling models. I tried the version 2024.5.0 as mentioned here: https://docs.openvino.ai/2025/documentation/openvino-ir-format/operation-sets/available-opsets.html, but it didn't work either.
So I added comments.

@Mohamed-Ashraf273 Mohamed-Ashraf273 force-pushed the support_slice_update branch 2 times, most recently from 307110e to a4188f1 Compare June 24, 2025 19:29
@Mohamed-Ashraf273 Mohamed-Ashraf273 force-pushed the support_slice_update branch 2 times, most recently from 9a2a8d8 to b7c27dd Compare July 4, 2025 20:34
@divyashreepathihalli
Copy link
Collaborator

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the slice_update operation for the OpenVINO backend. The implementation generates indices for all elements in the updates tensor and uses scatter_nd_update to perform the update. The changes also enable the corresponding tests for this operation. The implementation assumes a static rank for the input tensors, and the index generation function could be refactored for better readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Assigned Reviewer
Development

Successfully merging this pull request may close these issues.

5 participants