8000 Add Accelerator.free_memory by sgugger · Pull Request #89 · huggingface/accelerate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Accelerator.free_memory #89

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

Merged
merged 1 commit into from
May 17, 2021
Merged

Add Accelerator.free_memory #89

merged 1 commit into from
May 17, 2021

Conversation

sgugger
Copy link
Collaborator
@sgugger sgugger commented May 17, 2021

This PR adds a free_memory to the Accelerator class, to free memory between two different trainings. This cleans up the internal list to the optimizers, but we will also add other objects stored in the future (for instance #82 adds a reference to the model for deespeed).

Fixes #84

@sgugger sgugger requested a review from LysandreJik May 17, 2021 13:50
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.

Cool that's clean!

@sgugger sgugger merged commit ee04aec into main May 17, 2021
@sgugger sgugger deleted the accelerator_clean branch May 17, 2021 13:55
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.

Add warning not to reuse Accelerator
2 participants
0