-
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
Memory optimization for fit a line demo #7321
Conversation
# print(block_size) | ||
|
||
# TODO(qijun) handle Program with if/while operators | ||
self.global_block = program_desc.block(0) |
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.
We can just handle memory optimization for each block and do not optimize the memory between block. It may be enough.
@@ -116,6 +115,7 @@ void Executor::Run(const ProgramDesc& pdesc, Scope* scope, int block_id, | |||
for (auto& op_desc : block.AllOps()) { | |||
auto op = paddle::framework::OpRegistry::CreateOp(*op_desc); | |||
VLOG(3) << op->DebugStringEx(local_scope); | |||
VLOG(3) << "Memory used " << memory::memory_usage(place_); |
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.
Do we need a little more details in this log message, e.g., “before ....” or “after ...”?
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.
This PR mainly provides a demo to show the result and these logs are actually for debugging. And another clean PR focus on memory optimization transpiler #7356 has been merged.
So I will close this PR.
This PR includes:
The cache memory pool can be hit:
Memory can be saved from 102400 bytes to 90112 bytes.
Memory use before optimization in a batch
Memory use after optimization in a batch