Skip to content

Commit 45adbfc

Browse files
committed
Merge remote-tracking branch 'origin/develop' into lr_state
2 parents dec65ac + 7b81055 commit 45adbfc

File tree

115 files changed

+4076
-1461
lines changed

Some content is hidden

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

115 files changed

+4076
-1461
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121
sha: 28c0ea8a67a3e2dbbf4822ef44e85b63a0080a29
2222
hooks:
2323
- id: clang-formater
24+
- repo: https://github.com/dnephin/pre-commit-golang
25+
sha: e4693a4c282b4fc878eda172a929f7a6508e7d16
26+
hooks:
27+
- id: go-fmt
28+
files: (.*\.go)
29+
- id: go-lint
30+
files: (.*\.go)

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@ addons:
3333
- ccache
3434
before_install:
3535
- if [[ "$JOB" == "check_style" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
36-
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
36+
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
3737
# protobuf version.
3838
- pip install numpy wheel 'protobuf==3.1' sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit requests==2.9.2 LinkChecker
3939
- pip install rarfile
40+
- curl https://glide.sh/get | bash
4041
- eval "$(GIMME_GO_VERSION=1.8.3 gimme)"
4142
- |
4243
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
4344
script:
4445
- |
45-
timeout 2580 paddle/scripts/travis/${JOB}.sh # 43min timeout
46+
timeout 2580 paddle/scripts/travis/${JOB}.sh # 43min timeout
4647
RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true; else false; fi;
4748
notifications:
4849
email:

AUTHORS.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
| Github account | name |
22
|---|---|
3-
| reyoung | Yang Yu |
3+
| backyes | Yan-Fei Wang |
4+
| beckett1124 | Bin Qi |
5+
| Canpio | Jia-Yi Feng |
6+
| chengxiaohua1105 | Xiao-Hua Cheng |
7+
| cxwangyi, yiwangbaidu, wangkuiyi | Yi Wang |
8+
| cxysteven | Xing-Yi Cheng |
9+
| dzhwinter | Zhi-Hong Dong |
10+
| emailweixu | Wei Xu |
411
| gangliao | Gang Liao |
5-
| luotao01 | Tao Luo |
6-
| jacquesqiao | Long-Fei Qiao |
7-
| qingqing01 | Qing-Qing Dang |
12+
| gongweibao | Wei-Bao Gong |
13+
| Guo Sheng | Sheng Guo |
14+
| Haichao-Zhang | Hai-Chao Zhang |
815
| hedaoyuan | Dao-Yuan He |
9-
| wangyang59 | Yang Wang |
16+
| helinwang | He-Lin Wang |
17+
| jacquesqiao | Long-Fei Qiao |
18+
| kuke | Yi-Bing Liu |
19+
| lcy-seso | Ying Cao |
20+
| lipeng-unisound | Peng Li |
21+
| liuyuan | Yuan Liu |
22+
| livc | Zhao Li |
23+
| llxxxll | Yong-Feng Liu |
24+
| luotao01 | Tao Luo |
25+
| lzhao4ever | Liang Zhao |
26+
| NHZlX | Zhao-Long Xing |
27+
| pakchoi | Chuan-Jiang Song |
28+
| pengli09 | Peng Li |
29+
| pkuyym | Ya-Ming Yang |
1030
| QiJune | Jun Qi |
31+
| qingqing01 | Qing-Qing Dang |
32+
| reyoung | Yang Yu |
33+
| Superjom | Chun-Wei Yan |
1134
| tianbingsz | Tian-Bing Xu |
12-
| cxwangyi, yiwangbaidu, wangkuiyi | Yi Wang |
1335
| typhoonzero | Yi Wu |
14-
| backyes | Yan-Fei Wang |
15-
| pengli09 | Peng Li |
16-
| livc | Zhao Li |
36+
| wanghaoshuang | Hao-Shuang Wang |
37+
| wangyang59 | Yang Wang |
38+
| wangzhen-nlp | Zhen Wang |
39+
| wen-bo-yang | Wen-Bo Yang |
40+
| wwhu | Wei-Wei Hu |
41+
| xinghai-sun | Xing-Hai Sun |
1742
| Xreki | Yi-Qun Liu |
43+
| xujun05 | Jun Xu |
44+
| xushaoyong | Shao-Yong Xu |
1845
| Yancey1989 | Xu Yan |
19-
| emailweixu | Wei Xu |
20-
| wen-bo-yang | Wen-Bo Yang |
21-
| helinwang | He-Lin Wang |
22-
| lcy-seso | Ying Cao |
23-
| Zrachel | Rui-Qing Zhang |
24-
| Haichao-Zhang | Hai-Chao Zhang |
25-
| gongweibao | Wei-Bao Gong |
26-
| lzhao4ever | Liang Zhao |
46+
| zhaopu7 | Pu Zhao |
2747
| zhouxiao-coder | Xiao Zhou |
28-
| lipeng-unisound | Peng Li |
48+
| Zrachel | Rui-Qing Zhang |

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
4949
option(ON_TRAVIS "Exclude special unit test on Travis CI" OFF)
5050
option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF)
5151
option(WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF)
52+
option(GLIDE_INSTALL "Download and install go dependencies " ON)
5253
option(USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF)
5354

5455
# CMAKE_BUILD_TYPE
@@ -96,22 +97,23 @@ include(external/warpctc) # download, build, install warpctc
9697
include(external/any) # download libn::any
9798
include(external/eigen) # download eigen3
9899

100+
include(cudnn) # set cudnn libraries, must before configure
101+
include(configure) # add paddle env configuration
99102
include(generic) # simplify cmake module
100103
include(package) # set paddle packages
101104
include(cpplint) # set paddle c++ style
102105
include(ccache) # set ccache for compilation
103106
include(util) # set unittest and link libs
104107
include(rdma) # set rdma libraries
105108
include(flags) # set paddle compile flags
106-
include(cudnn) # set cudnn libraries
107109
include(version) # set PADDLE_VERSION
108110
include(coveralls) # set code coverage
109-
include(configure) # add paddle env configuration
111+
110112

111113
include_directories("${PROJ_ROOT}")
112114
include_directories("${PROJ_ROOT}/paddle/cuda/include")
113115
include_directories("${CMAKE_CURRENT_BINARY_DIR}/proto")
114-
include_directories("${CMAKE_CURRENT_BINARY_DIR}/go/pserver/cclient")
116+
include_directories("${CMAKE_CURRENT_BINARY_DIR}/go/pserver/client/c")
115117
include_directories(${Boost_INCLUDE_DIRS})
116118

117119
set(EXTERNAL_LIBS
@@ -139,8 +141,7 @@ add_subdirectory(proto)
139141
# "add_subdirectory(paddle)" and "add_subdirectory(python)" should be
140142
# placed after this block, because they depends on it.
141143
if(WITH_GOLANG)
142-
add_subdirectory(go/master/c)
143-
add_subdirectory(go/pserver/cclient)
144+
add_subdirectory(go)
144145
endif(WITH_GOLANG)
145146

146147
add_subdirectory(paddle)

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ RUN apt-get update && \
3434
net-tools && \
3535
apt-get clean -y
3636

37-
# Install Go
37+
# Install Go and glide
3838
RUN wget -O go.tgz https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz && \
3939
tar -C /usr/local -xzf go.tgz && \
4040
mkdir /root/gopath && \
41+
mkdir /root/gopath/bin && \
42+
mkdir /root/gopath/src && \
4143
rm go.tgz
4244
ENV GOROOT=/usr/local/go GOPATH=/root/gopath
4345
# should not be in the same line with GOROOT definition, otherwise docker build could not find GOROOT.
44-
ENV PATH=${PATH}:${GOROOT}/bin
46+
ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin
47+
# install glide
48+
RUN curl -q https://glide.sh/get | sh
4549

4650
# git credential to skip password typing
4751
RUN git config --global credential.helper store
@@ -57,7 +61,7 @@ RUN pip install --upgrade pip && \
5761
pip install -U docopt PyYAML sphinx && \
5862
pip install -U sphinx-rtd-theme==0.1.9 recommonmark && \
5963
pip install pre-commit 'requests==2.9.2' 'ipython==5.3.0' && \
60-
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
64+
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
6165
pip install rarfile
6266

6367
# To fix https://github.com/PaddlePaddle/Paddle/issues/1954, we use

cmake/configure.cmake

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2-
#
2+
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
6-
#
6+
#
77
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
8+
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -79,6 +79,9 @@ if(WITH_GOLANG)
7979
set(GOPATH "${CMAKE_CURRENT_BINARY_DIR}/go")
8080
file(MAKE_DIRECTORY ${GOPATH})
8181
set(PADDLE_IN_GOPATH "${GOPATH}/src/github.com/PaddlePaddle/Paddle")
82+
file(MAKE_DIRECTORY "${PADDLE_IN_GOPATH}")
83+
set(PADDLE_GO_PATH "${CMAKE_SOURCE_DIR}/go")
84+
8285
add_custom_target(go_path)
8386
add_custom_command(TARGET go_path
8487
# Symlink Paddle directory into GOPATH
@@ -89,7 +92,22 @@ if(WITH_GOLANG)
8992
# We can't run `go get -d ./...` for every target, because
9093
# multiple `go get` can not run concurrently, but make need to be
9194
# able to run with multiple jobs.
92-
COMMAND env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get -d ./go/...
9395
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
9496
)
97+
98+
if (GLIDE_INSTALL)
99+
if(EXISTS $ENV{GOPATH}/bin/glide)
100+
set(GLIDE "$ENV{GOPATH}/bin/glide")
101+
else()
102+
message(FATAL_ERROR "no glide executeble found: $ENV{GOPATH}/bin/glide")
103+
endif()
104+
105+
add_custom_target(go_vendor)
106+
add_custom_command(TARGET go_vendor
107+
COMMAND env GOPATH=${GOPATH} ${GLIDE} install
108+
WORKING_DIRECTORY "${PADDLE_IN_GOPATH}/go"
109+
)
110+
add_dependencies(go_vendor go_path)
111+
endif()
112+
95113
endif(WITH_GOLANG)

cmake/cpplint.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(STYLE_FILTER "${STYLE_FILTER}-readability/casting")
2525
set(IGNORE_PATTERN
2626
.*ImportanceSampler.*
2727
.*cblas\\.h.*
28+
.*\\.pb\\.txt
2829
.*LtrDataProvider.*
2930
.*MultiDataProvider.*)
3031

cmake/external/any.cmake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ INCLUDE(ExternalProject)
22

33
SET(ANY_SOURCE_DIR ${THIRD_PARTY_PATH}/any)
44

5-
INCLUDE_DIRECTORIES(${ANY_SOURCE_DIR}/src/linb_any)
5+
INCLUDE_DIRECTORIES(${ANY_SOURCE_DIR}/src/extern_lib_any)
66

77
ExternalProject_Add(
8-
linb_any
8+
extern_lib_any
99
${EXTERNAL_PROJECT_LOG_ARGS}
1010
GIT_REPOSITORY "https://github.com/thelink2012/any.git"
1111
GIT_TAG "8fef1e93710a0edf8d7658999e284a1142c4c020"
@@ -17,5 +17,15 @@ ExternalProject_Add(
1717
TEST_COMMAND ""
1818
)
1919

20+
if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
21+
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/lib_any_dummy.c)
22+
file(WRITE ${dummyfile} "const char * dummy_any = \"${dummyfile}\";")
23+
add_library(lib_any STATIC ${dummyfile})
24+
else()
25+
add_library(lib_any INTERFACE)
26+
endif()
27+
28+
add_dependencies(lib_any extern_lib_any)
29+
2030
add_definitions(-DANY_IMPL_ANY_CAST_MOVEABLE)
21-
LIST(APPEND external_project_dependencies linb_any)
31+
LIST(APPEND external_project_dependencies lib_any)

cmake/external/eigen.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ INCLUDE(ExternalProject)
22

33
SET(EIGEN_SOURCE_DIR ${THIRD_PARTY_PATH}/eigen3)
44

5-
INCLUDE_DIRECTORIES(${EIGEN_SOURCE_DIR}/src/eigen3)
5+
INCLUDE_DIRECTORIES(${EIGEN_SOURCE_DIR}/src/extern_eigen3)
66

77
ExternalProject_Add(
8-
eigen3
8+
extern_eigen3
99
${EXTERNAL_PROJECT_LOG_ARGS}
1010
# for latest version, please get from official website
1111
# URL "https://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz"
@@ -26,4 +26,14 @@ ExternalProject_Add(
2626
TEST_COMMAND ""
2727
)
2828

29+
if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
30+
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/eigen3_dummy.c)
31+
file(WRITE ${dummyfile} "const char * dummy_eigen3 = \"${dummyfile}\";")
32+
add_library(eigen3 STATIC ${dummyfile})
33+
else()
34+
add_library(eigen3 INTERFACE)
35+
endif()
36+
37+
add_dependencies(eigen3 extern_eigen3)
38+
2939
LIST(APPEND external_project_dependencies eigen3)

cmake/external/glog.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ ExternalProject_Add(
3838
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
3939
CMAKE_ARGS -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
4040
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${GLOG_INSTALL_DIR}
41+
CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=${GLOG_INSTALL_DIR}/lib
4142
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON
4243
CMAKE_ARGS -DWITH_GFLAGS=ON
4344
CMAKE_ARGS -Dgflags_DIR=${GFLAGS_INSTALL_DIR}/lib/cmake/gflags
4445
CMAKE_ARGS -DBUILD_TESTING=OFF
4546
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
4647
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${GLOG_INSTALL_DIR}
48+
-DCMAKE_INSTALL_LIBDIR:PATH=${GLOG_INSTALL_DIR}/lib
4749
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
4850
-DCMAKE_BUILD_TYPE:STRING=Release
4951
)

0 commit comments

Comments
 (0)