diff --git a/cmake/external/brpc.cmake b/cmake/external/brpc.cmake index 6ace45e11b82f54667e7c4c4836aa5736e797f37..1e9568013e2fdad6263649862b11f921918a8755 100755 --- a/cmake/external/brpc.cmake +++ b/cmake/external/brpc.cmake @@ -45,9 +45,8 @@ set(prefix_path ExternalProject_Add( extern_brpc ${EXTERNAL_PROJECT_LOG_ARGS} - # TODO(gongwb): change to de newst repo when they changed - GIT_REPOSITORY "https://github.com/wangjiawei04/brpc" - GIT_TAG "e203afb794caf027da0f1e0776443e7d20c0c28e" + GIT_REPOSITORY "https://github.com/apache/incubator-brpc" + GIT_TAG 1.2.0 PREFIX ${BRPC_PREFIX_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} @@ -60,8 +59,8 @@ ExternalProject_Add( -DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${prefix_path} -DWITH_GLOG=ON - -DIOBUF_WITH_HUGE_BLOCK=ON - -DBRPC_WITH_RDMA=${WITH_BRPC_RDMA} + -DBUILD_BRPC_TOOLS=ON + -DBUILD_SHARED_LIBS=ON ${EXTERNAL_OPTIONAL_ARGS} LIST_SEPARATOR | CMAKE_CACHE_ARGS diff --git a/paddle/fluid/distributed/collective/CMakeLists.txt b/paddle/fluid/distributed/collective/CMakeLists.txt index b6b5ddc179fd57f39612126b28e897e4bcf55a7c..02e57700c98798076faa455edbcf92cac3f7c1b0 100644 --- a/paddle/fluid/distributed/collective/CMakeLists.txt +++ b/paddle/fluid/distributed/collective/CMakeLists.txt @@ -21,6 +21,11 @@ if(WITH_NCCL OR WITH_RCCL) DEPS processgroup place enforce collective_helper device_context dense_tensor) if(WITH_DISTRIBUTE AND WITH_PSCORE) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") + endif() + set_source_files_properties( + ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) cc_library( processgroup_heter SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc @@ -40,6 +45,11 @@ if(WITH_ASCEND_CL) phi_api eager_api) if(WITH_DISTRIBUTE AND WITH_PSCORE) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") + endif() + set_source_files_properties( + ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) cc_library( processgroup_heter SRCS ProcessGroupHeter.cc HCCLTools.cc Common.cc diff --git a/paddle/fluid/distributed/ps/service/heter_client.h b/paddle/fluid/distributed/ps/service/heter_client.h index 84fbee44043be7c192b982988fa5474c3c0291db..10d916b71001186f1a2d91b0f4b74f3a17a61d26 100755 --- a/paddle/fluid/distributed/ps/service/heter_client.h +++ b/paddle/fluid/distributed/ps/service/heter_client.h @@ -100,7 +100,9 @@ class HeterClient { options.connection_type = ""; VLOG(4) << "ssl enabled in arm"; #else - options.ssl_options.enable = need_encrypt; + if (need_encrypt) { + options.mutable_ssl_options(); + } #endif client_channels = &peer_switch_channels_; } else if (peer_role == PEER_ROLE_IS_WORKER) { diff --git a/paddle/fluid/distributed/ps/service/heter_server.cc b/paddle/fluid/distributed/ps/service/heter_server.cc index 102cf94b625bc3bf728a393b73b117903c08577c..d04b514b4254f5974d451d17656817962a265fdf 100644 --- a/paddle/fluid/distributed/ps/service/heter_server.cc +++ b/paddle/fluid/distributed/ps/service/heter_server.cc @@ -32,13 +32,8 @@ void HeterServer::StartHeterService(bool neeed_encrypt) { server_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE); brpc::ServerOptions options; if (neeed_encrypt) { -#ifdef PADDLE_WITH_ARM_BRPC options.mutable_ssl_options()->default_cert.certificate = "/cert.pem"; options.mutable_ssl_options()->default_cert.private_key = "/key.pem"; -#else - options.ssl_options.default_cert.certificate = "/cert.pem"; - options.ssl_options.default_cert.private_key = "/key.pem"; -#endif } if (server_.Start(endpoint_.c_str(), &options) != 0) { VLOG(0) << "HeterServer start fail. Try again."; @@ -72,13 +67,8 @@ void HeterServer::StartHeterInterService(bool neeed_encrypt) { server_inter_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE); brpc::ServerOptions options; if (neeed_encrypt) { -#ifdef PADDLE_WITH_ARM_BRPC options.mutable_ssl_options()->default_cert.certificate = "/cert.pem"; options.mutable_ssl_options()->default_cert.private_key = "/key.pem"; -#else - options.ssl_options.default_cert.certificate = "/cert.pem"; - options.ssl_options.default_cert.private_key = "/key.pem"; -#endif } if (server_inter_.Start(endpoint_inter_.c_str(), &options) != 0) { VLOG(4) << "switch inter server start fail. Try again."; diff --git a/paddle/fluid/framework/details/CMakeLists.txt b/paddle/fluid/framework/details/CMakeLists.txt index e193274ff2137ac1f7026dddd295347d833c6ff3..8908cfe1d25393ddb683755842675ae04823dc7b 100644 --- a/paddle/fluid/framework/details/CMakeLists.txt +++ b/paddle/fluid/framework/details/CMakeLists.txt @@ -54,6 +54,9 @@ if(WITH_PSCORE) set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor" ) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") + endif() set_source_files_properties( reduce_op_handle.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) set_source_files_properties( diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index 4ba49673a941f3e20549f9b33936ca18b45cc987..61e9ad9c9b36bf3c85ffb86c7dd55e93fc3e84dc 100755 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -159,6 +159,11 @@ if(NOT ON_INFER) if(WITH_CUSTOM_DEVICE) set(PYBIND_DEPS ${PYBIND_DEPS} processgroup_custom) endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") + set_source_files_properties( + distributed_py.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) + endif() set(PYBIND_SRCS ${PYBIND_SRCS} distributed_py.cc) endif() @@ -198,6 +203,9 @@ if(WITH_PSCORE) set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor -Wno-error=sign-compare -Wno-error=unused-variable -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=unknown-pragmas -Wno-error=parentheses -Wno-error=unused-result" ) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") + endif() endif() set_source_files_properties( fleet_py.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})