Skip to content

Commit 2294b81

Browse files
committed
Merge remote branch 'origin/develop' into sparse_bug
2 parents f53e8d7 + 140edd2 commit 2294b81

File tree

890 files changed

+7151
-6234
lines changed

Some content is hidden

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

890 files changed

+7151
-6234
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ build/
99
.pydevproject
1010
Makefile
1111
.test_env/
12+
13+
*~
14+
bazel-*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "warp-ctc"]
2+
path = warp-ctc
3+
url = https://github.com/baidu-research/warp-ctc.git

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
sha: c25201a00e6b0514370501050cf2a8538ac12270
33
hooks:
44
- id: remove-crlf
5+
files: (?!.*warp-ctc)^.*$
56
- repo: https://github.com/reyoung/mirrors-yapf.git
67
sha: v0.13.2
78
hooks:
8-
- id: yapf
9+
- id: yapf
10+
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ # Bazel BUILD files follow Python syntax.
911
- repo: https://github.com/pre-commit/pre-commit-hooks
1012
sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469
1113
hooks:
1214
- id: check-added-large-files
1315
- id: check-merge-conflict
1416
- id: check-symlinks
1517
- id: detect-private-key
18+
files: (?!.*warp-ctc)^.*$
1619
- id: end-of-file-fixer
1720
- repo: https://github.com/PaddlePaddle/clang-format-pre-commit-hook.git
1821
sha: 28c0ea8a67a3e2dbbf4822ef44e85b63a0080a29

.travis.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ os:
88
env:
99
- JOB=DOCS
1010
- JOB=BUILD_AND_TEST
11+
- JOB=PRE_COMMIT
1112
matrix:
1213
exclude:
1314
- os: osx
14-
env: JOB=DOCS # Only generate documentation in linux
15+
env: JOB=DOCS # Only generate documentation in linux.
16+
- os: osx
17+
env: JOB=PRE_COMMIT # Only check pre-commit hook in linux
1518

1619
addons:
1720
apt:
@@ -39,18 +42,23 @@ addons:
3942
- lcov
4043
- graphviz
4144
- swig
45+
- clang-format-3.8
4246
before_install:
4347
- |
4448
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+
local change_list=`git diff --name-only $TRAVIS_COMMIT_RANGE`
50+
if [ $? -eq 0 ]; then # if git diff return no zero, then rerun unit test.
51+
if ! echo ${change_list} | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
52+
then
53+
echo "Only markdown docs were updated, stopping build process."
54+
exit
55+
fi
4956
fi
5057
fi
5158
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo paddle/scripts/travis/before_install.linux.sh; fi
5259
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then paddle/scripts/travis/before_install.osx.sh; fi
53-
- pip install wheel protobuf sphinx breathe recommonmark virtualenv numpy sphinx_rtd_theme
60+
- if [[ "$JOB" == "PRE_COMMIT" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
61+
- pip install wheel protobuf sphinx recommonmark virtualenv numpy sphinx_rtd_theme pre-commit
5462
script:
5563
- paddle/scripts/travis/main.sh
5664
notifications:

CMakeLists.txt

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ find_package(Protobuf REQUIRED)
1111

1212
# Check protobuf library version.
1313
execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version
14-
OUTPUT_VARIABLE PROTOBUF_VERSION)
14+
OUTPUT_VARIABLE PROTOBUF_VERSION)
1515
string(REPLACE "libprotoc " "" PROTOBUF_VERSION ${PROTOBUF_VERSION})
1616

1717
set(PROTOBUF_3 OFF)
@@ -51,13 +51,7 @@ option(ON_TRAVIS "Running test on travis-ci or not." OFF)
5151
option(ON_COVERALLS "Generating code coverage data on coveralls or not." OFF)
5252
option(COVERALLS_UPLOAD "Uploading the generated coveralls json." ON)
5353

54-
if(NOT CMAKE_BUILD_TYPE)
55-
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
56-
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
57-
FORCE)
58-
endif()
5954

