From b1fe8d45709e0d7d0dcde4e969b5fc4e833320c6 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Mon, 4 Feb 2019 09:48:00 +0800 Subject: [PATCH] add a check for async_ssa_graph_exe test=develop --- .../framework/details/async_ssa_graph_executor.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paddle/fluid/framework/details/async_ssa_graph_executor.cc b/paddle/fluid/framework/details/async_ssa_graph_executor.cc index e21d5fb96d..79b390dde4 100644 --- a/paddle/fluid/framework/details/async_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/async_ssa_graph_executor.cc @@ -30,6 +30,19 @@ AsyncSSAGraphExecutor::AsyncSSAGraphExecutor( VLOG(3) << "build AsyncSSAGraphExecutor"; PADDLE_ENFORCE_EQ(places_.size(), local_scopes_.size()); + if (strategy_.num_iteration_per_run_ > 1) { + int read_op_num = 0; + for (auto *node : graphs_[0]->Nodes()) { + if (node->IsOp() && node->Name() == "read") { + read_op_num++; + } + } + if (read_op_num == 0) { + LOG(WARNING) << "when num_iteration_per_run_ is larger then 1, the model " + "should use pyreader to feed data!"; + } + } + // set the correct size of thread pool to each device. strategy_.num_threads_ = strategy_.num_threads_ < places_.size() ? 1UL -- GitLab