-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add new APIs for GPU memory monitoring (max_memory_allocated, max_memory_reserved, memory_allocated, memory_reserved) #38657
Merged
From00
merged 16 commits into
PaddlePaddle:develop
from
From00:add-new-api-memory_reserved
Mar 30, 2022
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4d506ea
Add new API memory_reserved
From00 2f8e782
Add memory_allocated, max_memory_reserved and max_memory_allocater
From00 3704d55
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
From00 2525fce
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
From00 b3d048f
Fix CI error
From00 22ae0af
Fix CI error
From00 fb04a61
Enhance UT
From00 1e539ef
Add FLAGS_memory_stats_opt
From00 ac21435
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
From00 b0ae93a
Add STATS macro functions
From00 bc75cfe
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
From00 a633df6
Add StatAllocator
From00 827da88
Fix CI errors
From00 5986842
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
From00 678acca
Add UT
From00 2363830
Fix CI errors
From00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问这里能做到通过 AllocatorFacade 分配内存等价于拿到具体的 Allocator 然后返回
Allocator->Allocate(size)
吗?后续 Tensor 计划不走 AllocatorFacade,而是直接传入具体的 AllocatorThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已另作讨论,这里采集显存数据的相关逻辑无法实现到具体的Allocator里,与pten直接获取Allocator对象后分配内存的设想不等价,之后pten的Alloc接口在获取Allocator分配内存后,也需要添加类似的数据采集逻辑。此处存在一些和Allocator以及Pten最初设计不太切合的修改,短期先同步后进行合入,不阻塞相关功能的开发,后续pten项目相关负责人员腾出时间后,再对类似的问题进行集中讨论和优化整改。 @phlrain @chenwhql @zhiqiu @jim19930609
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按先期形成的共识,Allocator 分配逻辑的统一出口为 https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/memory/allocation/allocator.h#L142 。目前因为进度原因先行同意此合入,相关问题 @From00 后续处理。