-
Notifications
You must be signed in to change notification settings - Fork 19.6k
OpenVINO NN Module Functions #21803
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
base: master
Are you sure you want to change the base?
OpenVINO NN Module Functions #21803
Conversation
Summary of ChangesHello @danielenricocahall, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the functional capabilities of the Keras OpenVINO backend by introducing support for several key neural network operations. These additions, including new activation functions, pooling layers, and specialized loss functions, enhance the compatibility of Keras models with OpenVINO, allowing for a broader range of models to be deployed and optimized using the OpenVINO toolkit. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 introduces support for several new functions in the OpenVINO backend, including celu, max_pool, average_pool, one_hot, and ctc_loss. The implementations are mostly correct, but I've identified a few areas for improvement. Specifically, there are opportunities to enhance code readability in celu, fix a copy-paste error in max_pool, improve the implementation of one_hot for correctness and efficiency, and address a critical bug in ctc_loss related to incorrect input processing. My detailed feedback and suggestions are provided in the comments below.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21803 +/- ##
==========================================
- Coverage 82.63% 82.60% -0.03%
==========================================
Files 577 577
Lines 59415 59465 +50
Branches 9313 9317 +4
==========================================
+ Hits 49097 49124 +27
- Misses 7913 7941 +28
+ Partials 2405 2400 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this 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 adds support for several new neural network functions to the OpenVINO backend, including max_pool, average_pool, ctc_loss, one_hot, and celu. The implementations are generally correct and follow the patterns in the existing backend code. I've provided a few suggestions to improve the code. Specifically, I recommend simplifying the celu implementation by using the native OpenVINO operation, refactoring max_pool and average_pool to reduce code duplication, and adding a check in one_hot to handle cases where dtype is None for increased robustness.
|
/gemini review |
There was a problem hiding this 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 adds support for several new neural network functions to the OpenVINO backend, including pooling operations, celu, one_hot, and ctc_loss. The approach of using a shared _pool helper for both max_pool and average_pool is good for code reuse. However, I've identified a few critical issues that could lead to runtime errors in the _pool and one_hot implementations. I've also suggested a simplification for the celu function to use the native OpenVINO operator. Additionally, the PR description mentions support for log_sigmoid, but it is not implemented in the code; it would be great to add this for completeness.
|
/gemini review |
There was a problem hiding this 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 adds support for several neural network functions to the OpenVINO backend, including max_pool, average_pool, ctc_loss, one_hot, celu, and log_sigmoid. The implementations are generally well-structured, and the refactoring to use a shared _pool function for pooling operations is a good approach. However, I've identified a critical issue in the _pool function that will cause a runtime error for max_pool operations. Additionally, the celu function can be simplified by using a native OpenVINO operation. My review includes suggestions to address these points.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this 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 adds support for several neural network functions to the OpenVINO backend, including pooling operations, CTC loss, one-hot encoding, and various activation functions like CELU and log-sigmoid. The changes are generally good, with a nice refactoring for pooling operations.
I've identified two main issues:
- A critical bug in the pooling implementation where an incorrect keyword argument is used, which will lead to a runtime error.
- The
celuactivation function is implemented manually, while a more efficient native OpenVINO operation is available. Using the native op would improve performance and simplify the code.
Details and code suggestions are provided in the specific comments.
|
/gemini summary |
Summary of ChangesThis pull request significantly enhances the Keras OpenVINO backend by integrating several fundamental neural network operations. These additions, including new activation functions, pooling layers, and specialized loss functions, broaden the compatibility of Keras models with OpenVINO, allowing for a wider array of models to be deployed and optimized using the OpenVINO toolkit. The changes aim to reduce Highlights
Changelog
Activity
|
Support for:
Validated via running the
nn_testtests locally - although currentlykeras/src/ops/nn_test.pyis marked as an exclusion for CI. Should thenn_testtests be augmented to skip certain tests based on backend, similar tonumpy_test?Note:
dot_product_attentionandctc_decodeare also probably doable as the operations are available in OpenVINO, but figured that can be done separately.