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

bump flax version #14343

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Conversation

patil-suraj
Copy link
Contributor

What does this PR do?

jax v0.2.21 introduced a slight breaking change, jnp.ndarray now only returns True for jax arrays and not numpy arrays. so for standard numpy array x, isinstance(x, jnp.ndarray) will
now return False . (cf here, the last point under breaking changes)

And the jax.random.split method returns numpy array instead of jax. We use this method during random init of the model to create the rngs dict.

Flax has a check for valid rngs where it expects jnp.ndarray , but since split returns np array and jax now does not treat np arrays as jnp.ndarray the check returns False and raises an error.

This has been fixed in flax==0.3.5 (cf here). So all of our models fail with jax>=0.2.21 and flax<0.3.5.

To fix this, this PR bumps the flax version to 0.3.5.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

LGTM

@patil-suraj patil-suraj merged commit 85a4bda into huggingface:master Nov 9, 2021
@patil-suraj patil-suraj deleted the bump-flax-version branch November 9, 2021 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants