From 02d3f2328c0640084ca1473a61c7f905eae8dff7 Mon Sep 17 00:00:00 2001 From: Yuang Liu Date: Wed, 26 Jan 2022 10:51:06 +0800 Subject: [PATCH] [fleet_executor] Dist model bug fixer (#39207) --- .../distributed/fleet_executor/dist_model.cc | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/distributed/fleet_executor/dist_model.cc b/paddle/fluid/distributed/fleet_executor/dist_model.cc index 4b84833023..452c666a15 100644 --- a/paddle/fluid/distributed/fleet_executor/dist_model.cc +++ b/paddle/fluid/distributed/fleet_executor/dist_model.cc @@ -487,21 +487,25 @@ bool DistModel::PrepareFeedAndFetch() { if (feeds_.size() == 0) { LOG(ERROR) << "Feed ops are needed for the first pp stage."; return false; + } + } else { + if (feeds_.size() > 0) { + LOG(WARNING) << "Feed op is found in the non-first stage of pp."; } else { - LOG(WARNING) << "No feed ops in non-first pp stage."; + LOG(INFO) << "No feed ops in non-first pp stage."; } - } else if (feeds_.size() > 0) { - LOG(WARNING) << "Feed op is found in the non-first stage of pp."; } if (IsPPLastStage(config_)) { if (fetches_.size() == 0) { - LOG(ERROR) << "Fetch op is needed for the last pp stage."; - return false; + LOG(WARNING) << "No fetch op was found in the last pp stage. Make sure " + "the result has been sent to frist pp stage."; + } + } else { + if (fetches_.size() > 0) { + LOG(WARNING) << "Fetch op is found in the non-last stage of pp."; } else { - LOG(WARNING) << "No fetch op in non-last pp stage."; + LOG(INFO) << "No fetch op in non-last pp stage."; } - } else if (fetches_.size() > 0) { - LOG(WARNING) << "Fetch op is found in the non-last stage of pp."; } } return true; -- GitLab