diff --git a/paddle/fluid/CMakeLists.txt b/paddle/fluid/CMakeLists.txt index 595454e90b9cd713fd2baed24538cf5fbc93934a..6e951e42a0f2f84ff7e638c382359d5f8e1ca5d1 100644 --- a/paddle/fluid/CMakeLists.txt +++ b/paddle/fluid/CMakeLists.txt @@ -9,4 +9,4 @@ add_subdirectory(pybind) # NOTE: please add subdirectory inference at last. add_subdirectory(inference) -add_subdirectory(train) +#add_subdirectory(train) diff --git a/paddle/fluid/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt index 0d682fc0a5d7dd0c7925ff97fd77c6107a153b08..a89dc3caf55338358b837943a89ea2ba4b7f2e1c 100644 --- a/paddle/fluid/inference/CMakeLists.txt +++ b/paddle/fluid/inference/CMakeLists.txt @@ -25,13 +25,13 @@ if (WIN32) list(APPEND fluid_third_partys gflags glog protobuf cblas) endif(WIN32) -# paddle_fluid_origin exclude inference api interface -if(WIN32) - sep_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api) -else(WIN32) - #set(CMAKE_C_ARCHIVE_CREATE " --target elf64-x86-64 cr paddle_fluid_origin ${fluid_modules} paddle_fluid_api") - cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api) -endif(WIN32) +# # paddle_fluid_origin exclude inference api interface +# if(WIN32) + # sep_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api) +# else(WIN32) + # set(CMAKE_C_ARCHIVE_CREATE " --target elf64-x86-64 cr paddle_fluid_origin ${fluid_modules} paddle_fluid_api") + # cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api) +# endif(WIN32) add_subdirectory(api) @@ -41,19 +41,19 @@ set(SHARED_INFERENCE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/api/analysis_predictor.cc ${CMAKE_CURRENT_SOURCE_DIR}/api/details/zero_copy_tensor.cc) -if(WIN32) - sep_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} zero_copy_tensor reset_tensor_array - analysis_config paddle_pass_builder) -else(WIN32) - cc_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} - zero_copy_tensor reset_tensor_array analysis_config paddle_pass_builder) -endif(WIN32) +# if(WIN32) + # sep_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} zero_copy_tensor reset_tensor_array + # analysis_config paddle_pass_builder) +# else(WIN32) + # cc_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} + # zero_copy_tensor reset_tensor_array analysis_config paddle_pass_builder) +# endif(WIN32) -if(NOT APPLE) - # TODO(liuyiqu: Temporarily disable the link flag because it is not support on Mac. - set(LINK_FLAGS "-Wl,--retain-symbols-file ${CMAKE_CURRENT_SOURCE_DIR}/paddle_fluid.sym") - set_target_properties(paddle_fluid PROPERTIES LINK_FLAGS "${LINK_FLAGS}") -endif() +# if(NOT APPLE) + # # TODO(liuyiqu: Temporarily disable the link flag because it is not support on Mac. + # set(LINK_FLAGS "-Wl,--retain-symbols-file ${CMAKE_CURRENT_SOURCE_DIR}/paddle_fluid.sym") + # set_target_properties(paddle_fluid PROPERTIES LINK_FLAGS "${LINK_FLAGS}") +# endif() # Create shared library if(WIN32) @@ -87,10 +87,10 @@ if(NOT APPLE AND NOT WIN32) add_custom_target(check_symbol ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/.check_symbol") endif() -if(WITH_TESTING) - # tests/book depends the models that generated by python/paddle/fluid/tests/book - add_subdirectory(tests/book) - if(WITH_INFERENCE_API_TEST) - add_subdirectory(tests/api) - endif() -endif() +# if(WITH_TESTING) + # # tests/book depends the models that generated by python/paddle/fluid/tests/book + # add_subdirectory(tests/book) + # if(WITH_INFERENCE_API_TEST) + # add_subdirectory(tests/api) + # endif() +# endif() diff --git a/paddle/fluid/pybind/imperative.cc b/paddle/fluid/pybind/imperative.cc index 6bbda69297a48ce27ce23282c4e08d49ee3cce6c..29c8e6a12940eb5652a0a97bea27c6fed5612001 100644 --- a/paddle/fluid/pybind/imperative.cc +++ b/paddle/fluid/pybind/imperative.cc @@ -42,6 +42,7 @@ void BindTracer(pybind11::module* m) { framework::AttributeMap attrs_map, const platform::CPUPlace expected_place, const bool stop_gradient = false) { + pybind11::gil_scoped_release release; return self.Trace(op, inputs, outputs, attrs_map, expected_place, stop_gradient); }) @@ -52,6 +53,7 @@ void BindTracer(pybind11::module* m) { framework::AttributeMap attrs_map, const platform::CUDAPlace expected_place, const bool stop_gradient = false) { + pybind11::gil_scoped_release release; return self.Trace(op, inputs, outputs, attrs_map, expected_place, stop_gradient); })