Skip to content
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

[OpenVINO backend] Support numpy.log10 #21042

Merged
merged 3 commits into from
Mar 24, 2025

Conversation

darshil929
Copy link
Contributor

@darshil929 darshil929 commented Mar 15, 2025

I have added support for numpy.log10 in OpenVINO backend by:

  1. Implementing log10(x) as log(x)/log(10) using available operations from OpenVINO
  2. Remove numpy.log10 from excluded_concrete_tests.txt file

About implementation:

  • I followed same pattern like other math functions in backend
  • Added handling for proper type conversion with integral types
  • Tests pass successfully on CPU environment

Related to: openvinotoolkit/openvino#29486

cc @rkazants could you please review?

Copy link

google-cla bot commented Mar 15, 2025

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-commenter
Copy link

codecov-commenter commented Mar 15, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.48%. Comparing base (6e688ab) to head (7a9b9a2).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
keras/src/backend/openvino/numpy.py 85.71% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21042   +/-   ##
=======================================
  Coverage   82.47%   82.48%           
=======================================
  Files         563      563           
  Lines       53834    53851   +17     
  Branches     8359     8361    +2     
=======================================
+ Hits        44401    44419   +18     
+ Misses       7392     7389    -3     
- Partials     2041     2043    +2     
Flag Coverage Δ
keras 82.30% <85.71%> (+<0.01%) ⬆️
keras-jax 63.77% <0.00%> (-0.03%) ⬇️
keras-numpy 58.73% <0.00%> (-0.03%) ⬇️
keras-openvino 32.75% <85.71%> (+0.03%) ⬆️
keras-tensorflow 64.09% <0.00%> (-0.02%) ⬇️
keras-torch 63.81% <0.00%> (-0.03%) ⬇️

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.

@darshil929 darshil929 force-pushed the openvino-log10-support branch from fe98688 to da7754c Compare March 16, 2025 17:29
@rkazants
Copy link
Contributor

@darshil929, please fix:

FAILED keras/src/ops/numpy_test.py::NumpyOneInputOpsCorrectnessTest::test_log - AssertionError: 
Not equal to tolerance rtol=1e-06, atol=1e-06
None
Mismatched elements: 4 / 6 (66.7%)
Max absolute difference among violations: 0.69314718
Max relative difference among violations: 1.
 ACTUAL: array([[0, 0, 1],
       [1, 0, 0]])
 DESIRED: array([[0.      , 0.693147, 1.098612],
       [1.098612, 0.693147, 0.      ]])
= 1 failed, 2475 passed, 4359 skipped, 76 xfailed, 4 xpassed, 1 warning in 95.29s (0:01:35) =

@darshil929
Copy link
Contributor Author

@rkazants

Sir, I've fixed the log function to properly handle type conversion for integral inputs, similar to the log10 implementation. The test_log is now passing successfully.

@rkazants
Copy link
Contributor

@darshil929
{136EC8D8-59EF-4247-8A38-07685FCD9C3E}

@darshil929
Copy link
Contributor Author

image

@rkazants
I notice that the CLA check is failing because of the co-authored commit created when I accepted your suggestion directly from the UI. Would you like me to recreate this change manually and force push to resolve the CLA issue?

@rkazants
Copy link
Contributor

@darshil929, please force push to avoid my changes.

@darshil929 darshil929 force-pushed the openvino-log10-support branch from be9a941 to 7a9b9a2 Compare March 17, 2025 14:10
@darshil929
Copy link
Contributor Author

@rkazants

Sir, i have made the changes, all the checks are successful now!

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.

@rkazants
Copy link
Contributor

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

@fchollet, friendly reminder to take a look. Recommend to merge:)

@rkazants
Copy link
Contributor

Hi @fchollet,

Could you please merge it, if it looks fine to you? I recommend to merge.

Best regards,
Roman

@fchollet fchollet merged commit a69952e into keras-team:master Mar 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants