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

Fix for a change in JAX's promotion rules for floor and ceil. #19946

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

hertschuh
Copy link
Contributor

JAX has an unreleased change jax-ml/jax#21441 that make it so that ints and bools are no longer promoted to floats by floor and ceil.

Our current implementation follows the Numpy promotion rule, i.e. ints and bools are promoted to floats. Therefore:

  • updated unit tests, which use jax.numpy as the reference.
  • updated our JAX implementation of floor and ceil (note that ceil would already cast).

JAX has an unreleased change jax-ml/jax#21441 that make it so that `int`s and `bool`s are no longer promoted to floats by `floor` and `ceil`.

Our current implementation follows the Numpy promotion rule, i.e. `int`s and `bool`s are promoted to floats. Therefore:
- updated unit tests, which use `jax.numpy` as the reference.
- updated our JAX implementation of `floor` and `ceil` (note that `ceil` would already cast).
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.07%. Comparing base (38ef5f2) to head (36c23c8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19946   +/-   ##
=======================================
  Coverage   79.06%   79.07%           
=======================================
  Files         499      499           
  Lines       46727    46730    +3     
  Branches     8618     8618           
=======================================
+ Hits        36947    36950    +3     
  Misses       8045     8045           
  Partials     1735     1735           
Flag Coverage Δ
keras 78.93% <100.00%> (+<0.01%) ⬆️
keras-jax 62.26% <100.00%> (+<0.01%) ⬆️
keras-numpy 57.29% <0.00%> (-0.01%) ⬇️
keras-tensorflow 63.55% <0.00%> (-0.01%) ⬇️
keras-torch 62.32% <0.00%> (-0.01%) ⬇️

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.

Copy link
Member

@SamanehSaadat SamanehSaadat left a comment

Choose a reason for hiding this comment

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

Thanks, Fabien!

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Jul 1, 2024
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix!

@fchollet fchollet merged commit f81009b into keras-team:master Jul 1, 2024
10 checks passed
@google-ml-butler google-ml-butler bot removed awaiting review ready to pull Ready to be merged into the codebase kokoro:force-run labels Jul 1, 2024
@hertschuh hertschuh deleted the floor_ceil_jax branch July 1, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Assigned Reviewer
Development

Successfully merging this pull request may close these issues.

6 participants