diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 5e23a0f36f04acdf8aa2c480816ac87df0bf697c..535786b8b27ef27287e24341dea7243ce8318f21 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -17,8 +17,8 @@ if(NOT WITH_CINN) endif() if(NOT CINN_GIT_TAG) - # 2023.01.28 commit - set(CINN_GIT_TAG 1449890f7724babf2a343c6f8073bd28a7bbc683) + # 2023.02.09 commit + set(CINN_GIT_TAG 63cf4267a0f8756df61b0dca5fb30bf3748ba2f4) endif() message(STATUS "CINN version: " ${CINN_GIT_TAG}) diff --git a/cmake/external/lite.cmake b/cmake/external/lite.cmake index 693ba66917cc6230194a57c7eb7c8743fa86c371..b248ac41a89f1eeac051f07dd393c41f6c4a5b23 100644 --- a/cmake/external/lite.cmake +++ b/cmake/external/lite.cmake @@ -120,7 +120,11 @@ if(NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ${LITE_PREFIX_DIR}/src/extern_lite/cmake/os/armlinux.cmake UPDATE_COMMAND "" BUILD_COMMAND ${LITE_BUILD_COMMAND} - INSTALL_COMMAND "" + INSTALL_COMMAND + cp ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.cc + ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/core/ && cp + ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h + ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/core/ CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_FLAGS=${LITE_CMAKE_CXX_FLAGS} @@ -169,7 +173,11 @@ if(NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) "s?NNadapter_bridges_path = os.path.abspath('..')+\"\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?NNadapter_bridges_path = os.path.abspath(\'..\')+\"\/extern_lite\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?" ${LITE_PREFIX_DIR}/src/extern_lite//lite/tools/cmake_tools/record_supported_kernel_op.py BUILD_COMMAND ${LITE_BUILD_COMMAND} - INSTALL_COMMAND "" + INSTALL_COMMAND + cp ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.cc + ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/core/ && cp + ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h + ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/core/ CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_FLAGS=${LITE_CMAKE_CXX_FLAGS} diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index e774aff8b0298fe95004ed066ab4cc1796ee3c61..475550ea79f0c8d01e8cc093d63d5cecf6917a1c 100755 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -75,8 +75,8 @@ function(protobuf_generate_python SRCS) list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py") add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py" - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out - ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL} + COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${PADDLE_BINARY_DIR} + -I${PADDLE_SOURCE_DIR} ${ABS_FIL} DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE} COMMENT "Running Python protocol buffer compiler on ${FIL}" VERBATIM) @@ -236,24 +236,24 @@ function(build_protobuf TARGET_NAME BUILD_FOR_HOST) if(WITH_ASCEND AND NOT WITH_ASCEND_CXX11) set(PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git) - set(PROTOBUF_TAG v3.8.0) + set(PROTOBUF_TAG v21.12) elseif(WITH_ASCEND_CL AND NOT WITH_ASCEND_CXX11) set(PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git) - set(PROTOBUF_TAG v3.8.0) + set(PROTOBUF_TAG v21.12) elseif(WITH_IPU) set(PROTOBUF_REPOSITORY ${GIT_URL}/protocolbuffers/protobuf.git) - set(PROTOBUF_TAG d750fbf648256c7c631f51ffdbf67d7c18b0114e) + set(PROTOBUF_TAG v21.12) elseif(WIN32) set(PROTOBUF_REPOSITORY ${GIT_URL}/protocolbuffers/protobuf.git) # Change the tag to support building with vs2019 set(PROTOBUF_TAG 01a05a53f40ca2ac5f0af10c6cc0810bee39b792) else() set(PROTOBUF_REPOSITORY ${GIT_URL}/protocolbuffers/protobuf.git) - set(PROTOBUF_TAG 9f75c5aa851cd877fb0d93ccc31b8567a6706546) + set(PROTOBUF_TAG v21.12) if(WITH_GPU) if(${CMAKE_CUDA_COMPILER_VERSION} LESS 12.0 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) - set(PROTOBUF_TAG 2dc747c574b68a808ea4699d26942c8132fe2b09) + set(PROTOBUF_TAG v21.12) endif() endif() endif() @@ -321,17 +321,17 @@ function(build_protobuf TARGET_NAME BUILD_FOR_HOST) endfunction() if(WITH_ASCEND OR WITH_ASCEND_CL) - set(PROTOBUF_VERSION 3.8.0) + set(PROTOBUF_VERSION 21.12) elseif(WITH_IPU) - set(PROTOBUF_VERSION 3.6.1) + set(PROTOBUF_VERSION 21.12) elseif(WITH_ARM_BRPC) - set(PROTOBUF_VERSION 3.7.1-baidu-ee-common) + set(PROTOBUF_VERSION 21.12-baidu-ee-common) else() - set(PROTOBUF_VERSION 3.1.0) + set(PROTOBUF_VERSION 21.12) if(WITH_GPU) if(${CMAKE_CUDA_COMPILER_VERSION} LESS 12.0 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) - set(PROTOBUF_VERSION 3.16.0) + set(PROTOBUF_VERSION 21.12) endif() endif() endif() diff --git a/cmake/generic.cmake b/cmake/generic.cmake index 9cdc0e127c8d5177c819a5b4a97378e3c6eb77ab..cf4708ccff942103954384f1db518ef6b7160e1d 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -1063,8 +1063,8 @@ function(paddle_protobuf_generate_cpp SRCS HDRS) add_custom_command( OUTPUT "${_protobuf_protoc_src}" "${_protobuf_protoc_hdr}" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}" - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} -I${CMAKE_CURRENT_SOURCE_DIR} - --cpp_out "${CMAKE_CURRENT_BINARY_DIR}" ${ABS_FIL} + COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} -I${PADDLE_SOURCE_DIR} --cpp_out + "${PADDLE_BINARY_DIR}" ${ABS_FIL} # Set `EXTERN_PROTOBUF_DEPEND` only if need to compile `protoc.exe`. DEPENDS ${ABS_FIL} ${EXTERN_PROTOBUF_DEPEND} COMMENT "Running C++ protocol buffer compiler on ${FIL}" diff --git a/paddle/fluid/distributed/fleet_executor/dist_model.cc b/paddle/fluid/distributed/fleet_executor/dist_model.cc index 89edc3a60c882ac7cab49f5cd6f0216ac9d33726..02ee53a4b444ace0623fe09a50a70d438bb0f40d 100644 --- a/paddle/fluid/distributed/fleet_executor/dist_model.cc +++ b/paddle/fluid/distributed/fleet_executor/dist_model.cc @@ -433,6 +433,7 @@ bool DistModel::PrepareFleetExe() { executor_desc_ = FleetExecutorDesc(); executor_desc_.set_cur_rank(config_.local_rank); std::unordered_map id_to_rank; + for (int i = 0; i < config_.nranks; ++i) { RankInfo *rank_info = executor_desc_.add_cluster_info(); rank_info->set_rank(i); diff --git a/paddle/fluid/distributed/ps/service/graph_brpc_client.h b/paddle/fluid/distributed/ps/service/graph_brpc_client.h index a5d909636d546ed8089f6948e674ea9ab870eabf..d3598e7855f124c07273051e905eca53a33ba020 100644 --- a/paddle/fluid/distributed/ps/service/graph_brpc_client.h +++ b/paddle/fluid/distributed/ps/service/graph_brpc_client.h @@ -49,11 +49,13 @@ class GraphPsService_Stub : public PsService_Stub { } virtual ~GraphPsService_Stub() {} + GraphPsService_Stub(const GraphPsService_Stub&); + GraphPsService_Stub& operator=(const GraphPsService_Stub&); + // implements PsService ------------------------------------------ GraphBrpcService* graph_service; std::shared_ptr<::ThreadPool> task_pool; ::google::protobuf::RpcChannel* local_channel; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GraphPsService_Stub); void service(::google::protobuf::RpcController* controller, const ::paddle::distributed::PsRequestMessage* request, ::paddle::distributed::PsResponseMessage* response, diff --git a/paddle/fluid/framework/ir/is_test_pass_tester.cc b/paddle/fluid/framework/ir/is_test_pass_tester.cc index f44ed42279d079c27932922339a2cf08bdf36dab..78e9db9e9b8d68c8af02e41cbcd8cc5c9f2d12a6 100644 --- a/paddle/fluid/framework/ir/is_test_pass_tester.cc +++ b/paddle/fluid/framework/ir/is_test_pass_tester.cc @@ -14,7 +14,7 @@ #include #include "paddle/fluid/framework/ir/is_test_pass.h" -#ifdef _WIN32 +#if defined _WIN32 || defined __APPLE__ #undef FALSE #undef TRUE #endif diff --git a/paddle/fluid/framework/op_def.proto b/paddle/fluid/framework/op_def.proto index 7c4b42b1344b8b236078de694b67e05d983ed2a9..51b5e13eafdd865a4b85e5c12c205d3c573b03fb 100644 --- a/paddle/fluid/framework/op_def.proto +++ b/paddle/fluid/framework/op_def.proto @@ -14,7 +14,7 @@ limitations under the License. */ syntax = "proto2"; -import "framework.proto"; +import "paddle/fluid/framework/framework.proto"; package paddle.framework.proto; message OpDef { diff --git a/paddle/fluid/framework/pass_desc.proto b/paddle/fluid/framework/pass_desc.proto index 53b785490202248feab9ec1d63bc59c8349430a2..88ec7f8e2be7243e8fa295e0dc77081480aea767 100644 --- a/paddle/fluid/framework/pass_desc.proto +++ b/paddle/fluid/framework/pass_desc.proto @@ -11,7 +11,7 @@ limitations under the License. */ syntax = "proto2"; -import "framework.proto"; +import "paddle/fluid/framework/framework.proto"; package paddle.framework.proto; // Describes one subsitute subgraph. diff --git a/paddle/fluid/framework/trainer_desc.proto b/paddle/fluid/framework/trainer_desc.proto index daded21ec62d9522211106b2c074064fc42e6d96..5f277aff8a12740364b35d7d62c30c27cf65e28d 100644 --- a/paddle/fluid/framework/trainer_desc.proto +++ b/paddle/fluid/framework/trainer_desc.proto @@ -14,8 +14,8 @@ limitations under the License. */ syntax = "proto2"; option optimize_for = LITE_RUNTIME; -import "data_feed.proto"; -import "framework.proto"; +import "paddle/fluid/framework/data_feed.proto"; +import "paddle/fluid/framework/framework.proto"; package paddle.framework; message TrainerDesc { diff --git a/paddle/fluid/operators/graph_khop_sampler_imp.h b/paddle/fluid/operators/graph_khop_sampler_imp.h index ba938407c25d4e5890fe8caaa6ce3a1f1aaacc52..98f3d182039f62b62713afe1f257e2470ff9ee5f 100644 --- a/paddle/fluid/operators/graph_khop_sampler_imp.h +++ b/paddle/fluid/operators/graph_khop_sampler_imp.h @@ -30,9 +30,8 @@ inline __device__ bool AttemptInsert( static_cast(-1), static_cast(id)); if (key == -1 || key == id) { - atomicMin( - reinterpret_cast(&key_index[pos]), // NOLINT - static_cast(index)); // NOLINT + atomicMin(reinterpret_cast(&key_index[pos]), // NOLINT + static_cast(index)); // NOLINT return true; } else { return false; @@ -43,9 +42,8 @@ inline __device__ bool AttemptInsert( static_cast(-1), // NOLINT static_cast(id)); // NOLINT if (key == -1 || key == id) { - atomicMin( - reinterpret_cast(&key_index[pos]), // NOLINT - static_cast(index)); // NOLINT + atomicMin(reinterpret_cast(&key_index[pos]), // NOLINT + static_cast(index)); // NOLINT return true; } else { return false; diff --git a/paddle/infrt/paddle/framework.proto b/paddle/infrt/paddle/framework.proto index 634ec9665d08e06bf1d3aeb087b49b737249a161..9cf82a763f33fa42d8996dac8743919e7dd766a5 100644 --- a/paddle/infrt/paddle/framework.proto +++ b/paddle/infrt/paddle/framework.proto @@ -210,4 +210,4 @@ message ProgramDesc { repeated BlockDesc blocks = 1; optional Version version = 4; optional OpCompatibleMap op_compatible_map = 3; -} \ No newline at end of file +} diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index ffe3327ce73526ff381031626a882eb0b9948b09..5ca7b608378899daea69c5898339c57a4230a911 100644 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -3429,7 +3429,6 @@ function build_pr_and_develop() { mkdir ${PADDLE_ROOT}/build/pr_whl && cp ${PADDLE_ROOT}/build/python/dist/*.whl ${PADDLE_ROOT}/build/pr_whl rm -f ${PADDLE_ROOT}/build/python/dist/*.whl && rm -f ${PADDLE_ROOT}/build/python/build/.timestamp - git fetch upstream develop git checkout develop dev_commit=`git log -1|head -1|awk '{print $2}'` diff --git a/python/paddle/fluid/framework.py b/python/paddle/fluid/framework.py index 8b019114a322b9fd19e18f499e60d574002c7dd9..55cb463c0177d3ef939b71359ac680835c2cbecc 100644 --- a/python/paddle/fluid/framework.py +++ b/python/paddle/fluid/framework.py @@ -28,7 +28,9 @@ import subprocess import multiprocessing import sys import logging -from .proto import framework_pb2 + +from .proto import framework_pb2, data_feed_pb2 + from . import core from . import unique_name diff --git a/python/requirements.txt b/python/requirements.txt index a4550d3ad906d0ce65da50126de3bebaf6404eb8..a35062fca483ce45522590bf351cc0c5ea572b85 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,6 +1,7 @@ requests>=2.20.0 numpy>=1.13 -protobuf>=3.1.0, <=3.20.2 +protobuf>=3.1.0 ; platform_system != "Windows" +protobuf>=3.1.0, <=3.20.2 ; platform_system == "Windows" Pillow decorator astor