Skip to content

Commit 1a85286

Browse files
committed
add switch for distributed support
1 parent 8ac0227 commit 1a85286

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF)
5454
option(WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF)
5555
option(GLIDE_INSTALL "Download and install go dependencies " ON)
5656
option(USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF)
57+
option(WITH_DISTRIBUTE "Compile with grpc distributed support" OFF)
5758
option(USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF)
5859

5960
# CMAKE_BUILD_TYPE

cmake/external/cares.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515

16-
IF(MOBILE_INFERENCE)
16+
IF(MOBILE_INFERENCE OR NOT WITH_DISTRIBUTE)
1717
return()
1818
ENDIF()
1919

cmake/external/grpc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515

16-
IF(MOBILE_INFERENCE)
16+
IF(MOBILE_INFERENCE OR NOT WITH_DISTRIBUTE)
1717
return()
1818
ENDIF()
1919

paddle/operators/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ set(DEPS_OPS
212212
send_op
213213
recv_op)
214214

215+
if(WITH_DISTRIBUTE)
215216
add_subdirectory(detail)
216217
op_library(send_op SRCS send_op.cc DEPS sendrecvop_grpc grpc++_unsecure grpc_unsecure gpr cares zlib_target protobuf)
217218
set_source_files_properties(
@@ -225,6 +226,9 @@ set_source_files_properties(
225226
PROPERTIES
226227
COMPILE_FLAGS "-Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
227228

229+
cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS send_op recv_op sum_op executor)
230+
endif()
231+
228232
op_library(cond_op SRCS cond_op.cc DEPS framework_proto tensor operator net_op)
229233
op_library(cross_entropy_op DEPS cross_entropy)
230234
op_library(softmax_with_cross_entropy_op DEPS cross_entropy softmax)
@@ -275,4 +279,3 @@ if(WITH_GPU)
275279
cc_test(nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context)
276280
endif()
277281
cc_test(save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op)
278-
cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS send_op recv_op sum_op executor)

0 commit comments

Comments
 (0)