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

Call gc with different configs #853

Merged
merged 6 commits into from
Jun 14, 2022
Merged

Call gc with different configs #853

merged 6 commits into from
Jun 14, 2022

Conversation

dfalbel
Copy link
Member

@dfalbel dfalbel commented Jun 13, 2022

Call full gc when out of memory so we can achieve better memory usage.

I couldn't find a way to synchronously call GC while in a backward call (see https://discuss.pytorch.org/t/deadlock-when-freeing-memory/154102 ). So the way we are solving this is by always calling GC before backward and by calling GC asynchronously when more memory is requested, in the hope that memory is release before the OOM error.

@dfalbel dfalbel added the lantern Use this label if your PR affects lantern so it's built in the CI label Jun 13, 2022
@dfalbel dfalbel merged commit 63679eb into main Jun 14, 2022
@dfalbel dfalbel deleted the full-gc branch June 14, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lantern Use this label if your PR affects lantern so it's built in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant