Skip to content

[OpenVINO] Partial upgrade to opset16 for select operations#22600

Draft
goyaladitya05 wants to merge 6 commits intokeras-team:masterfrom
goyaladitya05:openvino/opset16
Draft

[OpenVINO] Partial upgrade to opset16 for select operations#22600
goyaladitya05 wants to merge 6 commits intokeras-team:masterfrom
goyaladitya05:openvino/opset16

Conversation

@goyaladitya05
Copy link
Copy Markdown
Contributor

@goyaladitya05 goyaladitya05 commented Apr 1, 2026

As discussed previously in #22446, introducing a partial upgrade to OpenVINO's opset16, for the ops istft and segment_max. (these are newly added in this opset)

We are not going for a complete upgrade, because there is a bug in opset16 due to some missing ops. It has been fixed upstream, and will be corrected in 2026.1 or 2026.2.

Also refactored the helper fn _segment_reduction_fn into segment_sum, since it is the only caller now.

@goyaladitya05 goyaladitya05 changed the title [OpenVINO] Partial upgrade to opset16 for selection operations [OpenVINO] Partial upgrade to opset16 for select operations Apr 1, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 5.47945% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.62%. Comparing base (28a83c5) to head (c4cd8ed).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
keras/src/backend/openvino/math.py 5.47% 69 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (28a83c5) and HEAD (c4cd8ed). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (28a83c5) HEAD (c4cd8ed)
keras-openvino 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22600      +/-   ##
==========================================
- Coverage   83.28%   75.62%   -7.67%     
==========================================
  Files         596      596              
  Lines       68089    68071      -18     
  Branches    10607    10603       -4     
==========================================
- Hits        56711    51480    -5231     
- Misses       8634    14104    +5470     
+ Partials     2744     2487     -257     
Flag Coverage Δ
keras 75.44% <5.47%> (-7.66%) ⬇️
keras-jax 59.68% <5.47%> (+0.01%) ⬆️
keras-numpy 55.36% <0.00%> (+0.01%) ⬆️
keras-openvino ?
keras-tensorflow 61.05% <5.47%> (+0.01%) ⬆️
keras-torch 59.86% <5.47%> (+0.01%) ⬆️

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.

Copy link
Copy Markdown
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 refactors the segment_max and istft functions in the Keras OpenVINO backend to leverage native OpenVINO opset16 operations. The new segment_max implementation needs to be adjusted to correctly handle negative segment_ids and infer num_segments to ensure parity with Keras semantics. Additionally, the istft implementation may require restoring batch dimension flattening logic to properly handle inputs with multiple batch dimensions, as its removal could lead to incorrect results.

@goyaladitya05 goyaladitya05 reopened this Apr 1, 2026
@goyaladitya05 goyaladitya05 marked this pull request as draft April 1, 2026 12:44
Copy link
Copy Markdown
Collaborator

@hertschuh hertschuh left a comment

Choose a reason for hiding this comment

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

It looks like something is not working right with ov_istft16 (tests are failing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants