Skip to content

Commit 193185b

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into shift
2 parents 8a00238 + 59f75ec commit 193185b

File tree

694 files changed

+37471
-7793
lines changed

Some content is hidden

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

694 files changed

+37471
-7793
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
2424
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
2525
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
2626
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
27+
message(STATUS "AR tools: ${CMAKE_AR}")
28+
2729
if(WIN32)
2830
set(CMAKE_SUPPRESS_REGENERATION ON)
2931
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
@@ -62,6 +64,7 @@ option(WITH_DISTRIBUTE "Compile with distributed support" OFF)
6264
option(WITH_PSLIB "Compile with pslib support" OFF)
6365
option(WITH_CONTRIB "Compile the third-party contributation" OFF)
6466
option(REPLACE_ENFORCE_GLOG "Replace PADDLE_ENFORCE with glog/CHECK for better debug." OFF)
67+
# TODO(Superjomn) Remove WITH_ANAKIN option if not needed latter.
6568
option(WITH_ANAKIN "Compile with Anakin library" OFF)
6669
option(ANAKIN_BUILD_FAT_BIN "Build anakin cuda fat-bin lib for all device plantform, ignored when WITH_ANAKIN=OFF" OFF)
6770
option(ANAKIN_BUILD_CROSS_PLANTFORM "Build anakin lib for any nvidia device plantform. ignored when WITH_ANAKIN=OFF" ON)
@@ -188,7 +191,14 @@ include(configure) # add paddle env configuration
188191
if(WITH_GPU)
189192
include(cuda)
190193
include(tensorrt)
194+
include(anakin_subgraph)
195+
endif()
196+
197+
if(WITH_GPU AND NOT WIN32)
198+
message(STATUS "add dgc lib.")
199+
include(external/dgc)
191200
endif()
201+
192202
if(WITH_MKL OR WITH_MKLML)
193203
include(external/anakin)
194204
elseif()

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ python \
156156

157157
This will enable VLOG messages generated by `buddy_allocator.{h,cc}` and in the verbose range of 0 to 3, so you will see above example VLOG message, which is in level 3. This suggests that we output overall messages in lower verbose levels, so they display with higher probability. When coding C++, please follow the verbose level convention as follows:
158158

159-
- verbose level 1: [framework](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/framework)
160-
- verbose level 3: [operators](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/operators)
161-
- verbose level 5: [memory](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/memory), [platform](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/platform)
162-
- verbose level 7: [math](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/legacy/math)
159+
- verbose level 1: [framework](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/framework)
160+
- verbose level 3: [operators](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/operators)
161+
- verbose level 5: [memory](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/memory), [platform](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform)
162+
- verbose level 7: [math](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/operators/math/)

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ RUN curl -s -q https://glide.sh/get | sh
7575
# and its size is only one-third of the official one.
7676
# 2. Manually add ~IPluginFactory() in IPluginFactory class of NvInfer.h, otherwise, it couldn't work in paddle.
7777
# See https://github.com/PaddlePaddle/Paddle/issues/10129 for details.
78-
RUN wget -qO- http://paddlepaddledeps.cdn.bcebos.com/TensorRT-4.0.0.3.Ubuntu-16.04.4.x86_64-gnu.cuda-8.0.cudnn7.0.tar.gz | \
79-
tar -xz -C /usr/local && \
78+
79+
RUN wget -q https://paddlepaddledeps.cdn.bcebos.com/TensorRT-4.0.1.6-ubuntu14.04.x86_64-gnu.cuda.8.0.cudnn7.0.tar.gz --no-check-certificate && \
80+
tar -zxf TensorRT-4.0.1.6-ubuntu14.04.x86_64-gnu.cuda.8.0.cudnn7.0.tar.gz -C /usr/local && \
8081
cp -rf /usr/local/TensorRT/include /usr && \
8182
cp -rf /usr/local/TensorRT/lib /usr
8283

benchmark/fluid/fluid_benchmark.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ def train_parallel(train_args, test_args, args, train_prog, test_prog,
179179
else:
180180
build_strategy.reduce_strategy = fluid.BuildStrategy(
181181
).ReduceStrategy.AllReduce
182-
build_strategy.fuse_broadcast_op = args.fuse_broadcast_op
183182

184183
avg_loss = train_args[0]
185184

cmake/anakin_subgraph.cmake

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
if(NOT WITH_GPU)
2+
return()
3+
endif()
4+
5+
set(ANAKIN_ROOT "/usr" CACHE PATH "ANAKIN ROOT")
6+
find_path(ANAKIN_INCLUDE_DIR anakin_config.h
7+
PATHS ${ANAKIN_ROOT} ${ANAKIN_ROOT}/include
8+
$ENV{ANAKIN_ROOT} $ENV{ANAKIN_ROOT}/include
9+
NO_DEFAULT_PATH
10+
)
11+
12+
find_library(ANAKIN_LIBRARY NAMES libanakin_saber_common.so libanakin.so
13+
PATHS ${ANAKIN_ROOT}
14+
$ENV{ANAKIN_ROOT} $ENV{ANAKIN_ROOT}/lib
15+
NO_DEFAULT_PATH
16+
DOC "Path to ANAKIN library.")
17+
18+
if(ANAKIN_INCLUDE_DIR AND ANAKIN_LIBRARY)
19+
if(WITH_DSO)
20+
set(ANAKIN_FOUND ON)
21+
endif(WITH_DSO)
22+
else()
23+
set(ANAKIN_FOUND OFF)
24+
endif()
25+
26+
if(ANAKIN_FOUND)
27+
message(STATUS "Current ANAKIN header is ${ANAKIN_INCLUDE_DIR}/anakin_config.h. ")
28+
include_directories(${ANAKIN_ROOT}/include)
29+
include_directories(${ANAKIN_ROOT}/include/saber)
30+
link_directories(${ANAKIN_ROOT})
31+
add_definitions(-DPADDLE_WITH_ANAKIN)
32+
endif()

cmake/external/boost.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ set(BOOST_PROJECT "extern_boost")
2424
# So we use 1.41.0 here.
2525
set(BOOST_VER "1.41.0")
2626
set(BOOST_TAR "boost_1_41_0" CACHE STRING "" FORCE)
27-
set(BOOST_URL "http://paddlepaddledeps.cdn.bcebos.com/${BOOST_TAR}.tar.gz" CACHE STRING "" FORCE)
27+
set(BOOST_URL "http://paddlepaddledeps.bj.bcebos.com/${BOOST_TAR}.tar.gz" CACHE STRING "" FORCE)
2828

2929
MESSAGE(STATUS "BOOST_TAR: ${BOOST_TAR}, BOOST_URL: ${BOOST_URL}")
3030

cmake/external/dgc.cmake

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
INCLUDE(ExternalProject)
16+
17+
SET(DGC_SOURCES_DIR "${THIRD_PARTY_PATH}/dgc")
18+
SET(DGC_INSTALL_DIR "${THIRD_PARTY_PATH}/install/dgc")
19+
SET(DGC_INCLUDE_DIR "${DGC_INSTALL_DIR}/include" CACHE PATH "dgc include directory." FORCE)
20+
SET(DGC_LIBRARIES "${DGC_INSTALL_DIR}/lib/libdgc.a" CACHE FILEPATH "dgc library." FORCE)
21+
INCLUDE_DIRECTORIES(${DGC_INCLUDE_DIR})
22+
23+
ExternalProject_Add(
24+
extern_dgc
25+
${EXTERNAL_PROJECT_LOG_ARGS}
26+
GIT_REPOSITORY "https://github.com/PaddlePaddle/Fleet"
27+
GIT_TAG "2d04dc3800cdd0601f1b65d547dabcc60b0cf9dc"
28+
SOURCE_DIR "${DGC_SOURCES_DIR}"
29+
CONFIGURE_COMMAND ""
30+
BUILD_COMMAND cd collective && make -j
31+
INSTALL_COMMAND mkdir -p ${DGC_INSTALL_DIR}/lib/ ${DGC_INCLUDE_DIR}/dgc
32+
&& cp ${DGC_SOURCES_DIR}/collective/build/lib/libdgc.a ${DGC_LIBRARIES}
33+
&& cp ${DGC_SOURCES_DIR}/collective/build/include/dgc.h ${DGC_INCLUDE_DIR}/dgc/
34+
BUILD_IN_SOURCE 1
35+
)
36+
37+
ADD_LIBRARY(dgc SHARED IMPORTED GLOBAL)
38+
SET_PROPERTY(TARGET dgc PROPERTY IMPORTED_LOCATION ${DGC_LIBRARIES})
39+
ADD_DEPENDENCIES(dgc extern_dgc)
40+
41+
LIST(APPEND external_project_dependencies dgc)
42+

cmake/external/grpc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ExternalProject_Add(
4444
# 3. keep only zlib, cares, protobuf, boringssl under "third_party",
4545
# checkout and clean other dirs under third_party
4646
# 4. remove .git, and package the directory.
47-
URL "http://paddlepaddledeps.cdn.bcebos.com/grpc-v1.10.x.tar.gz"
47+
URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz"
4848
URL_MD5 "1f268a2aff6759839dccd256adcc91cf"
4949
PREFIX ${GRPC_SOURCES_DIR}
5050
UPDATE_COMMAND ""

cmake/external/mkldnn.cmake

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@ IF(APPLE)
3131
return()
3232
ENDIF()
3333

34-
MESSAGE(STATUS "Set ${MKLDNN_INSTALL_DIR}/lib to runtime path")
34+
# Introduce variables:
35+
# * CMAKE_INSTALL_LIBDIR
36+
INCLUDE(GNUInstallDirs)
37+
SET(LIBDIR "lib")
38+
if(CMAKE_INSTALL_LIBDIR MATCHES ".*lib64$")
39+
SET(LIBDIR "lib64")
40+
endif()
41+
42+
MESSAGE(STATUS "Set ${MKLDNN_INSTALL_DIR}/l${LIBDIR} to runtime path")
3543
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
36-
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLDNN_INSTALL_DIR}/lib")
44+
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLDNN_INSTALL_DIR}/${LIBDIR}")
3745

