未验证 提交 9b5b005e 编写于 作者: D danleifeng 提交者: GitHub

update brpc version to 1.2.0 (#45351)

* update brpc version;test=develop
上级 cb0b53cb
...@@ -45,9 +45,8 @@ set(prefix_path ...@@ -45,9 +45,8 @@ set(prefix_path
ExternalProject_Add( ExternalProject_Add(
extern_brpc extern_brpc
${EXTERNAL_PROJECT_LOG_ARGS} ${EXTERNAL_PROJECT_LOG_ARGS}
# TODO(gongwb): change to de newst repo when they changed GIT_REPOSITORY "https://github.com/apache/incubator-brpc"
GIT_REPOSITORY "https://github.com/wangjiawei04/brpc" GIT_TAG 1.2.0
GIT_TAG "e203afb794caf027da0f1e0776443e7d20c0c28e"
PREFIX ${BRPC_PREFIX_DIR} PREFIX ${BRPC_PREFIX_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
...@@ -60,8 +59,8 @@ ExternalProject_Add( ...@@ -60,8 +59,8 @@ ExternalProject_Add(
-DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE} -DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${prefix_path} -DCMAKE_PREFIX_PATH=${prefix_path}
-DWITH_GLOG=ON -DWITH_GLOG=ON
-DIOBUF_WITH_HUGE_BLOCK=ON -DBUILD_BRPC_TOOLS=ON
-DBRPC_WITH_RDMA=${WITH_BRPC_RDMA} -DBUILD_SHARED_LIBS=ON
${EXTERNAL_OPTIONAL_ARGS} ${EXTERNAL_OPTIONAL_ARGS}
LIST_SEPARATOR | LIST_SEPARATOR |
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
......
...@@ -21,6 +21,11 @@ if(WITH_NCCL OR WITH_RCCL) ...@@ -21,6 +21,11 @@ if(WITH_NCCL OR WITH_RCCL)
DEPS processgroup place enforce collective_helper device_context DEPS processgroup place enforce collective_helper device_context
dense_tensor) dense_tensor)
if(WITH_DISTRIBUTE AND WITH_PSCORE) 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( cc_library(
processgroup_heter processgroup_heter
SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc
...@@ -40,6 +45,11 @@ if(WITH_ASCEND_CL) ...@@ -40,6 +45,11 @@ if(WITH_ASCEND_CL)
phi_api phi_api
eager_api) eager_api)
if(WITH_DISTRIBUTE AND WITH_PSCORE) 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( cc_library(
processgroup_heter processgroup_heter
SRCS ProcessGroupHeter.cc HCCLTools.cc Common.cc SRCS ProcessGroupHeter.cc HCCLTools.cc Common.cc
......
...@@ -100,7 +100,9 @@ class HeterClient { ...@@ -100,7 +100,9 @@ class HeterClient {
options.connection_type = ""; options.connection_type = "";
VLOG(4) << "ssl enabled in arm"; VLOG(4) << "ssl enabled in arm";
#else #else
options.ssl_options.enable = need_encrypt; if (need_encrypt) {
options.mutable_ssl_options();
}
#endif #endif
client_channels = &peer_switch_channels_; client_channels = &peer_switch_channels_;
} else if (peer_role == PEER_ROLE_IS_WORKER) { } else if (peer_role == PEER_ROLE_IS_WORKER) {
......
...@@ -32,13 +32,8 @@ void HeterServer::StartHeterService(bool neeed_encrypt) { ...@@ -32,13 +32,8 @@ void HeterServer::StartHeterService(bool neeed_encrypt) {
server_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE); server_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE);
brpc::ServerOptions options; brpc::ServerOptions options;
if (neeed_encrypt) { if (neeed_encrypt) {
#ifdef PADDLE_WITH_ARM_BRPC
options.mutable_ssl_options()->default_cert.certificate = "/cert.pem"; options.mutable_ssl_options()->default_cert.certificate = "/cert.pem";
options.mutable_ssl_options()->default_cert.private_key = "/key.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) { if (server_.Start(endpoint_.c_str(), &options) != 0) {
VLOG(0) << "HeterServer start fail. Try again."; VLOG(0) << "HeterServer start fail. Try again.";
...@@ -72,13 +67,8 @@ void HeterServer::StartHeterInterService(bool neeed_encrypt) { ...@@ -72,13 +67,8 @@ void HeterServer::StartHeterInterService(bool neeed_encrypt) {
server_inter_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE); server_inter_.AddService(&service_, brpc::SERVER_DOESNT_OWN_SERVICE);
brpc::ServerOptions options; brpc::ServerOptions options;
if (neeed_encrypt) { if (neeed_encrypt) {
#ifdef PADDLE_WITH_ARM_BRPC
options.mutable_ssl_options()->default_cert.certificate = "/cert.pem"; options.mutable_ssl_options()->default_cert.certificate = "/cert.pem";
options.mutable_ssl_options()->default_cert.private_key = "/key.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) { if (server_inter_.Start(endpoint_inter_.c_str(), &options) != 0) {
VLOG(4) << "switch inter server start fail. Try again."; VLOG(4) << "switch inter server start fail. Try again.";
......
...@@ -54,6 +54,9 @@ if(WITH_PSCORE) ...@@ -54,6 +54,9 @@ if(WITH_PSCORE)
set(DISTRIBUTE_COMPILE_FLAGS set(DISTRIBUTE_COMPILE_FLAGS
"-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor" "-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( set_source_files_properties(
reduce_op_handle.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) reduce_op_handle.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
set_source_files_properties( set_source_files_properties(
......
...@@ -159,6 +159,11 @@ if(NOT ON_INFER) ...@@ -159,6 +159,11 @@ if(NOT ON_INFER)
if(WITH_CUSTOM_DEVICE) if(WITH_CUSTOM_DEVICE)
set(PYBIND_DEPS ${PYBIND_DEPS} processgroup_custom) set(PYBIND_DEPS ${PYBIND_DEPS} processgroup_custom)
endif() 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) set(PYBIND_SRCS ${PYBIND_SRCS} distributed_py.cc)
endif() endif()
...@@ -198,6 +203,9 @@ if(WITH_PSCORE) ...@@ -198,6 +203,9 @@ if(WITH_PSCORE)
set(DISTRIBUTE_COMPILE_FLAGS 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" "-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() endif()
set_source_files_properties( set_source_files_properties(
fleet_py.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) fleet_py.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册