Skip to content

Commit f7b55de

Browse files
authored
Merge branch 'develop' into enhance_hierachical_sigmod_op
2 parents af9a330 + e68c1fc commit f7b55de

File tree

805 files changed

+26898
-11698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

805 files changed

+26898
-11698
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
python/paddle/fluid/tests/unittests/reader_reset_test.recordio
12
paddle/operators/check_t.save
23
paddle/operators/check_tensor.ls
34
paddle/operators/tensor.save
45
python/paddle/v2/fluid/tests/book/image_classification_resnet.inference.model/
56
python/paddle/v2/fluid/tests/book/image_classification_vgg.inference.model/
67
python/paddle/v2/fluid/tests/book/label_semantic_roles.inference.model/
8+
paddle/fluid/operators/distributed/send_recv.proto
79
*.DS_Store
810
*.vs
911
build/
@@ -28,4 +30,5 @@ third_party/
2830
build_*
2931
# clion workspace.
3032
cmake-build-*
33+
paddle/fluid/operators/distributed/send_recv.proto
3134
model_test

AUTHORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
| QiJune | Jun Qi |
4343
| qingqing01 | Qing-Qing Dang |
4444
| reyoung | Yang Yu |
45+
| Sand3r- | Michal Gallus |
4546
| Superjom | Chun-Wei Yan |
47+
| tensor-tang | Jian Tang |
4648
| tianbingsz | Tian-Bing Xu |
4749
| tpatejko | Tomasz Patejko |
4850
| typhoonzero | Yi Wu |

CMakeLists.txt

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
2626
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
2727
if(WIN32)
2828
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
29+
add_definitions("/DGOOGLE_GLOG_DLL_DECL=")
30+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /bigobj /MTd")
31+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /bigobj /MT")
32+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj /MTd")
33+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj /MT")
2934
endif(WIN32)
3035

3136
if(NOT CMAKE_CROSSCOMPILING)
@@ -41,6 +46,7 @@ option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_F
4146
option(WITH_AMD_GPU "Compile PaddlePaddle with AMD GPU" OFF)
4247
option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND})
4348
option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FOUND})
49+
option(WITH_NGRAPH "Compile PaddlePaddle with nGraph support." OFF)
4450
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
4551
option(WITH_TESTING "Compile PaddlePaddle with unit testing" OFF)
4652
option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)
@@ -62,10 +68,11 @@ option(WITH_DISTRIBUTE "Compile with distributed support" OFF)
6268
option(USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF)
6369
option(EIGEN_USE_THREADS "Compile with multi-threaded Eigen" OFF)
6470
option(WITH_ARM_FP16 "Use half precision support on armv8.2-a cpu" OFF)
65-
option(WITH_FAST_BUNDLE_TEST "Bundle tests that can be run in a single process together to reduce launch overhead" OFF)
6671
option(WITH_CONTRIB "Compile the third-party contributation" OFF)
6772
option(REPLACE_ENFORCE_GLOG "Replace PADDLE_ENFORCE with glog/CHECK for better debug." OFF)
6873
option(WITH_ANAKIN "Compile with Anakin library" OFF)
74+
option(ANAKIN_BUILD_FAT_BIN "Build anakin cuda fat-bin lib for all device plantform, ignored when WITH_ANAKIN=OFF" OFF)
75+
option(ANAKIN_BUILD_CROSS_PLANTFORM "Build anakin lib for any nvidia device plantform. ignored when WITH_ANAKIN=OFF" ON)
6976
option(WITH_GRPC "Use grpc as the default rpc framework" ${WITH_DISTRIBUTE})
7077
option(WITH_BRPC_RDMA "Use brpc rdma as the rpc protocal" OFF)
7178
option(ON_INFER "Turn on inference optimization." OFF)
@@ -104,6 +111,8 @@ if(ANDROID OR IOS)
104111
"Disable RDMA when cross-compiling for Android and iOS" FORCE)
105112
set(WITH_MKL OFF CACHE STRING
106113
"Disable MKL when cross-compiling for Android and iOS" FORCE)
114+
set(WITH_NGRAPH OFF CACHE STRING
115+
"Disable nGraph when cross-compiling for Android and iOS" FORCE)
107116
set(WITH_GOLANG OFF CACHE STRING
108117
"Disable golang when cross-compiling for Android and iOS" FORCE)
109118

@@ -172,6 +181,7 @@ include(external/protobuf) # download, build, install protobuf
172181
include(external/python) # download, build, install python
173182
include(external/openblas) # download, build, install openblas
174183
include(external/mkldnn) # download, build, install mkldnn
184+
include(external/ngraph) # download, build, install nGraph
175185
include(external/swig) # download, build, install swig
176186
include(external/boost) # download boost
177187
include(external/any) # download libn::any
@@ -292,6 +302,14 @@ set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")
292302
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
293303
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
294304

305+
if (ON_INFER)
306+
message(STATUS "On inference mode, will take place some specific optimization.")
307+
add_definitions(-DPADDLE_ON_INFERENCE)
308+
else()
309+
#TODO(luotao), combine this warning with `make inference_lib_dist` command.
310+
message(WARNING "On inference mode, will take place some specific optimization. Turn on the ON_INFER flag when building inference_lib only.")
311+
endif()
312+
295313
add_subdirectory(paddle)
296314
if(WITH_PYTHON)
297315
add_subdirectory(python)
@@ -302,11 +320,3 @@ if(WITH_DOC)
302320
find_python_module(recommonmark REQUIRED)
303321
add_subdirectory(doc)
304322
endif()
305-
306-
if (ON_INFER)
307-
message(STATUS "On inference mode, will take place some specific optimization.")
308-
add_definitions(-DPADDLE_ON_INFERENCE)
309-
else()
310-
#TODO(luotao), combine this warning with `make inference_lib_dist` command.
311-
message(WARNING "On inference mode, will take place some specific optimization. Turn on the ON_INFER flag when building inference_lib only.")
312-
endif()

cmake/configure.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ if(NOT WITH_PROFILER)
5050
endif(NOT WITH_PROFILER)
5151

5252
if(NOT CMAKE_CROSSCOMPILING)
53-
if(WITH_AVX AND AVX512F_FOUND)
54-
set(SIMD_FLAG ${AVX512F_FLAG})
55-
elseif(WITH_AVX AND AVX2_FOUND)
56-
set(SIMD_FLAG ${AVX2_FLAG})
57-
elseif(WITH_AVX AND AVX_FOUND)
53+
if(WITH_AVX AND AVX_FOUND)
5854
set(SIMD_FLAG ${AVX_FLAG})
5955
elseif(SSE3_FOUND)
6056
set(SIMD_FLAG ${SSE3_FLAG})
@@ -222,3 +218,7 @@ endif(WITH_GRPC)
222218
if(WITH_BRPC_RDMA)
223219
add_definitions(-DPADDLE_WITH_BRPC_RDMA)
224220
endif(WITH_BRPC_RDMA)
221+
222+
if(ON_INFER)
223+
add_definitions(-DPADDLE_ON_INFERENCE)
224+
endif(ON_INFER)

cmake/cuda.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ list(APPEND EXTERNAL_LIBS ${CUDA_LIBRARIES} ${CUDA_rt_LIBRARY})
157157
if(NOT WITH_DSO)
158158
# TODO(panyx0718): CUPTI only allows DSO?
159159
list(APPEND EXTERNAL_LIBS ${CUDNN_LIBRARY} ${CUPTI_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY} ${NCCL_LIBRARY})
160+
if(WIN32)
161+
set_property(GLOBAL PROPERTY CUDA_MODULES ${CUDNN_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY})
162+
endif(WIN32)
160163
endif(NOT WITH_DSO)
161164

162165
# setting nvcc arch flags
@@ -196,10 +199,12 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
196199
list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_RELEASE})
197200
endif()
198201
else(NOT WIN32)
199-
if(CMAKE_BUILD_TYPE STREQUAL "Release")
202+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
203+
list(APPEND CUDA_NVCC_FLAGS "-g -G")
204+
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
200205
list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG")
201206
else()
202-
message(FATAL "Windows only support Release build now. Please set visual studio build type to Release, x64 build.")
207+
message(FATAL "Windows only support Release or Debug build now. Please set visual studio build type to Release/Debug, x64 build.")
203208
endif()
204209
endif(NOT WIN32)
205210

cmake/cudnn.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ if(NOT WITH_GPU)
22
return()
33
endif()
44

5-
set(CUDNN_ROOT "/usr" CACHE PATH "CUDNN ROOT")
5+
if(WIN32)
6+
set(CUDNN_ROOT ${CUDA_TOOLKIT_ROOT_DIR})
7+
else(WIN32)
8+
set(CUDNN_ROOT "/usr" CACHE PATH "CUDNN ROOT")
9+
endif(WIN32)
10+
611
find_path(CUDNN_INCLUDE_DIR cudnn.h
712
PATHS ${CUDNN_ROOT} ${CUDNN_ROOT}/include
813
$ENV{CUDNN_ROOT} $ENV{CUDNN_ROOT}/include ${CUDA_TOOLKIT_INCLUDE}

cmake/external/anakin.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ ExternalProject_Add(
5858
-DPROTOBUF_ROOT=${THIRD_PARTY_PATH}/install/protobuf
5959
-DMKLML_ROOT=${THIRD_PARTY_PATH}/install/mklml
6060
-DENABLE_OP_TIMER=${ANAKIN_ENABLE_OP_TIMER}
61+
-DBUILD_FAT_BIN=${ANAKIN_BUILD_FAT_BIN}
62+
-DBUILD_CROSS_PLANTFORM=${ANAKIN_BUILD_CROSS_PLANTFORM}
6163
${EXTERNAL_OPTIONAL_ARGS}
6264
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${ANAKIN_INSTALL_DIR}
6365
)
6466

6567
message(STATUS "Anakin for inference is enabled")
6668
message(STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY}")
67-
69+
add_dependencies(extern_anakin protobuf mklml)
6870
add_library(anakin_shared SHARED IMPORTED GLOBAL)
6971
set_property(TARGET anakin_shared PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB})
70-
add_dependencies(anakin_shared extern_anakin protobuf mklml)
72+
add_dependencies(anakin_shared extern_anakin)
7173

7274
add_library(anakin_saber SHARED IMPORTED GLOBAL)
7375
set_property(TARGET anakin_saber PROPERTY IMPORTED_LOCATION ${ANAKIN_SABER_LIB})
74-
add_dependencies(anakin_saber extern_anakin protobuf mklml)
76+
add_dependencies(anakin_saber extern_anakin)
7577

7678
list(APPEND external_project_dependencies anakin_shared anakin_saber)

cmake/external/boost.cmake

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,28 @@ if((NOT DEFINED BOOST_TAR) OR (NOT DEFINED BOOST_URL))
2828
set(BOOST_TAR "boost_1_41_0" CACHE STRING "" FORCE)
2929
set(BOOST_URL "http://paddlepaddledeps.cdn.bcebos.com/${BOOST_TAR}.tar.gz" CACHE STRING "" FORCE)
3030
endif()
31-
IF (WIN32)
32-
MESSAGE(WARNING, "In windows, boost can not be downloaded automaticlly, please build it manually and put it at " ${THIRD_PARTY_PATH}install/boost)
33-
else()
34-
MESSAGE(STATUS "BOOST_TAR: ${BOOST_TAR}, BOOST_URL: ${BOOST_URL}")
35-
ENDIF(WIN32)
31+
32+
MESSAGE(STATUS "BOOST_TAR: ${BOOST_TAR}, BOOST_URL: ${BOOST_URL}")
3633

