diff --git a/python/paddle/fluid/contrib/slim/core/compressor.py b/python/paddle/fluid/contrib/slim/core/compressor.py index c076a0764fe52a8f0e9426eeb2defe23e2248914..5eb8d970addec2bb83661cda8cb9c7853acb8b74 100644 --- a/python/paddle/fluid/contrib/slim/core/compressor.py +++ b/python/paddle/fluid/contrib/slim/core/compressor.py @@ -480,9 +480,12 @@ class Compressor(object): executor = SlimGraphExecutor(self.place) if context.optimize_graph.compiled_graph is None: + build_strategy = compiler.BuildStrategy() + build_strategy.fuse_all_reduce_ops = False context.optimize_graph.compiled_graph = compiler.CompiledProgram( context.optimize_graph.program).with_data_parallel( - loss_name=context.optimize_graph.out_nodes['loss']) + loss_name=context.optimize_graph.out_nodes['loss'], + build_strategy=build_strategy) if isinstance(context.train_reader, Variable) or ( isinstance(context.train_reader, diff --git a/python/paddle/fluid/contrib/slim/graph/graph_wrapper.py b/python/paddle/fluid/contrib/slim/graph/graph_wrapper.py index 78697a2023b68bedecc39a713b72e217523a41f5..1c01eb82d7f3c1b82615cbd78827ec4e9f7002c4 100644 --- a/python/paddle/fluid/contrib/slim/graph/graph_wrapper.py +++ b/python/paddle/fluid/contrib/slim/graph/graph_wrapper.py @@ -263,6 +263,7 @@ class GraphWrapper(object): build_strategy = compiler.BuildStrategy() build_strategy.enable_inplace = mem_opt build_strategy.memory_optimize = mem_opt + build_strategy.fuse_all_reduce_ops = False # build_strategy.async_mode = False self.compiled_graph = compiler.CompiledProgram( target).with_data_parallel( diff --git a/python/paddle/fluid/contrib/slim/quantization/quantization_strategy.py b/python/paddle/fluid/contrib/slim/quantization/quantization_strategy.py index 5d2b6ea369dedfd1f1437ae626f7f3b3eb6a21a7..5004faeea78c1491ef33e7ebc6bee2b45d9823d8 100644 --- a/python/paddle/fluid/contrib/slim/quantization/quantization_strategy.py +++ b/python/paddle/fluid/contrib/slim/quantization/quantization_strategy.py @@ -138,6 +138,7 @@ class QuantizationStrategy(Strategy): build_strategy = BuildStrategy() build_strategy.enable_inplace = False build_strategy.memory_optimize = False + build_strategy.fuse_all_reduce_ops = False # for quantization training context.optimize_graph.compiled_graph = CompiledProgram( train_ir_graph.graph).with_data_parallel(