Skip to content

Commit c144634

Browse files
authored
Merge pull request #12577 from jacquesqiao/optimize-vlog-before-and-after-op-run
optimize vlog before and after op run, move into op.run
2 parents b2435a3 + b4d4853 commit c144634

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

paddle/fluid/framework/executor.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,7 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope,
330330
}
331331

332332
for (auto& op : ctx->ops_) {
333-
VLOG(4) << place_ << " " << op->DebugStringEx(local_scope);
334333
op->Run(*local_scope, place_);
335-
// NOTE! Please do not delete this line, it's usefull because the debug
336-
// string before and after op.run are different, after run the output
337-
// will have right shape which is usefull for debug.
338-
VLOG(3) << place_ << " " << op->DebugStringEx(local_scope);
339334

340335
if (FLAGS_benchmark) {
341336
VLOG(2) << "Memory used after operator " + op->Type() + " running: "

paddle/fluid/framework/operator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static LoD GetLoD(const Scope& scope, const std::string& name) {
127127
}
128128

129129
void OperatorBase::Run(const Scope& scope, const platform::Place& place) {
130-
VLOG(10) << "- " << DebugStringEx(&scope);
130+
VLOG(4) << place << " " << DebugStringEx(&scope);
131131
if (platform::is_gpu_place(place)) {
132132
#ifndef PADDLE_WITH_CUDA
133133
PADDLE_THROW("Cannot run operator on place %s", place);
@@ -139,7 +139,7 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) {
139139
platform::DeviceContextPool& pool = platform::DeviceContextPool::Instance();
140140
platform::RecordEvent record_event(Type(), pool.Get(place));
141141
RunImpl(scope, place);
142-
VLOG(10) << "+ " << DebugStringEx(&scope);
142+
VLOG(3) << place << " " << DebugStringEx(&scope);
143143
}
144144

145145
bool OperatorBase::HasInputs(const std::string& name) const {

0 commit comments

Comments
 (0)