3734
set(BOOST_SOURCES_DIR ${THIRD_PARTY_PATH}/boost)
3835
set(BOOST_DOWNLOAD_DIR "${BOOST_SOURCES_DIR}/src/${BOOST_PROJECT}")
39-
set(BOOST_INCLUDE_DIR "${BOOST_DOWNLOAD_DIR}/${BOOST_TAR}" CACHE PATH "boost include directory." FORCE)
40-
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
4136

37+
set(BOOST_INCLUDE_DIR "${BOOST_DOWNLOAD_DIR}" CACHE PATH "boost include directory." FORCE)
38+
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
4239
include_directories(${BOOST_INCLUDE_DIR})
4340

44-
if (NOT WIN32)
4541
ExternalProject_Add(
4642
${BOOST_PROJECT}
4743
${EXTERNAL_PROJECT_LOG_ARGS}
4844
DOWNLOAD_DIR ${BOOST_DOWNLOAD_DIR}
49-
DOWNLOAD_COMMAND wget --no-check-certificate ${BOOST_URL} -c -q -O ${BOOST_TAR}.tar.gz
50-
&& tar zxf ${BOOST_TAR}.tar.gz
45+
URL ${BOOST_URL}
5146
DOWNLOAD_NO_PROGRESS 1
5247
PREFIX ${BOOST_SOURCES_DIR}
5348
CONFIGURE_COMMAND ""
5449
BUILD_COMMAND ""
5550
INSTALL_COMMAND ""
5651
UPDATE_COMMAND ""
57-
)
58-
endif(NOT WIN32)
52+
)
5953

6054
if (${CMAKE_VERSION} VERSION_LESS "3.3.0" OR NOT WIN32)
6155
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/boost_dummy.c)

cmake/external/gflags.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ ExternalProject_Add(
3535
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
3636
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
3737
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
38+
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
39+
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
3840
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
41+
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
42+
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
43+
-DBUILD_STATIC_LIBS=ON
3944
-DCMAKE_INSTALL_PREFIX=${GFLAGS_INSTALL_DIR}
4045
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
4146
-DBUILD_TESTING=OFF
@@ -48,8 +53,8 @@ ExternalProject_Add(
4853
IF(WIN32)
4954
IF(NOT EXISTS "${GFLAGS_INSTALL_DIR}/lib/libgflags.lib")
5055
add_custom_command(TARGET extern_gflags POST_BUILD
51-
COMMAND cmake -E rename ${GFLAGS_INSTALL_DIR}/lib/gflags_static.lib ${GFLAGS_INSTALL_DIR}/lib/libgflags.lib
52-
)
56+
COMMAND cmake -E copy ${GFLAGS_INSTALL_DIR}/lib/gflags_static.lib ${GFLAGS_INSTALL_DIR}/lib/libgflags.lib
57+
)
5358
ENDIF()
5459
ENDIF(WIN32)
5560
ADD_LIBRARY(gflags STATIC IMPORTED GLOBAL)

cmake/external/glog.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ ExternalProject_Add(
4646
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
4747
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
4848
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
49+
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
50+
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
4951
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
52+
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
53+
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
5054
-DCMAKE_INSTALL_PREFIX=${GLOG_INSTALL_DIR}
5155
-DCMAKE_INSTALL_LIBDIR=${GLOG_INSTALL_DIR}/lib
5256
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
@@ -63,7 +67,7 @@ ExternalProject_Add(
6367
IF(WIN32)
6468
IF(NOT EXISTS "${GLOG_INSTALL_DIR}/lib/libglog.lib")
6569
add_custom_command(TARGET extern_glog POST_BUILD
66-
COMMAND cmake -E rename ${GLOG_INSTALL_DIR}/lib/glog.lib ${GLOG_INSTALL_DIR}/lib/libglog.lib
70+
COMMAND cmake -E copy ${GLOG_INSTALL_DIR}/lib/glog.lib ${GLOG_INSTALL_DIR}/lib/libglog.lib
6771
)
6872
ENDIF()
6973
ENDIF(WIN32)

0 commit comments

Comments
 (0)