Skip to content

Commit 8291b91

Browse files
committed
replace graph_builder_factory with ssa_graph_builder_factory
1 parent 9ac785b commit 8291b91

File tree

8 files changed

+9
-8
lines changed

8 files changed

+9
-8
lines changed

paddle/fluid/framework/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ cc_library(executor SRCS executor.cc DEPS op_registry device_context scope
8787
framework_proto glog lod_rank_table feed_fetch_method)
8888

8989

90-
cc_library(parallel_executor SRCS parallel_executor.cc DEPS graph_builder_factory threaded_ssa_graph_executor scope_buffered_ssa_graph_executor)
90+
cc_library(parallel_executor SRCS parallel_executor.cc DEPS ssa_graph_builder_factory threaded_ssa_graph_executor scope_buffered_ssa_graph_executor)
9191

9292
cc_library(prune SRCS prune.cc DEPS framework_proto)
9393
cc_test(prune_test SRCS prune_test.cc DEPS op_info prune recurrent_op device_context)

paddle/fluid/framework/details/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cc_library(multi_devices_graph_builder SRCS multi_devices_graph_builder.cc DEPS
3030
scale_loss_grad_op_handle rpc_op_handle ${multi_devices_graph_builder_deps} reduce_op_handle broadcast_op_handle)
3131

3232

33-
cc_library(graph_builder_factory SRCS graph_builder_factory.cc DEPS multi_devices_graph_builder ssa_graph_printer)
33+
cc_library(ssa_graph_builder_factory SRCS ssa_graph_builder_factory.cc DEPS multi_devices_graph_builder ssa_graph_printer)
3434

3535
cc_library(ssa_graph_executor SRCS ssa_graph_executor.cc DEPS ssa_graph framework_proto)
3636
cc_library(threaded_ssa_graph_executor SRCS threaded_ssa_graph_executor.cc DEPS fetch_op_handle ssa_graph_executor scope

paddle/fluid/framework/details/multi_devices_graph_builder.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ std::unique_ptr<SSAGraph> MultiDevSSAGraphBuilder::Build(
272272
* Only variables should be the leaves of graph.
273273
*/
274274
AddOutputToLeafOps(&result);
275+
275276
return std::unique_ptr<SSAGraph>(graph);
276277
}
277278

paddle/fluid/framework/details/ssa_graph_builder.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void SSAGraphBuilder::AddOutputToLeafOps(SSAGraph *graph) {
8585
}
8686

8787
std::unique_ptr<SSAGraph> SSAGraphBuilder::BuildAndCheck(
88-
const ProgramDesc &program) final {
88+
const ProgramDesc &program) {
8989
std::unique_ptr<SSAGraph> graph = Build(program);
9090
PADDLE_ENFORCE(IsValidGraph(graph.get()));
9191
return std::move(graph);
@@ -138,7 +138,7 @@ bool SSAGraphBuilder::IsValidGraph(const SSAGraph *graph) const {
138138
if (ready_vars.empty()) {
139139
return false;
140140
}
141-
for (auto ready_var : ready_vars.) {
141+
for (auto ready_var : ready_vars) {
142142
pending_vars.erase(ready_var);
143143
for (auto *op : ready_var->pending_ops_) {
144144
auto &deps = --pending_ops[op];

paddle/fluid/framework/details/ssa_graph_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SSAGraphBuilder {
3131
virtual ~SSAGraphBuilder() {}
3232
virtual std::unique_ptr<SSAGraph> Build(const ProgramDesc &program) const = 0;
3333

34-
std::unique_ptr<SSAGraph> BuildAndCheck(const ProgramDesc &program) final;
34+
std::unique_ptr<SSAGraph> BuildAndCheck(const ProgramDesc &program);
3535

3636
DISABLE_COPY_AND_ASSIGN(SSAGraphBuilder);
3737

paddle/fluid/framework/details/graph_builder_factory.cc renamed to paddle/fluid/framework/details/ssa_graph_builder_factory.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "paddle/fluid/framework/details/graph_builder_factory.h"
15+
#include "paddle/fluid/framework/details/ssa_graph_builder_factory.h"
1616
#include <fstream>
1717
#include "paddle/fluid/framework/details/multi_devices_graph_builder.h"
1818
#include "paddle/fluid/framework/details/ssa_graph_printer.h"

paddle/fluid/framework/parallel_executor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ limitations under the License. */
2222
#include "paddle/fluid/platform/nccl_helper.h"
2323
#endif
2424

25-
#include "paddle/fluid/framework/details/graph_builder_factory.h"
2625
#include "paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.h"
26+
#include "paddle/fluid/framework/details/ssa_graph_builder_factory.h"
2727
#include "paddle/fluid/framework/details/threaded_ssa_graph_executor.h"
2828
#include "paddle/fluid/platform/profiler.h"
2929

@@ -114,7 +114,7 @@ ParallelExecutor::ParallelExecutor(
114114

115115
member_->executor_.reset(new details::ThreadedSSAGraphExecutor(
116116
exec_strategy, member_->local_scopes_, places,
117-
builder_factory.Create()->Build(main_program)));
117+
builder_factory.Create()->BuildAndCheck(main_program)));
118118

119119
member_->executor_.reset(new details::ScopeBufferedSSAGraphExecutor(
120120
exec_strategy, member_->local_scopes_, std::move(var_infos),

0 commit comments

Comments
 (0)