Skip to content

Commit 06c7686

Browse files
author
ranqiu
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into attention
2 parents 7461b35 + 374e168 commit 06c7686

File tree

813 files changed

+47319
-9413
lines changed

Some content is hidden

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

813 files changed

+47319
-9413
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ third_party/
2121
cmake-build-*
2222

2323
# generated while compiling
24-
python/paddle/v2/framework/core.so
24+
python/paddle/v2/fluid/core.so
2525
paddle/pybind/pybind.h
2626
CMakeFiles
2727
cmake_install.cmake
2828
paddle/.timestamp
2929
python/paddlepaddle.egg-info/
3030
paddle/pybind/pybind.h
31+
python/paddle/v2/framework/tests/tmp/*

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ addons:
3030
- automake
3131
- libtool
3232
- ccache
33+
ssh_known_hosts: 52.76.173.135
3334
before_install:
3435
- if [[ "$JOB" == "check_style" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
3536
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
@@ -42,6 +43,14 @@ script:
4243
- |
4344
timeout 2580 paddle/scripts/travis/${JOB}.sh # 43min timeout
4445
RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true; else false; fi;
46+
- |
47+
if [[ "$JOB" != "build_doc" ]]; then exit 0; fi;
48+
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
49+
if [[ "$TRAVIS_BRANCH" != "develop" && ! "$TRAVIS_BRANCH" =~ ^v[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then exit 0; fi;
50+
export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/master/scripts/deploy/deploy_docs.sh
51+
export DOCS_DIR=`pwd`
52+
cd ..
53+
curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $DOCS_DIR $DOCS_DIR/build/doc
4554
notifications:
4655
email:
4756
on_success: change

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ include(external/swig) # download, build, install swig
126126
include(external/warpctc) # download, build, install warpctc
127127
include(external/any) # download libn::any
128128
include(external/eigen) # download eigen3
129-
include(external/pybind11) # download pybind11
129+
include(external/pybind11) # download pybind11
130+
include(external/nccl)
130131

131132
include(cudnn) # set cudnn libraries, must before configure
132133
include(configure) # add paddle env configuration
@@ -159,7 +160,7 @@ set(EXTERNAL_LIBS
159160
if(WITH_GPU)
160161
list(APPEND EXTERNAL_LIBS ${CUDA_LIBRARIES} ${CUDA_rt_LIBRARY})
161162
if(NOT WITH_DSO)
162-
list(APPEND EXTERNAL_LIBS ${CUDNN_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY})
163+
list(APPEND EXTERNAL_LIBS ${CUDNN_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY} ${NCCL_LIBRARY})
163164
endif(NOT WITH_DSO)
164165
endif(WITH_GPU)
165166

CONTRIBUTING.md

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,157 @@
1-
./doc/howto/dev/contribute_to_paddle_en.md
1+
# Contribute Code
2+
3+
We sincerely appreciate your contribution. This document explains our workflow and work style.
4+
5+
## Workflow
6+
7+
PaddlePaddle uses this [Git branching model](http://nvie.com/posts/a-successful-git-branching-model/). The following steps guide usual contributions.
8+
9+
1. Fork
10+
11+
Our development community has been growing fastly; it doesn't make sense for everyone to write into the official repo. So, please file Pull Requests from your fork. To make a fork, just head over to the GitHub page and click the ["Fork" button](https://help.github.com/articles/fork-a-repo/).
12+
13+
1. Clone
14+
15+
To make a copy of your fork to your local computers, please run
16+
17+
```bash
18+
git clone https://github.com/your-github-account/paddle
19+
cd paddle
20+
```
21+
22+
1. Create the local feature branch
23+
24+
For daily works like adding a new feature or fixing a bug, please open your feature branch before coding:
25+
26+
```bash
27+
git checkout -b my-cool-stuff
28+
```
29+
30+
1. Commit
31+
32+
Before issuing your first `git commit` command, please install [`pre-commit`](http://pre-commit.com/) by running the following commands:
33+
34+
```bash
35+
pip install pre-commit
36+
pre-commit install
37+
```
38+
39+
Our pre-commit configuration requires clang-format 3.8 for auto-formating C/C++ code and yapf for Python.
40+
41+
Once installed, `pre-commit` checks the style of code and documentation in every commit. We will see something like the following when you run `git commit`:
42+
43+
```
44+
➜ git commit
45+
CRLF end-lines remover...............................(no files to check)Skipped
46+
yapf.................................................(no files to check)Skipped
47+
Check for added large files..............................................Passed
48+
Check for merge conflicts................................................Passed
49+
Check for broken symlinks................................................Passed
50+
Detect Private Key...................................(no files to check)Skipped
51+
Fix End of Files.....................................(no files to check)Skipped
52+
clang-formater.......................................(no files to check)Skipped
53+
[my-cool-stuff c703c041] add test file
54+
1 file changed, 0 insertions(+), 0 deletions(-)
55+
create mode 100644 233
56+
```
57+
58+
1. Build and test
59+
60+
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).
61+
62+
1. Keep pulling
63+
64+
An experienced Git user pulls from the official repo often -- daily or even hourly, so they notice conflicts with others work early, and it's easier to resolve smaller conflicts.
65+
66+
```bash
67+
git remote add upstream https://github.com/PaddlePaddle/Paddle
68+
git pull upstream develop
69+
```
70+
71+
1. Push and file a pull request
72+
73+
You can "push" your local work into your forked repo:
74+
75+
```bash
76+
git push origin my-cool-stuff
77+
```
78+
79+
The push allows you to create a pull request, requesting owners of this [official repo](https://github.com/PaddlePaddle/Paddle) to pull your change into the official one.
80+
81+
To create a pull request, please follow [these steps](https://help.github.com/articles/creating-a-pull-request/).
82+
83+
If your change is for fixing an issue, please write ["Fixes <issue-URL>"](https://help.github.com/articles/closing-issues-using-keywords/) in the description section of your pull request. Github would close the issue when the owners merge your pull request.
84+
85+
Please remember to specify some reviewers for your pull request. If you don't know who are the right ones, please follow Github's recommendation.
86+
87+
88+
1. Delete local and remote branches
89+
90+
To keep your local workspace and your fork clean, you might want to remove merged branches:
91+
92+
```bash
93+
git push origin :my-cool-stuff
94+
git checkout develop
95+
git pull upstream develop
96+
git branch -d my-cool-stuff
97+
```
98+
99+
### Code Review
100+
101+
- Please feel free to ping your reviewers by sending them the URL of your pull request via IM or email. Please do this after your pull request passes the CI.
102+
103+
- Please answer reviewers' every comment. If you are to follow the comment, please write "Done"; please give a reason otherwise.
104+
105+
- If you don't want your reviewers to get overwhelmed by email notifications, you might reply their comments by [in a batch](https://help.github.com/articles/reviewing-proposed-changes-in-a-pull-request/).
106+
107+
- Reduce the unnecessary commits. Some developers commit often. It is recommended to append a sequence of small changes into one commit by running `git commit --amend` instead of `git commit`.
108+
109+
110+
## Coding Standard
111+
112+
### Code Style
113+
114+
Our C/C++ code follows the [Google style guide](http://google.github.io/styleguide/cppguide.html).
115+
116+
Our Python code follows the [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/).
117+
118+
Our build process helps to check the code style. In [`build.sh`](https://github.com/PaddlePaddle/Paddle/blob/b84e8226514b8bb4405c3c28e54aa5077193d179/paddle/scripts/docker/build.sh#L42), the entry point of our [builder Docker image](https://github.com/PaddlePaddle/Paddle/blob/b84e8226514b8bb4405c3c28e54aa5077193d179/Dockerfile#L88), the CMake argument `WITH_STYLE_CHECK` is set to `ON` by default. This flag is on
119+
120+
Please install pre-commit, which automatically reformat the changes to C/C++ and Python code whenever we run `git commit`. To check the whole codebase, we can run the command `pre-commit run -a`, as in the [`check_style.sh` file](https://github.com/PaddlePaddle/Paddle/blob/b84e8226514b8bb4405c3c28e54aa5077193d179/paddle/scripts/travis/check_style.sh#L30), which is invoked by [our Travis CI configuration](https://github.com/PaddlePaddle/Paddle/blob/b84e8226514b8bb4405c3c28e54aa5077193d179/.travis.yml#L43).
121+
122+
### Unit Tests
123+
124+
Please remember to add related unit tests.
125+
126+
- For C/C++ code, please follow [`google-test` Primer](https://github.com/google/googletest/blob/master/googletest/docs/Primer.md).
127+
128+
- For Python code, please use [Python's standard `unittest` package](http://pythontesting.net/framework/unittest/unittest-introduction/).
129+
130+
131+
### Writing Logs
132+
133+
We use [glog](https://github.com/google/glog) for logging in our C/C++ code.
134+
135+
For general information, please use `LOG`. For debug information, please use [`VLOG`](http://htmlpreview.github.io/?https://github.com/google/glog/blob/master/doc/glog.html#verbose). The reason is at [here](https://groups.google.com/a/chromium.org/d/msg/chromium-dev/3NDNd1KzXeY/AZKMMx37fdQJ).
136+
137+
`VLOG` requires a *verbose level* parameter. For example:
138+
139+
```c++
140+
VLOG(3) << "Operator FC is taking " << num_inputs << "inputs."
141+
```
142+
143+
When we run a PaddlePaddle application or test, we can specify a verbose threshold. For example:
144+
145+
```bash
146+
GLOG_vmodule=buddy_allocator=2 \
147+
GLOG_v=10 \
148+
python \
149+
../python/paddle/v2/framework/tests/test_recurrent_op.py
150+
```
151+
152+
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:
153+
154+
- verbose level 1: [framework](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/framework)
155+
- verbose level 3: [operators](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/operators)
156+
- verbose level 5: [memory](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/memory), [platform](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/platform)
157+
- verbose level 7: [math](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/math)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY ./paddle/scripts/docker/root/ /root/
2222

2323
RUN apt-get update && \
2424
apt-get install -y \
25-
git python-pip python-dev openssh-server bison \
25+
git python-pip python-dev openssh-server bison libnccl-dev \
2626
wget unzip unrar tar xz-utils bzip2 gzip coreutils ntp \
2727
curl sed grep graphviz libjpeg-dev zlib1g-dev \
2828
python-matplotlib gcc-4.8 g++-4.8 \

benchmark/IntelOptimizedPaddle.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Benchmark
2+
3+
Machine:
4+
5+
- Server
6+
- Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz, 2 Sockets, 20 Cores per socket
7+
- Laptop
8+
- DELL XPS15-9560-R1745: i7-7700HQ 8G 256GSSD
9+
- i5 MacBook Pro (Retina, 13-inch, Early 2015)
10+
- Desktop
11+
- i7-6700k
12+
13+
System: CentOS release 6.3 (Final), Docker 1.12.1.
14+
15+
PaddlePaddle: paddlepaddle/paddle:latest (TODO: will rerun after 0.11.0)
16+
17+
- MKL-DNN tag v0.10
18+
- MKLML 2018.0.20170720
19+
- OpenBLAS v0.2.20
20+
21+
On each machine, we will test and compare the performance of training on single node using MKL-DNN / MKLML / OpenBLAS respectively.
22+
23+
## Benchmark Model
24+
25+
### Server
26+
Test on batch size 64, 128, 256 on Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
27+
28+
Input image size - 3 * 224 * 224, Time: images/second
29+
30+
- VGG-19
31+
32+
| BatchSize | 64 | 128 | 256 |
33+
|--------------|-------| -----| --------|
34+
| OpenBLAS | 7.82 | 8.62 | 10.34 |
35+
| MKLML | 11.02 | 12.86 | 15.33 |
36+
| MKL-DNN | 27.69 | 28.8 | 29.27 |
37+
38+
39+
chart on batch size 128
40+
TBD
41+
42+
- ResNet
43+
- GoogLeNet
44+
45+
### Laptop
46+
TBD
47+
### Desktop
48+
TBD

0 commit comments

Comments
 (0)