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

[Inference] Memory modification for ShrinkMemory. #28355

Merged
merged 3 commits into from
Nov 4, 2020

Conversation

jiweibo
Copy link
Contributor

@jiweibo jiweibo commented Nov 2, 2020

PR types

Others

PR changes

Others

Describe

为支持ShrinkMemory操作,对Allocator的修改。

  • Allocator增加release接口,使得能通过接口显示的释放内/显存池
  • 可以认为显存池结构是 list,其中chunk代表了一块显存区域;释放显存池的方法是:清空tmp tensor,其所占空间归还显存池,遍历chunk,如果chunk是刚开始初始化分配的状态,则可释放。

ShrinkMemory接口见pr #28409

@paddle-bot-old
Copy link

paddle-bot-old bot commented Nov 2, 2020

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

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

LGTM

@jiweibo jiweibo merged commit 0511469 into PaddlePaddle:develop Nov 4, 2020
@jiweibo jiweibo deleted the memory_for_alloc branch November 4, 2020 06:29
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.

3 participants