From 96770f519e7a2a11ae8a80850d1e6a1a699e2162 Mon Sep 17 00:00:00 2001 From: Yiqun Liu Date: Thu, 13 Feb 2020 10:17:07 +0800 Subject: [PATCH] Disable fusion_group for windows and mac in build_strategy. (#22549) test=develop --- paddle/fluid/framework/details/CMakeLists.txt | 2 +- paddle/fluid/framework/details/build_strategy.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/details/CMakeLists.txt b/paddle/fluid/framework/details/CMakeLists.txt index 8f8f5766147..f8fac5345d6 100644 --- a/paddle/fluid/framework/details/CMakeLists.txt +++ b/paddle/fluid/framework/details/CMakeLists.txt @@ -107,7 +107,7 @@ set(IR_PASS_DEPS graph_viz_pass multi_devices_graph_pass coalesce_grad_tensor_pass fuse_all_reduce_op_pass backward_optimizer_op_deps_pass fuse_adam_op_pass fuse_sgd_op_pass fuse_momentum_op_pass sync_batch_norm_pass runtime_context_cache_pass) -if(WITH_GPU) +if(NOT APPLE AND NOT WIN32 AND WITH_GPU) set(IR_PASS_DEPS ${IR_PASS_DEPS} fusion_group_pass) endif() if(WITH_NGRAPH) diff --git a/paddle/fluid/framework/details/build_strategy.cc b/paddle/fluid/framework/details/build_strategy.cc index 0305081b814..68ca3cd6db2 100644 --- a/paddle/fluid/framework/details/build_strategy.cc +++ b/paddle/fluid/framework/details/build_strategy.cc @@ -166,8 +166,11 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder { AppendPassWithCheck(strategy_.fuse_relu_depthwise_conv_, "fuse_relu_depthwise_conv_pass"); AppendPassWithCheck(strategy_.fuse_bn_act_ops_, "fuse_bn_act_pass"); -#ifdef PADDLE_WITH_CUDA +#if defined(PADDLE_WITH_CUDA) && !defined(_WIN32) && !defined(__APPLE__) AppendPassWithCheck(strategy_.enable_auto_fusion_, "fusion_group_pass"); +#else + LOG(WARNING) << "fusion_group is not enabled for Windows/MacOS now, and " + "only effective when running with CUDA GPU."; #endif AppendPassWithCheck(strategy_.fuse_elewise_add_act_ops_, "fuse_elewise_add_act_pass"); @@ -436,6 +439,6 @@ USE_PASS(mkldnn_placement_pass); #ifdef PADDLE_WITH_NGRAPH USE_PASS(ngraph_subgraph_pass); #endif -#ifdef PADDLE_WITH_CUDA +#if defined(PADDLE_WITH_CUDA) && !defined(_WIN32) && !defined(__APPLE__) USE_PASS(fusion_group_pass); #endif -- GitLab