Skip to content

Commit 671db8d

Browse files
committed
Merge branch 'develop' of https://github.com/baidu/Paddle into tensor_merge
2 parents a1d1565 + f93af82 commit 671db8d

File tree

933 files changed

+46997
-22659
lines changed

Some content is hidden

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

933 files changed

+46997
-22659
lines changed

.clang-format

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
# The document of clang-format is
1414
# http://clang.llvm.org/docs/ClangFormat.html
1515
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
16-
#
17-
# TODO(yuyang18): Add python and other language code style
1816
---
1917
Language: Cpp
2018
BasedOnStyle: Google
2119
IndentWidth: 2
2220
TabWidth: 2
2321
ContinuationIndentWidth: 4
2422
AccessModifierOffset: -2 # The private/protected/public has no indent in class
25-
PointerAlignment: Left # int* p/int& p, not int *p/int &p
2623
Standard: Cpp11
2724
AllowAllParametersOfDeclarationOnNextLine: true
25+
BinPackParameters: false
26+
BinPackArguments: false
2827
...
2928

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.gitignore

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ build/
55
.vscode
66
.idea
77
.project
8+
.cproject
89
.pydevproject
10+
Makefile
11+
.test_env/

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
2+
sha: c25201a00e6b0514370501050cf2a8538ac12270
3+
hooks:
4+
- id: remove-crlf
5+
- repo: https://github.com/reyoung/mirrors-yapf.git
6+
sha: v0.13.2
7+
hooks:
8+
- id: yapf
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469
11+
hooks:
12+
- id: check-added-large-files
13+
- id: check-merge-conflict
14+
- id: check-symlinks
15+
- id: detect-private-key
16+
- id: end-of-file-fixer
17+
- repo: https://github.com/PaddlePaddle/clang-format-pre-commit-hook.git
18+
sha: 28c0ea8a67a3e2dbbf4822ef44e85b63a0080a29
19+
hooks:
20+
- id: clang-formater

.style.yapf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[style]
2+
based_on_style = pep8
3+
column_limit = 80

.travis.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,22 @@ addons:
3535
- libgoogle-glog-dev
3636
- libgflags-dev
3737
- libgtest-dev
38+
- curl
39+
- lcov
3840
- graphviz
41+
- swig
3942
before_install:
43+
- |
44+
if [ ${JOB} == "BUILD_AND_TEST" ]; then
45+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
46+
then
47+
echo "Only markdown docs were updated, stopping build process."
48+
exit
49+
fi
50+
fi
4051
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
4152
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
42-
- pip install wheel protobuf sphinx breathe recommonmark
53+
- pip install wheel protobuf sphinx breathe recommonmark virtualenv numpy sphinx_rtd_theme
4354
script:
4455
- paddle/scripts/travis/main.sh
4556
notifications:

CMakeLists.txt

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
cmake_minimum_required(VERSION 2.8)
22

33
project(paddle CXX C)
4-
set(PADDLE_MAJOR_VERSION 0)
5-
set(PADDLE_MINOR_VERSION 8)
6-
set(PADDLE_PATCH_VERSION 0b2)
7-
set(PADDLE_VERSION ${PADDLE_MAJOR_VERSION}.${PADDLE_MINOR_VERSION}.${PADDLE_PATCH_VERSION})
84

