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

⚠️ Nightly upstream-dev CI failed ⚠️ #22251

Closed
github-actions bot opened this issue Jul 3, 2024 · 1 comment · Fixed by #22257
Closed

⚠️ Nightly upstream-dev CI failed ⚠️ #22251

github-actions bot opened this issue Jul 3, 2024 · 1 comment · Fixed by #22257
Assignees
Labels

Comments

@github-actions
Copy link

github-actions bot commented Jul 3, 2024

Workflow Run URL

Summary of Failures
tests/lax_numpy_reducers_test.py::JaxNumpyReducerTests::testCumulativeSum0: AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0

Mismatched elements: 2 / 3 (66.7%)
Max absolute difference among violations: 1
Max relative difference among violations: 1.
 ACTUAL: array([[1],
       [0],
       [0]], dtype=uint8)
 DESIRED: array([[1],
       [1],
       [1]], dtype=uint8)
tests/lax_numpy_test.py::NumpySignaturesTest::testWrappedSignaturesMatch: AssertionError: {'clip': {'np_params': ['a', 'a_min', 'a_max', 'min', 'max'], 'jnp_params': ['a', 'a_min', 'a_max']}, 'cumulative_sum': {'np_params': ['x', 'axis', 'dtype', 'out', 'include_initial'], 'jnp_params': ['x', 'axis', 'dtype', 'include_initial']}} != {}
Missing entries:
'clip': {'np_params': ['a', 'a_min', 'a_max', 'min', 'max'], 'jnp_params': ['a', 'a_min', 'a_max']}
'cumulative_sum': {'np_params': ['x', 'axis', 'dtype', 'out', 'include_initial'], 'jnp_params': ['x', 'axis', 'dtype', 'include_initial']}
@github-actions github-actions bot added the CI label Jul 3, 2024
@dfm dfm self-assigned this Jul 3, 2024
@dfm
Copy link
Collaborator

dfm commented Jul 3, 2024

I can reproduce the issues locally with the nightly numpy - I will investigate!

dfm added a commit to dfm/jax that referenced this issue Jul 3, 2024
Numpy recently merged support for the 2023.12 revision of the Array API:
numpy/numpy#26724

This breaks two of our tests and I've chosen to skip those tests for
now:

1. The first breakage was caused by differences in how numpy and JAX
   cast negative floats to `uint8`. Specifically
   `np.float32(-1).astype(np.uint8)` returns `np.uint8(255)` whereas
   `jnp.float32(-1).astype(jnp.uint8)` produces `Array(0, dtype=uint8)`.
   We don't make any promises about consistency with casting floats to
   ints, noting that this can even be backend dependent. I don't believe
   this failure is identifying any unexpected behavior, and we test many
   other dtypes properly so I'm not concerned about skipping this test.

2. The second failure was caused by the fact that the approach we took
   in jax-ml#20550 to support backwards compatibility and the Array API for
   `clip` differs from the one used in numpy/numpy#26724. Again, the
   behavior is consistent, but it produces a different signature. I've
   skipped checking `clip`'s signature, but we should revisit it once
   the `a_min` and `a_max` parameters have been removed from JAX.

Fixes jax-ml#22251
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 a pull request may close this issue.

1 participant