3846
INCLUDE_DIRECTORIES(${MKLDNN_INC_DIR}) # For MKLDNN code to include internal headers.
3947

@@ -58,7 +66,7 @@ ExternalProject_Add(
5866
${EXTERNAL_PROJECT_LOG_ARGS}
5967
DEPENDS ${MKLDNN_DEPENDS}
6068
GIT_REPOSITORY "https://github.com/intel/mkl-dnn.git"
61-
GIT_TAG "830a10059a018cd2634d94195140cf2d8790a75a"
69+
GIT_TAG "863ff6e7042cec7d2e29897fe9f0872e0888b0fc"
6270
PREFIX ${MKLDNN_SOURCES_DIR}
6371
UPDATE_COMMAND ""
6472
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@@ -79,9 +87,9 @@ ExternalProject_Add(
7987
-DMKLROOT:PATH=${MKLML_ROOT}
8088
)
8189
if(WIN32)
82-
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/lib/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
90+
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
8391
else(WIN32)
84-
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/lib/libmkldnn.so" CACHE FILEPATH "mkldnn library." FORCE)
92+
SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/libmkldnn.so" CACHE FILEPATH "mkldnn library." FORCE)
8593
endif(WIN32)
8694

8795
ADD_LIBRARY(shared_mkldnn SHARED IMPORTED GLOBAL)
@@ -101,7 +109,7 @@ ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT})
101109
# copy the real so.0 lib to install dir
102110
# it can be directly contained in wheel or capi
103111
if(WIN32)
104-
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/lib/mkldnn.dll)
112+
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/bin/mkldnn.dll)
105113
else(WIN32)
106114
SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/libmkldnn.so.0)
107115
ADD_CUSTOM_COMMAND(OUTPUT ${MKLDNN_SHARED_LIB}

cmake/external/mklml.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib")
3434
SET(TIME_VERSION "2019.0.1.20181227")
3535
IF(WIN32)
3636
SET(MKLML_VER "mklml_win_${TIME_VERSION}" CACHE STRING "" FORCE)
37-
SET(MKLML_URL "https://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE)
37+
SET(MKLML_URL "https://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE)
3838
SET(MKLML_LIB ${MKLML_LIB_DIR}/mklml.lib)
3939
SET(MKLML_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5md.lib)
4040
SET(MKLML_SHARED_LIB ${MKLML_LIB_DIR}/mklml.dll)
@@ -43,7 +43,7 @@ ELSE()
4343
#TODO(intel-huying):
4444
# Now enable Erf function in mklml library temporarily, it will be updated as offical version later.
4545
SET(MKLML_VER "Glibc225_vsErf_mklml_lnx_${TIME_VERSION}" CACHE STRING "" FORCE)
46-
SET(MKLML_URL "http://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.tgz" CACHE STRING "" FORCE)
46+
SET(MKLML_URL "http://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.tgz" CACHE STRING "" FORCE)
4747
SET(MKLML_LIB ${MKLML_LIB_DIR}/libmklml_intel.so)
4848
SET(MKLML_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5.so)
4949
SET(MKLML_SHARED_LIB ${MKLML_LIB_DIR}/libmklml_intel.so)

0 commit comments

Comments
 (0)