95
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
106
set(PROJ_ROOT ${CMAKE_SOURCE_DIR})
117
include(package)
12-
include(swig)
8+
find_package(SWIG 2.0)
139
find_package(CUDA QUIET)
1410
find_package(Protobuf REQUIRED)
11+
12+
# Check protobuf library version.
13+
execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version
14+
OUTPUT_VARIABLE PROTOBUF_VERSION)
15+
string(REPLACE "libprotoc " "" PROTOBUF_VERSION ${PROTOBUF_VERSION})
16+
17+
set(PROTOBUF_3 OFF)
18+
if (${PROTOBUF_VERSION} VERSION_GREATER "3.0.0" OR ${PROTOBUF_VERSION} VERSION_EQUAL "3.0.0")
19+
set(PROTOBUF_3 ON)
20+
endif()
21+
1522
find_package(PythonLibs 2.7 REQUIRED)
1623
find_package(PythonInterp 2.7 REQUIRED)
1724
find_package(ZLIB REQUIRED)
@@ -36,50 +43,39 @@ option(WITH_RDMA "Compile PaddlePaddle with rdma support" OFF)
3643
option(WITH_GLOG "Compile PaddlePaddle use glog, otherwise use a log implement internally" ${LIBGLOG_FOUND})
3744
option(WITH_GFLAGS "Compile PaddlePaddle use gflags, otherwise use a flag implement internally" ${GFLAGS_FOUND})
3845
option(WITH_TIMER "Compile PaddlePaddle use timer" OFF)
46+
option(WITH_PROFILER "Compile PaddlePaddle use gpu profiler" OFF)
3947
option(WITH_TESTING "Compile and run unittest for PaddlePaddle" ${GTEST_FOUND})
4048
option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
4149
option(WITH_SWIG_PY "Compile PaddlePaddle with py PaddlePaddle prediction api" ${SWIG_FOUND})
4250
option(ON_TRAVIS "Running test on travis-ci or not." OFF)
51+
option(ON_COVERALLS "Generating code coverage data on coveralls or not." OFF)
52+
option(COVERALLS_UPLOAD "Uploading the generated coveralls json." ON)
53+
4354
if(NOT CMAKE_BUILD_TYPE)
44-
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
55+
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
4556
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
4657
FORCE)
4758
endif()
4859

4960
include(enableCXX11)
5061
include(cpplint)
5162
include(ccache)
63+
if(WITH_RDMA)
64+
include(rdma)
65+
endif()
5266
include(util)
5367
include(flags)
5468
include(cudnn)
5569
include(FindPythonModule)
5670
include(check_packages)
71+
include(swig)
72+
include(coveralls)
5773

58-
# add PaddlePaddle version
59-
if(DEFINED ENV{PADDLE_VERSION})
60-
add_definitions(-DPADDLE_VERSION=\"$ENV{PADDLE_VERSION}\")
61-
else()
62-
if(EXISTS ${PROJ_ROOT}/.svn/)
63-
find_package(Subversion REQUIRED)
64-
if(SUBVERSION_FOUND)
65-
Subversion_WC_INFO(${PROJ_ROOT} Project)
66-
add_definitions(-DPADDLE_VERSION=${Project_WC_REVISION})
67-
endif()
68-
elseif(EXISTS ${PROJ_ROOT}/.git/)
69-
find_package(Git REQUIRED)
70-
execute_process(
71-
COMMAND ${GIT_EXECUTABLE} log -1 --format=%H
72-
WORKING_DIRECTORY ${PROJ_ROOT}
73-
OUTPUT_VARIABLE GIT_SHA1
74-
RESULT_VARIABLE GIT_RESULT
75-
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
76-
if(NOT ${GIT_RESULT})
77-
add_definitions(-DPADDLE_VERSION=\"${GIT_SHA1}\")
78-
else()
79-
message(WARNING "Cannot add paddle version from git tag")
80-
endif()
81-
endif()
82-
endif()
74+
# Set PaddlePaddle version to Git tag name or Git commit ID.
75+
find_package(Git REQUIRED)
76+
# version.cmake will get the current PADDLE_VERSION
77+
include(version)
78+
add_definitions(-DPADDLE_VERSION=\"${PADDLE_VERSION}\")
8379

8480

8581
if(NOT WITH_GPU)
@@ -98,14 +94,18 @@ else()
9894
if(NOT CUDNN_FOUND)
9995
message(FATAL_ERROR "Paddle need cudnn to compile")
10096
endif()
97+
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-g -O3 --use_fast_math")
98+
99+
if(WITH_AVX)
100+
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${AVX_FLAG}")
101+
else(WITH_AVX)
102+
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${SSE3_FLAG}")
103+
endif(WITH_AVX)
101104

102105
if(WITH_DSO)
103-
set(CUDA_LIBRARIES "")
104106
add_definitions(-DPADDLE_USE_DSO)
105107
endif(WITH_DSO)
106108

107-
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-g -O3 --use_fast_math")
108-
109109
# Include cuda and cudnn
110110
include_directories(${CUDNN_INCLUDE_DIR})
111111
include_directories(${CUDA_TOOLKIT_INCLUDE})
@@ -122,15 +122,16 @@ if(NOT WITH_TIMER)
122122
add_definitions(-DPADDLE_DISABLE_TIMER)
123123
endif(NOT WITH_TIMER)
124124

125+
if(NOT WITH_PROFILER)
126+
add_definitions(-DPADDLE_DISABLE_PROFILER)
127+
endif(NOT WITH_PROFILER)
128+
125129
if(WITH_AVX)
126-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AVX_FLAGS}")
127-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AVX_FLAGS}")
128-
if(AVX_FOUND)
129-
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler -mavx")
130-
endif(AVX_FOUND)
130+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AVX_FLAG}")
131+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AVX_FLAG}")
131132
else(WITH_AVX)
132-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3")
133-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
133+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE3_FLAG}")
134+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE3_FLAG}")
134135
endif(WITH_AVX)
135136

