Skip to content

[OpenVINO] Fix compiled-model cache invalidation and expand test whitelist - #3029

Open
goyaladitya05 wants to merge 9 commits into
keras-team:masterfrom
goyaladitya05:openvino-unblocked-by-keras
Open

goyaladitya05 wants to merge 9 commits into
keras-team:masterfrom
goyaladitya05:openvino-unblocked-by-keras

Conversation

@goyaladitya05

@goyaladitya05 goyaladitya05 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description of the change

ov_infer reused a compiled model whenever the device matched, so a second generate() with different input shapes ran against a graph traced for the first one. compile_model also relaxed every input dimension to -1 after tracing, advertising shapes the graph was never built for. The cache is now keyed on the input signature and static args, and the relaxation is gone so the compiled model matches what was traced.

The BLIP2 early-stopping mocks read token_ids.shape[0] as a Python int, which is None under a dynamic batch. They now use the ops.ones_like + ops.slice_update idiom the other causal-LM tests already use.

Depends on keras-team/keras#23564, which is now in keras-nightly.

Closes: #3045

  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and works with all backends (TensorFlow, JAX, and PyTorch).
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have followed the Keras Hub Model contribution guidelines in making these changes.
  • I have followed the Keras Hub API design guidelines in making these changes.
  • I have signed the Contributor License Agreement.

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

Copy link
Copy Markdown
Contributor

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 updates conftest.py to include several new vision model paths, specifically deit, dinov2, dinov3, video_prism, and vit. There are no review comments provided, and I have no feedback on these changes.

@goyaladitya05 goyaladitya05 changed the title [OpenVINO] Expand test whitelist further [WIP][OpenVINO] Expand test whitelist further Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

✅ Approved issue check passed: #3045 is assigned to @goyaladitya05.
This PR is Ready for review.

@goyaladitya05
goyaladitya05 marked this pull request as ready for review September 9, 2026 10:16
@github-actions
github-actions Bot marked this pull request as draft September 9, 2026 10:16
@goyaladitya05 goyaladitya05 changed the title [WIP][OpenVINO] Expand test whitelist further Fix OpenVINO compiled-model cache invalidation and expand test whitelist Sep 9, 2026
@goyaladitya05 goyaladitya05 changed the title Fix OpenVINO compiled-model cache invalidation and expand test whitelist [OpenVINO] Fix compiled-model cache invalidation and expand test whitelist Sep 9, 2026
@goyaladitya05
goyaladitya05 marked this pull request as ready for review September 9, 2026 13:33
@github-actions
github-actions Bot marked this pull request as draft September 9, 2026 13:33
@goyaladitya05

Copy link
Copy Markdown
Contributor Author

@hertschuh Could you please take a look? thanks!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix compiled-model cache invalidation and expand test whitelist

1 participant