From 9b5b005e7d016550635db0a654826d5a5a01ad71 Mon Sep 17 00:00:00 2001 From: danleifeng <52735331+danleifeng@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:25:56 +0800 Subject: [PATCH] update brpc version to 1.2.0 (#45351) * update brpc version;test=develop --- cmake/external/brpc.cmake | 9 ++++----- paddle/fluid/distributed/collective/CMakeLists.txt | 10 ++++++++++ paddle/fluid/distributed/ps/service/heter_client.h | 4 +++- paddle/fluid/distributed/ps/service/heter_server.cc | 10 ---------- paddle/fluid/framework/details/CMakeLists.txt | 3 +++ paddle/fluid/pybind/CMakeLists.txt | 8 ++++++++ 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/cmake/external/brpc.cmake b/cmake/external/brpc.cmake index 6ace45e11b..1e9568013e 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 b6b5ddc179..02e57700c9 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 84fbee4404..10d916b710 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 102cf94b62..d04b514b42 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 e193274ff2..8908cfe1d2 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 4ba49673a9..61e9ad9c9b 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}) -- GitLab