Add api paddle.device.cuda.empty_cache to release idle gpu memory hold by allocator。#35427
Merged
tizhou86 merged 7 commits intoPaddlePaddle:developfrom Sep 14, 2021
Merged
Add api paddle.device.cuda.empty_cache to release idle gpu memory hold by allocator。#35427tizhou86 merged 7 commits intoPaddlePaddle:developfrom
tizhou86 merged 7 commits intoPaddlePaddle:developfrom
Conversation
|
✅ This PR's description meets the template requirements! |
|
Thanks for your contribution! |
dingjiaweiww
reviewed
Sep 7, 2021
TCChenlong
previously approved these changes
Sep 13, 2021
jzhang533
reviewed
Sep 13, 2021
15c53a9
AnnaTrainingG
pushed a commit
to AnnaTrainingG/Paddle
that referenced
this pull request
Sep 29, 2021
…d by allocator。 (PaddlePaddle#35427) * Add empty_cache api to release idle gpu memory hold by allocator,test=develop * Add empty_cache api to release idle gpu memory hold by allocator,test=develop * Add empty_cache api to release idle gpu memory hold by allocator,test=develop * Fix test coverage problem for empty_cache * delete redundant check for empty_cache * fix the problem of empty_cache's doc * delete the nvidia-smi comment in doc of empty_cache, test=document_fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
APIs
Describe
Add API paddle.device.cuda.empty_cache to releases idle cached memory held by the allocator so that those can be used in other GPU application and visible in
nvidia-smi. In most cases you don't need to use this function, Paddle does not release the memory back to the OS when you remove Tensors on the GPU, Because it keeps gpu memory in a pool so that next allocations can be done much faster.exaples: