-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Support numpy.prod operation #21188
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?
Support numpy.prod operation #21188
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21188 +/- ##
==========================================
- Coverage 82.59% 74.19% -8.40%
==========================================
Files 564 564
Lines 54407 54426 +19
Branches 8449 8453 +4
==========================================
- Hits 44936 40383 -4553
- Misses 7396 11971 +4575
+ Partials 2075 2072 -3
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:
|
pytest.ini
Outdated
@@ -0,0 +1,3 @@ | |||
[pytest] |
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.
please remove this file. It is only for developer purpose
requirements.txt
Outdated
jax[cpu]==0.5.0 | ||
|
||
#removed jax as is not nedded in our case | ||
#jax[cpu]==0.5.0 |
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.
revert this change
Please fix CI failures as well |
I tried running the pytest locally but didn't get any error could guide how to run these test |
Try this & then run pytests |
thank you |
cc, @rkazants please review |
there are 2 more CI issues, first you need to sign the CLA aggrement https://cla.developers.google.com/ |
Apologies for not following the contribution guidelines initially. cc @rkazants — kindly review when you get a chance. Thank you! |
keras/src/backend/openvino/numpy.py
Outdated
# Promote dtype if not explicitly specified | ||
if dtype is None: | ||
if x_type == Type.boolean: | ||
promoted_dtype = Type.i32 | ||
elif x_type in (Type.i8, Type.i16): | ||
promoted_dtype = Type.i32 | ||
elif x_type in (Type.u8, Type.u16): | ||
promoted_dtype = Type.u32 | ||
else: | ||
promoted_dtype = x_type | ||
else: | ||
promoted_dtype = string_to_ov_type(dtype) |
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.
we don't need any type promotion here. Please remove
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.
I removed the dtype promotion as you suggested (like uint8 → uint32, etc.), but now a few CI tests are failing because they still expect the promoted dtype (e.g., jnp.prod(uint8) → uint32, but OpenVINO now stays uint8).Could you please let me know that should i remove it or not or waht other ways should i try it
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.
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.
requirements.txt
Outdated
@@ -13,6 +13,7 @@ torch-xla==2.6.0;sys_platform != 'darwin' | |||
# Jax. | |||
# Pinned to 0.5.0 on CPU. JAX 0.5.1 requires Tensorflow 2.19 for saved_model_test. | |||
# Note that we test against the latest JAX on GPU. | |||
|
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.
revert this change
Details
fixes openvinotoolkit/openvino#30212
reduce_prod
using OpenVINO opsetdtype
,axis
, andkeepdims
parameterscc, @rkazants please review 🙏