Skip to content

Commit 04b8d3d

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into paddle_fix
2 parents 0fec946 + 145aaa4 commit 04b8d3d

File tree

1,101 files changed

+28901
-12445
lines changed

Some content is hidden

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

1,101 files changed

+28901
-12445
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BasedOnStyle: Google
1919
IndentWidth: 2
2020
TabWidth: 2
2121
ContinuationIndentWidth: 4
22-
AccessModifierOffset: -2 # The private/protected/public has no indent in class
22+
AccessModifierOffset: -1 # The private/protected/public has no indent in class
2323
Standard: Cpp11
2424
AllowAllParametersOfDeclarationOnNextLine: true
2525
BinPackParameters: false

.copyright.hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import subprocess
99
import platform
1010

1111
COPYRIGHT = '''
12-
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
12+
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
1313

1414
Licensed under the Apache License, Version 2.0 (the "License");
1515
you may not use this file except in compliance with the License.

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ repos:
3434
entry: bash ./tools/codestyle/cpplint_pre_commit.hook
3535
language: system
3636
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
37+
- repo: local
38+
hooks:
39+
- id: pylint-doc-string
40+
name: pylint
41+
description: Check python docstring style using docstring_checker.
42+
entry: bash ./tools/codestyle/pylint_pre_commit.hook
43+
language: system
44+
files: \.(py)$
3745
- repo: https://github.com/PaddlePaddle/pre-commit-golang
3846
sha: 8337620115c25ff8333f1b1a493bd031049bd7c0
3947
hooks:

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env:
1818
addons:
1919
ssh_known_hosts: 13.229.163.131
2020
before_install:
21+
# For pylint dockstring checker
22+
- sudo pip install pylint pytest astroid isort
2123
- |
2224
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
2325
script:

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| backyes | Yan-Fei Wang |
55
| baiyfbupt | Yi-Fan Bai |
66
| beckett1124 | Bin Qi |
7+
| ChengduoZH | Cheng-Duo Zhao|
78
| chengxiaohua1105 | Xiao-Hua Cheng |
89
| cxwangyi, yiwangbaidu, wangkuiyi | Yi Wang |
910
| cxysteven | Xing-Yi Cheng |

CMakeLists.txt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
2525
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
2626
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
2727

28-
find_package(Sphinx)
2928
if(NOT CMAKE_CROSSCOMPILING)
3029
find_package(CUDA QUIET)
3130
endif(NOT CMAKE_CROSSCOMPILING)
@@ -42,7 +41,6 @@ option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FO
4241
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
4342
option(WITH_TESTING "Compile PaddlePaddle with unit testing" OFF)
4443
option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)
45-
option(WITH_STYLE_CHECK "Compile PaddlePaddle with style check" ON)
4644
option(WITH_PYTHON "Compile PaddlePaddle with python interpreter" ON)
4745
option(WITH_DOUBLE "Compile PaddlePaddle with double precision" OFF)
4846
option(WITH_RDMA "Compile PaddlePaddle with RDMA support" OFF)
@@ -59,8 +57,10 @@ option(GLIDE_INSTALL "Download and install go dependencies " ON)
5957
option(USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF)
6058
option(WITH_DISTRIBUTE "Compile with grpc distributed support" OFF)
6159
option(USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF)
60+
option(EIGEN_USE_THREADS "Compile with multi-threaded Eigen" OFF)
6261
option(WITH_ARM_FP16 "Use half precision support on armv8.2-a cpu" OFF)
6362
option(WITH_FAST_BUNDLE_TEST "Bundle tests that can be run in a single process together to reduce launch overhead" OFF)
63+
option(WITH_CONTRIB "Compile the third-party contributation" OFF)
6464

6565
# CMAKE_BUILD_TYPE
6666
if(NOT CMAKE_BUILD_TYPE)
@@ -101,6 +101,9 @@ endif()
101101
set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
102102
"A path setting third party libraries download & build directories.")
103103

104+
set(FLUID_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_install_dir" CACHE STRING
105+
"A path setting fluid shared and static libraries")
106+
104107
if (WITH_C_API AND WITH_PYTHON)
105108
message(WARNING "It is suggest not embedded a python interpreter in Paddle "
106109
"when using C-API. It will give an unpredictable behavior when using a "
@@ -118,13 +121,14 @@ else()
118121
endif()
119122

120123
set(WITH_MKLML ${WITH_MKL})
121-
if (WITH_MKL AND AVX2_FOUND)
122-
set(WITH_MKLDNN ON)
123-
else()
124-
message(STATUS "Do not have AVX2 intrinsics and disabled MKL-DNN")
125-
set(WITH_MKLDNN OFF)
124+
if (NOT DEFINED WITH_MKLDNN)
125+
if (WITH_MKL AND AVX2_FOUND)
126+
set(WITH_MKLDNN ON)
127+
else()
128+
message(STATUS "Do not have AVX2 intrinsics and disabled MKL-DNN")
129+
set(WITH_MKLDNN OFF)
130+
endif()
126131
endif()
127-
128132
########################################################################################
129133

130134
include(external/mklml) # download mklml package
@@ -153,7 +157,6 @@ include(cupti)
153157
include(configure) # add paddle env configuration
154158
include(generic) # simplify cmake module
155159
include(package) # set paddle packages
156-
include(cpplint) # set paddle c++ style
157160
include(ccache) # set ccache for compilation
158161
include(util) # set unittest and link libs
159162
include(rdma) # set rdma libraries
@@ -202,7 +205,7 @@ endif(USE_NNPACK)
202205

203206
add_subdirectory(proto)
204207

205-
if(NOT MOBILE_INFERENCE)
208+
if(NOT MOBILE_INFERENCE AND NOT WITH_FLUID_ONLY)
206209
# "add_subdirectory(go)" should be placed after the following loine,
207210
# because it depends on paddle/optimizer.
208211
add_subdirectory(paddle/optimizer)
@@ -226,5 +229,11 @@ if(WITH_PYTHON)
226229
endif()
227230

228231
if(WITH_DOC)
232+
find_package(Sphinx REQUIRED)
233+
find_python_module(recommonmark REQUIRED)
229234
add_subdirectory(doc)
230235
endif()
236+
237+
if (WITH_CONTRIB)
238+
add_subdirectory(paddle/contrib)
239+
endif()

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ PaddlePaddle uses this [Git branching model](http://nvie.com/posts/a-successful-
5858
create mode 100644 233
5959
```
6060

61+
NOTE: The `yapf` installed by `pip install pre-commit` and `conda install -c conda-forge pre-commit` is slightly different. Paddle developers use `pip install pre-commit`.
62+
6163
1. Build and test
6264

6365
Users can build PaddlePaddle natively on Linux and Mac OS X. But to unify the building environment and to make it easy for debugging, the recommended way is [using Docker](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/howto/dev/build_en.md).

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ COPY ./paddle/scripts/docker/root/ /root/
2424

2525
RUN apt-get update && \
2626
apt-get install -y --allow-downgrades \
27-
git python-pip python-dev openssh-server bison \
27+
git python-pip python-dev python-opencv openssh-server bison \
2828
libnccl2=2.1.2-1+cuda8.0 libnccl-dev=2.1.2-1+cuda8.0 \
2929
wget unzip unrar tar xz-utils bzip2 gzip coreutils ntp \
3030
curl sed grep graphviz libjpeg-dev zlib1g-dev \
3131
python-matplotlib gcc-4.8 g++-4.8 \
32-
automake locales clang-format swig doxygen cmake \
32+
automake locales clang-format swig cmake \
3333
liblapack-dev liblapacke-dev \
3434
clang-3.8 llvm-3.8 libclang-3.8-dev \
3535
net-tools libtool ccache && \
@@ -70,14 +70,16 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
7070
# specify sphinx version as 1.5.6 and remove -U option for [pip install -U
7171
# sphinx-rtd-theme] since -U option will cause sphinx being updated to newest
7272
# version(1.7.1 for now), which causes building documentation failed.
73-
RUN pip install --upgrade pip==9.0.3 && \
73+
RUN easy_install -U pip && \
7474
pip install -U wheel && \
7575
pip install -U docopt PyYAML sphinx==1.5.6 && \
7676
pip install sphinx-rtd-theme==0.1.9 recommonmark
7777

7878
RUN pip install pre-commit 'ipython==5.3.0' && \
79-
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
80-
pip install opencv-python
79+
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0'
80+
81+
#For docstring checker
82+
RUN pip install pylint pytest astroid isort
8183

8284
COPY ./python/requirements.txt /root/
8385
RUN pip install -r /root/requirements.txt
@@ -101,6 +103,3 @@ RUN echo 'root:root' | chpasswd
101103
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
102104
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
103105
EXPOSE 22
104-
105-
# development image default do build work
106-
CMD ["bash", "/paddle/paddle/scripts/docker/build.sh"]

Dockerfile.android

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ RUN mkdir -p ${ANDROID_TOOLCHAINS_DIR} && \
4040
unzip -q android-ndk-r14b-linux-x86_64.zip && \
4141
mv android-ndk-r14b ${ANDROID_NDK_HOME} && \
4242
rm -rf /opt/android-ndk-tmp
43-
44-
CMD ["bash", "/paddle/paddle/scripts/docker/build_android.sh"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddl
6262
## Installation
6363

6464
It is recommended to check out the
65-
[Docker installation guide](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/build_and_install/docker_install_en.html)
65+
[Docker installation guide](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/build_and_install/docker_install_en.html)
6666
before looking into the
67-
[build from source guide](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/build_and_install/build_from_source_en.html).
67+
[build from source guide](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/build_and_install/build_from_source_en.html).
6868

6969
## Documentation
7070

0 commit comments

Comments
 (0)