Skip to content

Commit bd4ec1b

Browse files
authored
Merge branch 'develop' into memory.set_input
2 parents 7d551dd + 9c7bed8 commit bd4ec1b

File tree

238 files changed

+13229
-1541
lines changed

Some content is hidden

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

238 files changed

+13229
-1541
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
sha: c25201a00e6b0514370501050cf2a8538ac12270
33
hooks:
44
- id: remove-crlf
5-
files: (?!.*third_party)^.*$
5+
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
66
- repo: https://github.com/reyoung/mirrors-yapf.git
77
sha: v0.13.2
88
hooks:
99
- id: yapf
10-
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ # Bazel BUILD files follow Python syntax.
10+
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
1212
sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469
1313
hooks:
1414
- id: check-added-large-files
1515
- id: check-merge-conflict
1616
- id: check-symlinks
1717
- id: detect-private-key
18-
files: (?!.*third_party)^.*$
18+
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
1919
- id: end-of-file-fixer
2020
- repo: https://github.com/PaddlePaddle/clang-format-pre-commit-hook.git
2121
sha: 28c0ea8a67a3e2dbbf4822ef44e85b63a0080a29

.travis.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@ sudo: required
88
dist: trusty
99
os:
1010
- linux
11-
- osx
1211
env:
1312
- JOB=DOCS
1413
- JOB=BUILD_AND_TEST
1514
- JOB=PRE_COMMIT
16-
matrix:
17-
exclude:
18-
- os: osx
19-
env: JOB=DOCS # Only generate documentation in linux.
20-
- os: osx
21-
env: JOB=PRE_COMMIT # Only check pre-commit hook in linux
2215

2316
addons:
2417
apt:
@@ -52,11 +45,10 @@ before_install:
5245
fi
5346
fi
5447
fi
55-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
5648
- if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
5749
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
5850
# protobuf version.
59-
- pip install numpy wheel 'protobuf==3.1' sphinx recommonmark sphinx_rtd_theme virtualenv pre-commit requests==2.9.2 LinkChecker
51+
- pip install numpy wheel 'protobuf==3.1' sphinx recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit requests==2.9.2 LinkChecker
6052
script:
6153
- paddle/scripts/travis/main.sh
6254
notifications:
Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,58 @@
1+
# A image for building paddle binaries
2+
# Use cuda devel base image for both cpu and gpu environment
13
FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
24
MAINTAINER PaddlePaddle Authors <[email protected]>
35

46
ARG DEBIAN_FRONTEND=noninteractive
57
ARG UBUNTU_MIRROR
6-
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
8+
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
9+
10+
# ENV variables
11+
ARG BUILD_WOBOQ
12+
ARG BUILD_AND_INSTALL
13+
ARG WITH_GPU
14+
ARG WITH_AVX
15+
ARG WITH_DOC
16+
ARG WITH_STYLE_CHECK
17+
18+
ENV BUILD_WOBOQ=${BUILD_WOBOQ:-OFF}
19+
ENV BUILD_AND_INSTALL=${BUILD_AND_INSTALL:-OFF}
20+
ENV WITH_GPU=${WITH_AVX:-OFF}
21+
ENV WITH_AVX=${WITH_AVX:-ON}
22+
ENV WITH_DOC=${WITH_DOC:-OFF}
23+
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
24+
25+
ENV HOME /root
26+
# Add bash enhancements
27+
COPY ./paddle/scripts/docker/root/ /root/
728

829
RUN apt-get update && \
930
apt-get install -y git python-pip python-dev openssh-server bison && \
1031
apt-get install -y wget unzip tar xz-utils bzip2 gzip coreutils && \
1132
apt-get install -y curl sed grep graphviz libjpeg-dev zlib1g-dev && \
1233
apt-get install -y python-numpy python-matplotlib gcc g++ gfortran && \
13-
apt-get install -y automake clang-3.8 llvm-3.8 libclang-3.8-dev && \
34+
apt-get install -y automake locales clang-format-3.8 && \
1435
apt-get clean -y
1536

37+
# git credential to skip password typing
38+
RUN git config --global credential.helper store
39+
40+
# Fix locales to en_US.UTF-8
41+
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
42+
1643
RUN pip install --upgrade pip && \
17-
pip install -U protobuf && \
44+
pip install -U 'protobuf==3.1.0' && \
1845
pip install -U wheel pillow BeautifulSoup && \
1946
pip install -U docopt PyYAML sphinx && \
20-
pip install -U sphinx_rtd_theme recommonmark jupyter
47+
pip install -U sphinx-rtd-theme==0.1.9 recommonmark && \
48+
pip install -U pre-commit 'requests==2.9.2' jupyter
2149

2250
RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
23-
cd cmake-3.4.1 && ./bootstrap && make -j4 && make install && \
51+
cd cmake-3.4.1 && ./bootstrap && make -j `nproc` && make install && \
2452
cd .. && rm -rf cmake-3.4.1
2553

26-
ARG BUILD_AND_INSTALL
27-
ARG WITH_AVX
28-
ARG WITH_DOC
29-
ARG WITH_STYLE_CHECK
54+
RUN apt-get install -y swig
3055

31-
ENV BUILD_AND_INSTALL=${BUILD_AND_INSTALL:-OFF}
32-
ENV WITH_GPU=ON
33-
ENV WITH_AVX=${WITH_AVX:-ON}
34-
ENV WITH_DOC=${WITH_DOC:-ON}
35-
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
36-
37-
RUN mkdir /paddle
38-
COPY . /paddle/
39-
RUN /paddle/paddle/scripts/docker/build.sh
4056
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
4157

4258
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
@@ -46,12 +62,5 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
4662
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
4763
EXPOSE 22
4864

49-
# Jupyter Notebook directory.
50-
RUN mkdir /notes/
51-
WORKDIR "/notes"
52-
EXPOSE 8888
53-
54-
RUN mkdir -p /opt/bin
55-
COPY ./paddle/scripts/docker/entrypoint /opt/bin/
56-
57-
CMD ["/opt/bin/entrypoint"]
65+
# development image default do build work
66+
CMD ["bash", "/paddle/paddle/scripts/docker/build.sh"]

authors

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ Luo, Tao
2929
Lyu, Qin
3030
Mao, Hongyue
3131
Qian, Xiaojun
32+
Qiao, Longfei
3233
Qi, Jun
3334
Qin, Duohao
3435
Shen, Guolong
3536
Shi, Guangchuan
3637
Song, Xiang
38+
Wang, Helin
3739
Wang, Jiang
3840
Wang, Yanfei
41+
Wang, Yi
3942
Wang, Yong
4043
Weng, Renliang
4144
Xu, Tianbing

cmake/FindSphinx.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function( Sphinx_add_target target_name builder conf cache source destination )
7272
${source}
7373
${destination}
7474
COMMENT "Generating sphinx documentation: ${builder}"
75-
COMMAND ln -sf ${destination}/index_*.html ${destination}/index.html
75+
COMMAND cd ${destination} && ln -s ./index_*.html index.html
7676
)
7777

7878
set_property(

cmake/cblas.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
set(CBLAS_FOUND OFF)
1717

1818
## Find MKL First.
19-
set(MKL_ROOT $ENV{MKLROOT} CACHE PATH "Folder contains MKL")
19+
set(INTEL_ROOT "/opt/intel" CACHE PATH "Folder contains intel libs")
20+
set(MKL_ROOT ${INTEL_ROOT}/mkl CACHE PATH "Folder contains MKL")
2021

2122
find_path(MKL_INCLUDE_DIR mkl.h PATHS
2223
${MKL_ROOT}/include)

cmake/ccache.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Use ccache if found ccache program
22

3-
find_program(CCACHE_FOUND ccache)
3+
find_program(CCACHE_PATH ccache)
44

5-
if(CCACHE_FOUND)
5+
if(CCACHE_PATH)
66
message(STATUS "Ccache is founded, use ccache to speed up compile.")
7-
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
8-
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
9-
endif(CCACHE_FOUND)
7+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH})
8+
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_PATH})
9+
endif(CCACHE_PATH)

cmake/coverallsGcovJsons.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,13 @@ endmacro()
110110

111111
# Get the coverage data.
112112
file(GLOB_RECURSE GCDA_FILES "${COV_PATH}" "*.gcda")
113-
message("GCDA files:")
113+
message("Process GCDA files:")
114+
message("===============================")
114115

115116
# Get a list of all the object directories needed by gcov
116117
# (The directories the .gcda files and .o files are found in)
117118
# and run gcov on those.
118119
foreach(GCDA ${GCDA_FILES})
119-
message("Process: ${GCDA}")
120-
message("------------------------------------------------------------------------------")
121120
get_filename_component(GCDA_DIR ${GCDA} PATH)
122121

123122
#
@@ -135,7 +134,7 @@ foreach(GCDA ${GCDA_FILES})
135134
# If -p is not specified then the file is named only "the_file.c.gcov"
136135
#
137136
execute_process(
138-
COMMAND ${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA}
137+
COMMAND "${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA} >/dev/null"
139138
WORKING_DIRECTORY ${GCDA_DIR}
140139
)
141140
endforeach()
@@ -383,7 +382,6 @@ foreach(NOT_COVERED_SRC ${COVERAGE_SRCS_REMAINING})
383382
set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}]")
384383

385384
# Generate the final JSON for this file.
386-
message("Generate JSON for non-gcov file: ${NOT_COVERED_SRC}...")
387385
string(CONFIGURE ${SRC_FILE_TEMPLATE} FILE_JSON)
388386
set(JSON_GCOV_FILES "${JSON_GCOV_FILES}${FILE_JSON}, ")
389387
endforeach()

cmake/external/protobuf.cmake

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,58 @@
1414

1515
INCLUDE(ExternalProject)
1616

17-
SET(PROTOBUF_SOURCES_DIR ${THIRD_PARTY_PATH}/protobuf)
18-
SET(PROTOBUF_INSTALL_DIR ${THIRD_PARTY_PATH}/install/protobuf)
19-
SET(PROTOBUF_INCLUDE_DIR "${PROTOBUF_INSTALL_DIR}/include" CACHE PATH "protobuf include directory." FORCE)
17+
FIND_PACKAGE(Protobuf 3.1)
2018

