From d6fef01c76c834040f4eea925c39354271fda126 Mon Sep 17 00:00:00 2001 From: Ruibiao Chen Date: Mon, 26 Dec 2022 10:55:41 +0800 Subject: [PATCH] Add FLAGS for communication op dependency in standalone executor (#49291) --- .../new_executor/interpreter/dependency_builder.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc b/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc index 7c18f9288c..ec6ed90d08 100644 --- a/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc +++ b/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc @@ -17,6 +17,13 @@ #include #include "paddle/fluid/framework/new_executor/interpreter/interpreter_util.h" +PADDLE_DEFINE_EXPORTED_bool( + add_dependency_for_communication_op, + true, + "Whether to add dependency for communication Ops. It is just a temporary " + "FLAGS especially for auto parallel to avoid the concurrency damage by the " + "communication dependency added in standalone executor."); + // The difference between "sequential_run" and "serial_run": // "sequential_run" dispatches OPs one by one according to the sequence in the // Program, while "serial_run" ensures that all Ops are scheduled in a singal @@ -71,7 +78,11 @@ const std::map>& DependencyBuilder::Build( } AddDependencyForCoalesceTensorOp(); - AddDependencyForCommunicationOp(); + + if (FLAGS_add_dependency_for_communication_op) { + AddDependencyForCommunicationOp(); + } + AddDependencyForRandomOp(); AddDependencyForReadOp(); -- GitLab