Skip to content

[OpenVINO backend] Remove usage of deprecated openvino.runtime #21418

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 9 commits into
base: master
Choose a base branch
from

Conversation

p-wysocki
Copy link
Contributor

openvino.runtime is deprecated in favor of flat openvino and is set to be removed in the upcoming OpenVINO release.

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.19%. Comparing base (e233825) to head (41b7d5f).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (e233825) and HEAD (41b7d5f). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (e233825) HEAD (41b7d5f)
keras 5 4
keras-torch 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21418      +/-   ##
==========================================
- Coverage   82.76%   77.19%   -5.58%     
==========================================
  Files         565      565              
  Lines       55378    55505     +127     
  Branches     8646     8662      +16     
==========================================
- Hits        45833    42846    -2987     
- Misses       7442    10599    +3157     
+ Partials     2103     2060      -43     
Flag Coverage Δ
keras 77.10% <100.00%> (-5.47%) ⬇️
keras-jax 63.39% <0.00%> (+0.05%) ⬆️
keras-numpy 58.60% <0.00%> (+0.06%) ⬆️
keras-openvino 33.71% <100.00%> (-0.06%) ⬇️
keras-tensorflow 63.84% <0.00%> (+0.07%) ⬆️
keras-torch ?

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.

@gbaned gbaned requested a review from mattdangerw June 25, 2025 16:14
@gbaned gbaned added this to PR Queue Jun 25, 2025
@github-project-automation github-project-automation bot moved this to Assigned Reviewer in PR Queue Jun 25, 2025
Copy link
Contributor

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

do NOT merge, openvino test is failing

@p-wysocki
Copy link
Contributor Author

@fchollet @mattdangerw The CI is failing with pre-commit check api-gen, but there's no explicit error message. I ran the generation script as instructed in https://github.com/keras-team/keras?tab=readme-ov-file#minimal-installation with .shell/api_gen.sh, but it updated ~130 files with changes which are irrelevant, for example:

diff --git a/keras/api/optimizers/__init__.py b/keras/api/optimizers/__init__.py
index 40f6ab401..4114fab5b 100644
--- a/keras/api/optimizers/__init__.py
+++ b/keras/api/optimizers/__init__.py
@@ -4,6 +4,7 @@ This file was autogenerated. Do not edit it by hand,
 since your modifications would be overwritten.
 """

+
 from keras.optimizers import legacy as legacy
 from keras.optimizers import schedules as schedules
 from keras.src.optimizers import deserialize as deserialize
@@ -18,9 +19,7 @@ from keras.src.optimizers.adamw import AdamW as AdamW
 from keras.src.optimizers.ftrl import Ftrl as Ftrl
 from keras.src.optimizers.lamb import Lamb as Lamb
 from keras.src.optimizers.lion import Lion as Lion
-from keras.src.optimizers.loss_scale_optimizer import (
-    LossScaleOptimizer as LossScaleOptimizer,
-)
+from keras.src.optimizers.loss_scale_optimizer import LossScaleOptimizer as LossScaleOptimizer
 from keras.src.optimizers.muon import Muon as Muon

Is this expected? @rkazants suggested that it may be caused by wrong ordering of imports in my PR, but I changed it in numerous different ways and the check still fails.

@rkazants
Copy link
Contributor

@Mohamed-Ashraf273, could you please advice how to fix code-formatting issue in this PR? Thanks

from openvino.runtime import Type
import openvino.opset14 as ov_opset

from openvino import Model, Tensor, compile_model, Type
Copy link
Contributor

Choose a reason for hiding this comment

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

@p-wysocki
To pass the formatter test, please update this import statement to the following:

from openvino import Model
from openvino import Tensor
from openvino import Type
from openvino import compile_model

you can also install pre-commit by running:

pip install pre-commit

Then, run the following command locally to automatically fix formatting issues:

pre-commit run --all-files --hook-stage manual

@p-wysocki
Copy link
Contributor Author

Thank you @Mohamed-Ashraf273!

@p-wysocki p-wysocki requested a review from rkazants July 14, 2025 07:44
Copy link
Contributor

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

@fchollet, looks good to me. Recommend to merge.

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