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

Compilations performed to instantiate lazy constants aren't cached #1909

Closed
jekbradbury opened this issue Dec 21, 2019 · 1 comment · Fixed by #1668
Closed

Compilations performed to instantiate lazy constants aren't cached #1909

jekbradbury opened this issue Dec 21, 2019 · 1 comment · Fixed by #1668
Assignees
Labels
enhancement New feature or request

Comments

@jekbradbury
Copy link
Contributor

jekbradbury commented Dec 21, 2019

This compilation isn't cached anywhere, so code like the following:

big_lazy_x = jnp.ones((jax.device_count(), 1e6))
for _ in range(100):
  _ = pmap(lambda x: x)(big_lazy_x)

will result in one compilation per device per step of the function that instantiates big_lazy_x.
This should be fixed by the new lazy infra (#1668).

@mattjj
Copy link
Collaborator

mattjj commented Dec 31, 2019

By the way, that link into the code may have bitrotted, in that I don't think it's pointing to the right place anymore. (What I do to make a link is select a line and then press 'y' in GitHub's web interface to get a pointer to a specific commit. Those don't rot!)

I'm pretty sure it used to point to _instantiate_device_constant, which indeed isn't cached. And indeed #1668 fixes this! I'll add a test to that PR...

@mattjj mattjj self-assigned this Dec 31, 2019
@mattjj mattjj mentioned this issue Dec 31, 2019
11 tasks
@mattjj mattjj added the enhancement New feature or request label Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants