Skip to content

[Inference] Memory modification for ShrinkMemory.#28355

Merged
jiweibo merged 3 commits intoPaddlePaddle:developfrom
jiweibo:memory_for_alloc
Nov 4, 2020
Merged

[Inference] Memory modification for ShrinkMemory.#28355
jiweibo merged 3 commits intoPaddlePaddle:developfrom
jiweibo:memory_for_alloc

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