21-
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})
19+
IF(PROTOBUF_FOUND)
20+
EXEC_PROGRAM(${PROTOBUF_PROTOC_EXECUTABLE} ARGS --version OUTPUT_VARIABLE PROTOBUF_VERSION)
21+
STRING(REGEX MATCH "[0-9]+.[0-9]+" PROTOBUF_VERSION "${PROTOBUF_VERSION}")
22+
IF (${PROTOBUF_VERSION} VERSION_LESS "3.1.0")
23+
SET(PROTOBUF_FOUND OFF)
24+
ENDIF()
25+
ENDIF(PROTOBUF_FOUND)
26+
27+
IF(NOT PROTOBUF_FOUND)
28+
SET(PROTOBUF_SOURCES_DIR ${THIRD_PARTY_PATH}/protobuf)
29+
SET(PROTOBUF_INSTALL_DIR ${THIRD_PARTY_PATH}/install/protobuf)
30+
SET(PROTOBUF_INCLUDE_DIR "${PROTOBUF_INSTALL_DIR}/include" CACHE PATH "protobuf include directory." FORCE)
31+
32+
IF(WIN32)
33+
SET(PROTOBUF_LITE_LIBRARY
34+
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf-lite.lib" CACHE FILEPATH "protobuf lite library." FORCE)
35+
SET(PROTOBUF_LIBRARY
36+
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf.lib" CACHE FILEPATH "protobuf library." FORCE)
37+
SET(PROTOBUF_PROTOC_LIBRARY
38+
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.lib" CACHE FILEPATH "protoc library." FORCE)
39+
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc.exe" CACHE FILEPATH "protobuf executable." FORCE)
40+
ELSE(WIN32)
41+
SET(PROTOBUF_LITE_LIBRARY
42+
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf-lite.a" CACHE FILEPATH "protobuf lite library." FORCE)
43+
SET(PROTOBUF_LIBRARY
44+
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf.a" CACHE FILEPATH "protobuf library." FORCE)
45+
SET(PROTOBUF_PROTOC_LIBRARY
46+
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.a" CACHE FILEPATH "protoc library." FORCE)
47+
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc" CACHE FILEPATH "protobuf executable." FORCE)
48+
ENDIF(WIN32)
2249

23-
IF(WIN32)
24-
SET(PROTOBUF_LITE_LIBRARY
25-
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf-lite.lib" CACHE FILEPATH "protobuf lite library." FORCE)
26-
SET(PROTOBUF_LIBRARY
27-
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf.lib" CACHE FILEPATH "protobuf library." FORCE)
28-
SET(PROTOBUF_PROTOC_LIBRARY
29-
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.lib" CACHE FILEPATH "protoc library." FORCE)
30-
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc.exe" CACHE FILEPATH "protobuf executable." FORCE)
31-
ELSE(WIN32)
32-
SET(PROTOBUF_LITE_LIBRARY
33-
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf-lite.a" CACHE FILEPATH "protobuf lite library." FORCE)
34-
SET(PROTOBUF_LIBRARY
35-
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf.a" CACHE FILEPATH "protobuf library." FORCE)
36-
SET(PROTOBUF_PROTOC_LIBRARY
37-
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.a" CACHE FILEPATH "protoc library." FORCE)
38-
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc" CACHE FILEPATH "protobuf executable." FORCE)
39-
ENDIF(WIN32)
40-
41-
ExternalProject_Add(
42-
protobuf
43-
${EXTERNAL_PROJECT_LOG_ARGS}
44-
PREFIX ${PROTOBUF_SOURCES_DIR}
45-
UPDATE_COMMAND ""
46-
DEPENDS zlib
47-
GIT_REPOSITORY "https://github.com/google/protobuf.git"
48-
GIT_TAG "9f75c5aa851cd877fb0d93ccc31b8567a6706546"
49-
CONFIGURE_COMMAND
50-
${CMAKE_COMMAND} ${PROTOBUF_SOURCES_DIR}/src/protobuf/cmake
51-
-Dprotobuf_BUILD_TESTS=OFF
52-
-DZLIB_ROOT:FILEPATH=${ZLIB_ROOT}
53-
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
54-
-DCMAKE_BUILD_TYPE=Release
55-
-DCMAKE_INSTALL_PREFIX=${PROTOBUF_INSTALL_DIR}
56-
-DCMAKE_INSTALL_LIBDIR=lib
57-
)
58-
59-
LIST(APPEND external_project_dependencies protobuf)
50+
ExternalProject_Add(
51+
protobuf
52+
${EXTERNAL_PROJECT_LOG_ARGS}
53+
PREFIX ${PROTOBUF_SOURCES_DIR}
54+
UPDATE_COMMAND ""
55+
DEPENDS zlib
56+
GIT_REPOSITORY "https://github.com/google/protobuf.git"
57+
GIT_TAG "9f75c5aa851cd877fb0d93ccc31b8567a6706546"
58+
CONFIGURE_COMMAND
59+
${CMAKE_COMMAND} ${PROTOBUF_SOURCES_DIR}/src/protobuf/cmake
60+
-Dprotobuf_BUILD_TESTS=OFF
61+
-DZLIB_ROOT:FILEPATH=${ZLIB_ROOT}
62+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
63+
-DCMAKE_BUILD_TYPE=Release
64+
-DCMAKE_INSTALL_PREFIX=${PROTOBUF_INSTALL_DIR}
65+
-DCMAKE_INSTALL_LIBDIR=lib
66+
)
67+
68+
LIST(APPEND external_project_dependencies protobuf)
69+
ENDIF(NOT PROTOBUF_FOUND)
70+
71+
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})

cmake/external/python.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,3 @@ ENDIF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
221221

222222
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
223223
INCLUDE_DIRECTORIES(${PYTHON_NUMPY_INCLUDE_DIR})
224-
225-
MESSAGE("[Paddle] Python Executable: ${PYTHON_EXECUTABLE}")
226-
MESSAGE("[Paddle] Python Include: ${PYTHON_INCLUDE_DIRS}")
227-
MESSAGE("[Paddle] Python Libraries: ${PYTHON_LIBRARIES}")

0 commit comments

Comments
 (0)