60-
include(enableCXX11)
6155
include(cpplint)
6256
include(ccache)
6357
if(WITH_RDMA)
@@ -75,42 +69,37 @@ include(coveralls)
7569
find_package(Git REQUIRED)
7670
# version.cmake will get the current PADDLE_VERSION
7771
include(version)
78-
add_definitions(-DPADDLE_VERSION=\"${PADDLE_VERSION}\")
79-
72+
add_definitions(-DPADDLE_VERSION=${PADDLE_VERSION})
8073

8174
if(NOT WITH_GPU)
8275
add_definitions(-DPADDLE_ONLY_CPU)
8376
add_definitions(-DHPPL_STUB_FUNC)
77+
8478
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu)
8579
else()
86-
if(${CUDA_VERSION_MAJOR} GREATER 6)
87-
if(COMPILER_SUPPORT_CXX11)
88-
LIST(APPEND CUDA_NVCC_FLAGS -std=c++11)
89-
endif()
80+
if(${CUDA_VERSION_MAJOR} VERSION_LESS 7)
81+
message(FATAL_ERROR "Paddle need CUDA >= 7.0 to compile")
9082
endif()
9183

92-
# TODO(yuyang18): Change it to remove std=c++11 in cuda compile.
93-
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
9484
if(NOT CUDNN_FOUND)
9585
message(FATAL_ERROR "Paddle need cudnn to compile")
9686
endif()
97-
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-g -O3 --use_fast_math")
9887

9988
if(WITH_AVX)
10089
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${AVX_FLAG}")
10190
else(WITH_AVX)
10291
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${SSE3_FLAG}")
10392
endif(WITH_AVX)
10493

105-
if(WITH_DSO)
106-
add_definitions(-DPADDLE_USE_DSO)
107-
endif(WITH_DSO)
108-
10994
# Include cuda and cudnn
11095
include_directories(${CUDNN_INCLUDE_DIR})
11196
include_directories(${CUDA_TOOLKIT_INCLUDE})
11297
endif(NOT WITH_GPU)
11398

99+
if(WITH_DSO)
100+
add_definitions(-DPADDLE_USE_DSO)
101+
endif(WITH_DSO)
102+
114103
if(WITH_DOUBLE)
115104
add_definitions(-DPADDLE_TYPE_DOUBLE)
116105
set(ACCURACY double)
@@ -180,5 +169,4 @@ add_subdirectory(paddle)
180169
add_subdirectory(python)
181170
if(WITH_DOC)
182171
add_subdirectory(doc)
183-
add_subdirectory(doc_cn)
184172
endif()

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 Baidu, Inc. All Rights Reserved
1+
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
22

33
Apache License
44
Version 2.0, January 2004
@@ -188,7 +188,7 @@ Copyright (c) 2016 Baidu, Inc. All Rights Reserved
188188
same "printed page" as the copyright notice for easier
189189
identification within third-party archives.
190190

191-
Copyright (c) 2016 Baidu, Inc. All Rights Reserve.
191+
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
192192

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

WORKSPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# External dependency to Google protobuf.
2+
http_archive(
3+
name="protobuf",
4+
url="http://github.com/google/protobuf/archive/v3.1.0.tar.gz",
5+
sha256="0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7",
6+
strip_prefix="protobuf-3.1.0", )
7+
8+
# External dependency to gtest 1.7.0. This method comes from
9+
# https://www.bazel.io/versions/master/docs/tutorial/cpp.html.
10+
new_http_archive(
11+
name="gtest",
12+
url="https://github.com/google/googletest/archive/release-1.7.0.zip",
13+
sha256="b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0",
14+
build_file="third_party/gtest.BUILD",
15+
strip_prefix="googletest-release-1.7.0", )

benchmark/tensorflow/rnn/run_multi.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ test 4 2 256 512
2525
test 4 2 512 128
2626
test 4 2 512 256
2727
test 4 2 512 512
28-

cmake/FindSphinx.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +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 -s ${destination}/index_*.html ${destination}/index.html
7576
)
7677

7778
set_property(
@@ -143,4 +144,4 @@ function( Sphinx_add_targets target_base_name conf source base_destination )
143144

144145
add_dependencies( ${target_base_name}_linkcheck ${_dependencies} )
145146
endif()
146-
endfunction()
147+
endfunction()

cmake/check_packages.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ if(WITH_DOC)
3030
find_package(Sphinx REQUIRED)
3131
find_package(Doxygen REQUIRED)
3232
find_python_module(recommonmark REQUIRED)
33-
find_python_module(breathe REQUIRED)
3433
endif()
3534

3635
if(WITH_SWIG_PY)

0 commit comments

Comments
 (0)