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

Current JAX release incompatible with numpy 1.21 #7052

Closed
jakevdp opened this issue Jun 22, 2021 · 5 comments · Fixed by #7096
Closed

Current JAX release incompatible with numpy 1.21 #7052

jakevdp opened this issue Jun 22, 2021 · 5 comments · Fixed by #7096
Assignees
Labels
bug Something isn't working

Comments

@jakevdp
Copy link
Collaborator

jakevdp commented Jun 22, 2021

Numpy 1.21 was released a few hours ago, and appears incompatible with the current jaxlib release.

@jakevdp jakevdp added the bug Something isn't working label Jun 22, 2021
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jun 22, 2021
I'm unsure why this crashes instead of just producing a warning, but typedict is a deprecated name (https://numpy.org/devdocs/release/1.21.0-notes.html#np-typedict-has-been-formally-deprecated) and apparently has been for 14 years.

jax-ml/jax#7052 (although it seems likely the same issue applies to TF also)

PiperOrigin-RevId: 380868551
Change-Id: I56a94e567d1996d710b4b4c786292cc44927a039
@shoyer
Copy link
Collaborator

shoyer commented Jun 22, 2021

numpy/numpy#19305 is the source of one of the remaining errors.

@hawkinsp hawkinsp removed their assignment Jun 23, 2021
@hawkinsp
Copy link
Collaborator

I've done all I plan to do on this for now: remaining is to release a new jaxlib (in progress) and to do something to fix or work around the numpy bug.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Jun 23, 2021

Alright, I'll self-assign so I can close the issue after the next jaxlib release.

@jakevdp jakevdp self-assigned this Jun 23, 2021
@hawkinsp
Copy link
Collaborator

Note that we can't close it until we do something to work around the numpy problem. It could just be skipping those tests under NumPy 1.21 for now.

If you want to try running the tests before the new jaxlib lands, apply the following patch:

diff --git a/jax/__init__.py b/jax/__init__.py
index 17629466..caca87a4 100644
--- a/jax/__init__.py
+++ b/jax/__init__.py
@@ -12,6 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

+import numpy as np
+np.typeDict = np.sctypeDict
+
 # Set default logging level before any logging happens.
 import os as _os
 _os.environ.setdefault('TF_CPP_MIN_LOG_LEVEL', '1')

@jakevdp
Copy link
Collaborator Author

jakevdp commented Jun 23, 2021

Part of the action item here may be to add a CI job to detect these kinds of breakages before release. @shoyer pointed out the approach that xarray uses, which is a github action that runs tests against upstream dev versions and opens a github issue in case of failure: https://github.com/pydata/xarray/blob/main/.github/workflows/upstream-dev-ci.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants