Skip to content

Commit 067381e

Browse files
authored
Merge pull request #6146 from typhoonzero/add_switch_distributed
Add switch for distributed support
2 parents 1b612d3 + dda277b commit 067381e

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-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-non-virtual-dtor -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)

paddle/scripts/docker/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function cmake_gen() {
3636
${PYTHON_FLAGS}
3737
-DWITH_DOC=OFF
3838
-DWITH_GPU=${WITH_GPU:-OFF}
39+
-DWITH_DISTRIBUTE=${WITH_DISTRIBUTE:-OFF}
3940
-DWITH_MKL=${WITH_MKL:-ON}
4041
-DWITH_AVX=${WITH_AVX:-OFF}
4142
-DWITH_GOLANG=${WITH_GOLANG:-ON}
@@ -57,6 +58,7 @@ EOF
5758
${PYTHON_FLAGS} \
5859
-DWITH_DOC=OFF \
5960
-DWITH_GPU=${WITH_GPU:-OFF} \
61+
-DWITH_DISTRIBUTE=${WITH_DISTRIBUTE:-OFF} \
6062
-DWITH_MKL=${WITH_MKL:-ON} \
6163
-DWITH_AVX=${WITH_AVX:-OFF} \
6264
-DWITH_GOLANG=${WITH_GOLANG:-ON} \

0 commit comments

Comments
 (0)