diff --git a/paddle/fluid/framework/ir/multi_devices_graph_pass/fuse_all_reduce_op_pass.cc b/paddle/fluid/framework/ir/multi_devices_graph_pass/fuse_all_reduce_op_pass.cc index 73d7bf6dba0f01cc53ed0e9010c2da88afd6e384..3f7ceb5795876029531aa73d3aa0b9154a2e6408 100644 --- a/paddle/fluid/framework/ir/multi_devices_graph_pass/fuse_all_reduce_op_pass.cc +++ b/paddle/fluid/framework/ir/multi_devices_graph_pass/fuse_all_reduce_op_pass.cc @@ -105,6 +105,12 @@ class FuseAllReduceOpPass : public ir::Pass { auto *all_reduce_op_handle = dynamic_cast( &node->Wrapper()); if (all_reduce_op_handle) { +#if defined(PADDLE_WITH_DGC) + PADDLE_ENFORCE_NE( + all_reduce_op_handle->Name(), "sparse_all_reduce", + "DGC doesn't support fuse for now, if you want to use DGC " + "you need set strategy.fuse_all_reduce_ops = False."); +#endif auto inputs = details::DynamicCast( all_reduce_op_handle->Inputs()); PADDLE_ENFORCE_EQ(inputs.size(), num_place);