136137
if(WITH_PYTHON)
@@ -140,12 +141,15 @@ else(WITH_PYTHON)
140141
add_definitions(-DPADDLE_NO_PYTHON)
141142
endif(WITH_PYTHON)
142143

143-
if(NOT WITH_RDMA)
144-
add_definitions(-DPADDLE_DISABLE_RDMA)
145-
endif()
144+
if(WITH_RDMA)
145+
include_directories("${RDMA_INC_DIR}")
146+
else(WITH_RDMA)
147+
add_definitions(-DPADDLE_DISABLE_RDMA)
148+
endif(WITH_RDMA)
146149

147150
if(WITH_GLOG)
148151
add_definitions(-DPADDLE_USE_GLOG)
152+
include_directories(${LIBGLOG_INCLUDE_DIR})
149153
endif()
150154

151155
if(WITH_GFLAGS)

ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Thank you for contributing to PaddlePaddle. Submitting an issue is a great help for us.
2+
Both Chinese and English issues are welcome.
3+
4+
It's hard to solve a problem when important details are missing.
5+
Before submitting the issue, look over the following criteria before handing your request in.
6+
7+
- [ ] Was there a similar issue submitted or resolved before ? You could search issue in the github.
8+
- [ ] Did you retrieve your issue from widespread search engines ?
9+
- [ ] Is my description of the issue clear enough to reproduce this problem?
10+
* If some errors occurred, we need details about `how do you run your code?`, `what system do you use?`, `Are you using GPU or not?`, etc.
11+
* If you use an recording [asciinema](https://asciinema.org/) to show what you are doing to make it happen, that's awesome! We could help you solve the problem more quickly.
12+
- [ ] Is my description of the issue use the github markdown correctly?
13+
* Please use the proper markdown syntaxes for styling all forms of writing, e.g, source code, error information, etc.
14+
* Check out [this page](https://guides.github.com/features/mastering-markdown/) to find out much more about markdown.

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# PaddlePaddle
22

3-
| **`Linux`** | **`License`** | **`Chat Room`** |
4-
|----------------|---------------|-----------------|
5-
|[![Build Status](https://travis-ci.org/baidu/Paddle.svg?branch=master)](https://travis-ci.org/baidu/Paddle)|[![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](LICENSE)|[![Join the chat at https://gitter.im/PaddlePaddle/Deep_Learning](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PaddlePaddle/Deep_Learning?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)|
3+
4+
[![Build Status](https://travis-ci.org/PaddlePaddle/Paddle.svg?branch=develop)](https://travis-ci.org/PaddlePaddle/Paddle)
5+
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](http://www.paddlepaddle.org/)
6+
[![Documentation Status](https://img.shields.io/badge/中文文档-最新-brightgreen.svg)](http://www.paddlepaddle.org/cn/index.html)
7+
[![Coverage Status](https://coveralls.io/repos/github/PaddlePaddle/Paddle/badge.svg?branch=develop)](https://coveralls.io/github/PaddlePaddle/Paddle?branch=develop)
8+
[![Release](https://img.shields.io/github/release/PaddlePaddle/Paddle.svg)](https://github.com/PaddlePaddle/Paddle/releases)
9+
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)
10+
611

712
Welcome to the PaddlePaddle GitHub.
813

@@ -12,7 +17,7 @@ developed by Baidu scientists and engineers for the purpose of applying deep
1217
learning to many products at Baidu.
1318

1419
Our vision is to enable deep learning for everyone via PaddlePaddle.
15-
Please refer to our [release log](https://github.com/baidu/Paddle/releases) to track the latest feature of PaddlePaddle.
20+
Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddle/releases) to track the latest feature of PaddlePaddle.
1621

1722
## Features
1823

@@ -24,15 +29,15 @@ Please refer to our [release log](https://github.com/baidu/Paddle/releases) to t
2429
connection.
2530

2631
- **Efficiency**
27-
32+
2833
In order to unleash the power of heterogeneous computing resource,
2934
optimization occurs at different levels of PaddlePaddle, including
3035
computing, memory, architecture and communication. The following are some
3136
examples:
3237

3338
- Optimized math operations through SSE/AVX intrinsics, BLAS libraries
34-
(e.g. MKL, ATLAS, cuBLAS) or customized CPU/GPU kernels.
35-
- Highly optimized recurrent networks which can handle **variable-length**
39+
(e.g. MKL, ATLAS, cuBLAS) or customized CPU/GPU kernels.
40+
- Highly optimized recurrent networks which can handle **variable-length**
3641
sequence without padding.
3742
- Optimized local and distributed training for models with high dimensional
3843
sparse data.
@@ -55,41 +60,39 @@ Please refer to our [release log](https://github.com/baidu/Paddle/releases) to t
5560

5661
## Installation
5762
Check out the [Install Guide](http://paddlepaddle.org/doc/build/) to install from
58-
pre-built packages (**docker image**, **deb package**) or
63+
pre-built packages (**docker image**, **deb package**) or
5964
directly build on **Linux** and **Mac OS X** from the source code.
60-
65+
6166
## Documentation
6267
Both [English Docs](http://paddlepaddle.org/doc/) and [Chinese Docs](http://paddlepaddle.org/doc_cn/) are provided for our users and developers.
6368

6469
- [Quick Start](http://paddlepaddle.org/doc/demo/quick_start/index_en) <br>
6570
You can follow the quick start tutorial to learn how use PaddlePaddle
6671
step-by-step.
67-
72+
6873
- [Example and Demo](http://paddlepaddle.org/doc/demo/) <br>
6974
We provide five demos, including: image classification, sentiment analysis,
70-
sequence to sequence model, recommendation, semantic role labeling.
71-
75+
sequence to sequence model, recommendation, semantic role labeling.
76+
7277
- [Distributed Training](http://paddlepaddle.org/doc/cluster) <br>
7378
This system supports training deep learning models on multiple machines
7479
with data parallelism.
75-
80+
7681
- [Python API](http://paddlepaddle.org/doc/ui/) <br>
7782
PaddlePaddle supports using either Python interface or C++ to build your
7883
system. We also use SWIG to wrap C++ source code to create a user friendly
7984
interface for Python. You can also use SWIG to create interface for your
8085
favorite programming language.
81-
86+
8287
- [How to Contribute](http://paddlepaddle.org/doc/build/contribute_to_paddle.html) <br>
8388
We sincerely appreciate your interest and contributions. If you would like to
84-
contribute, please read the contribution guide.
89+
contribute, please read the contribution guide.
8590

8691
- [Source Code Documents](http://paddlepaddle.org/doc/source/) <br>
8792

8893
## Ask Questions
89-
Please join the [**gitter chat**](https://gitter.im/PaddlePaddle/Deep_Learning) or send email to
90-
**paddle-dev@baidu.com** to ask questions and talk about methods and models.
91-
Framework development discussions and
92-
bug reports are collected on [Issues](https://github.com/baidu/paddle/issues).
94+
95+
You are welcome to submit questions and bug reports as [Github Issues](https://github.com/PaddlePaddle/Paddle/issues).
9396

9497
## Copyright and License
9598
PaddlePaddle is provided under the [Apache-2.0 license](LICENSE).

0 commit comments

Comments
 (0)