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

clean up jax internals in preparation for only allowing hashable values passed as static args #3712

Merged
merged 3 commits into from
Oct 16, 2020

Conversation

mattjj
Copy link
Collaborator

@mattjj mattjj commented Jul 10, 2020

By allowing un-hashable values (wrapping them in a proxy that hashed by identity) we caused too many performance surprises.

This PR doesn't quite impose the requirement that values passed as static arguments to jit be hashable. Instead, this is just preparation: it makes all the fixes in JAX code such that that requirement is satisfied. We still need to fix up some dependents before making the switch.

Related to #3701, #2813, #3708. Once we make the switch, it'll close those first two issues.

See the thread on #4572 for a discussion of how to handle array values as static arguments, even though they're not hashable.

@mattjj mattjj force-pushed the hashable-static-args-only branch from 8c8869c to 0f27abe Compare July 11, 2020 04:43
@mattjj mattjj requested a review from hawkinsp July 11, 2020 05:56
jax/image/scale.py Outdated Show resolved Hide resolved
jax/numpy/lax_numpy.py Show resolved Hide resolved
tests/polynomial_test.py Outdated Show resolved Hide resolved
@mattjj mattjj changed the title allow only hashable values passed as static args clean up jax internals in preparation for only allowing hashable values passed as static args Oct 16, 2020
@mattjj mattjj force-pushed the hashable-static-args-only branch from 984f208 to e51163a Compare October 16, 2020 20:12
@mattjj mattjj added the pull ready Ready for copybara import and testing label Oct 16, 2020
@copybara-service copybara-service bot merged commit 6038b6d into master Oct 16, 2020
@mattjj mattjj deleted the hashable-static-args-only branch October 16, 2020 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants