From 0f8bd73cc9d23ba1bf2fc9b15bae74450daee0d5 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Mon, 18 Feb 2019 14:51:47 +0800 Subject: [PATCH] cleanup code test=develop --- paddle/fluid/framework/details/build_strategy.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/build_strategy.cc b/paddle/fluid/framework/details/build_strategy.cc index 7d2a081e3b..45c2c73415 100644 --- a/paddle/fluid/framework/details/build_strategy.cc +++ b/paddle/fluid/framework/details/build_strategy.cc @@ -34,6 +34,8 @@ namespace details { static inline bool SeqOnlyAllReduceOps(const BuildStrategy &strategy) { // Should fix the allreduce op order if scheduling // them in multiple threads or processes to avoid hang. + // NOTE: ParallelExecutor would execute this pass on each graph, so + // don't need to append it here. return (!strategy.enable_sequential_execution_ && strategy.num_trainers_ > 1) && !strategy.enable_parallel_graph_; @@ -118,7 +120,7 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder { } // Verify that the graph is correct for multi-device executor. - auto multi_devices_pass = AppendPass("multi_devices_check_pass"); + AppendPass("multi_devices_check_pass"); if (SeqOnlyAllReduceOps(strategy)) { AppendPass("all_reduce_deps_pass"); -- GitLab