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

Fix memory leak in radam optimizer #974

Merged
merged 2 commits into from
May 30, 2024

Conversation

lukekulik
Copy link
Contributor

@lukekulik lukekulik commented May 25, 2024

Reference: #969

Replace jax.lax.cond with jnp.where in the radam optimizer update function. This increases computational time, but fixes the memory leak. This solution was originally proposed by vroulet@.

Replace jax.lax.cond with jnp.where. This increases computational time, but fixes the memory leak. This solution was originally proposed by vroulet@.
Copy link

google-cla bot commented May 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@vroulet vroulet left a comment

Choose a reason for hiding this comment

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

Looks great, thank you very much @lukekulik.
Just to make sure: did you try and did it solve the memory leak issue?

@lukekulik
Copy link
Contributor Author

Yes, it looks like it fixed it. The number of live buffers in the the repro example from #969 doesn't continue to grow anymore.

@vroulet
Copy link
Collaborator

vroulet commented May 27, 2024

Perfect thank you again!

@copybara-service copybara-service bot merged commit a30cab4 into google-deepmind:main May 30, 2024
7 checks passed
@lukekulik lukekulik deleted the radam-mem-leak branch May 30, 2024 16:59
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