Skip to content

Commit 6e8510f

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into quick_help
2 parents e05f3ea + 6c0356e commit 6e8510f

File tree

300 files changed

+5255
-2148
lines changed

Some content is hidden

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

300 files changed

+5255
-2148
lines changed

CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_F
3939
option(WITH_AMD_GPU "Compile PaddlePaddle with AMD GPU" OFF)
4040
option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND})
4141
option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FOUND})
42-
option(WITH_TENSORRT "Compile PaddlePaddle with TensorRT support." OFF)
4342
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
4443
option(WITH_TESTING "Compile PaddlePaddle with unit testing" OFF)
4544
option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)
@@ -180,13 +179,9 @@ set(EXTERNAL_LIBS
180179

181180
if(WITH_GPU)
182181
include(cuda)
182+
include(tensorrt)
183183
endif(WITH_GPU)
184184

185-
# TensorRT depends on GPU.
186-
if (NOT WITH_GPU)
187-
set(WITH_TENSORRT OFF)
188-
endif()
189-
190185
if(WITH_AMD_GPU)
191186
find_package(HIP)
192187
include(hip)

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# A image for building paddle binaries
22
# Use cuda devel base image for both cpu and gpu environment
3+
4+
# When you modify it, please be aware of cudnn-runtime version
5+
# and libcudnn.so.x in paddle/scripts/docker/build.sh
36
FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04
47
MAINTAINER PaddlePaddle Authors <[email protected]>
58

@@ -46,7 +49,7 @@ ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin
4649
RUN curl -s -q https://glide.sh/get | sh
4750

4851
# Install TensorRT
49-
# The unnecessary files has been removed to make the library small.
52+
# The unnecessary files has been removed to make the library small. It only contains include and lib now.
5053
RUN wget -qO- http://paddlepaddledeps.bj.bcebos.com/TensorRT-4.0.0.3.Ubuntu-16.04.4.x86_64-gnu.cuda-8.0.cudnn7.0.tar.gz | \
5154
tar -xz -C /usr/local && \
5255
cp -rf /usr/local/TensorRT/include /usr && \

Dockerfile.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN git config --global credential.helper store
2727
# Fix locales to en_US.UTF-8
2828
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
2929

30-
RUN pip install --upgrade pip && \
30+
RUN pip install --upgrade pip==9.0.3 && \
3131
pip install -U 'protobuf==3.1.0' && \
3232
pip install -U wheel sphinx && \
3333
pip install pre-commit
File renamed without changes.

cmake/configure.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ if(WITH_GPU)
8080
# Include cuda and cudnn
8181
include_directories(${CUDNN_INCLUDE_DIR})
8282
include_directories(${CUDA_TOOLKIT_INCLUDE})
83+
84+
if(TENSORRT_FOUND)
85+
if(${CUDA_VERSION_MAJOR} VERSION_LESS 8)
86+
message(FATAL_ERROR "TensorRT needs CUDA >= 8.0 to compile")
87+
endif()
88+
if(${CUDNN_MAJOR_VERSION} VERSION_LESS 7)
89+
message(FATAL_ERROR "TensorRT needs CUDNN >= 7.0 to compile")
90+
endif()
91+
include_directories(${TENSORRT_INCLUDE_DIR})
92+
endif()
8393
elseif(WITH_AMD_GPU)
8494
add_definitions(-DPADDLE_WITH_HIP)
8595
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__HIP_PLATFORM_HCC__")

cmake/tensorrt.cmake

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if(NOT WITH_GPU)
2+
return()
3+
endif()
4+
5+
set(TENSORRT_ROOT "/usr" CACHE PATH "TENSORRT ROOT")
6+
find_path(TENSORRT_INCLUDE_DIR NvInfer.h
7+
PATHS ${TENSORRT_ROOT} ${TENSORRT_ROOT}/include
8+
$ENV{TENSORRT_ROOT} $ENV{TENSORRT_ROOT}/include
9+
NO_DEFAULT_PATH
10+
)
11+
12+
find_library(TENSORRT_LIBRARY NAMES libnvinfer.so libnvinfer.a
13+
PATHS ${TENSORRT_ROOT} ${TENSORRT_ROOT}/lib
14+
$ENV{TENSORRT_ROOT} $ENV{TENSORRT_ROOT}/lib
15+
NO_DEFAULT_PATH
16+
DOC "Path to TensorRT library.")
17+
18+
if(TENSORRT_INCLUDE_DIR AND TENSORRT_LIBRARY)
19+
set(TENSORRT_FOUND ON)
20+
else()
21+
set(TENSORRT_FOUND OFF)
22+
endif()
23+
24+
if(TENSORRT_FOUND)
25+
file(READ ${TENSORRT_INCLUDE_DIR}/NvInfer.h TENSORRT_VERSION_FILE_CONTENTS)
26+
string(REGEX MATCH "define NV_TENSORRT_MAJOR +([0-9]+)" TENSORRT_MAJOR_VERSION
27+
"${TENSORRT_VERSION_FILE_CONTENTS}")
28+
string(REGEX REPLACE "define NV_TENSORRT_MAJOR +([0-9]+)" "\\1"
29+
TENSORRT_MAJOR_VERSION "${TENSORRT_MAJOR_VERSION}")
30+
31+
message(STATUS "Current TensorRT header is ${TENSORRT_INCLUDE_DIR}/NvInfer.h. "
32+
"Current TensorRT version is v${TENSORRT_MAJOR_VERSION}. ")
33+
endif()

doc/fluid/api/evaluator.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@
55
evaluator
66
=========
77

8-
Accuracy
9-
--------
8+
ChunkEvaluator
9+
--------------
1010

11-
.. autoclass:: paddle.fluid.evaluator.Accuracy
11+
.. autoclass:: paddle.fluid.evaluator.ChunkEvaluator
1212
:members:
1313
:noindex:
1414

15-
ChunkEvaluator
15+
EditDistance
1616
--------------
1717

18-
.. autoclass:: paddle.fluid.evaluator.ChunkEvaluator
18+
.. autoclass:: paddle.fluid.evaluator.EditDistance
1919
:members:
2020
:noindex:
2121

22+
DetectionMAP
23+
--------------
24+
25+
.. autoclass:: paddle.fluid.evaluator.DetectionMAP
26+
:members:
27+
:noindex:
28+

doc/fluid/api/initializer.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,44 @@ Xavier
3333
:members:
3434
:noindex:
3535

36+
MSRA
37+
------
38+
39+
.. autoclass:: paddle.fluid.initializer.MSRA
40+
:members:
41+
:noindex:
42+
43+
ConstantInitializer
44+
-------------------
45+
46+
.. autoclass:: paddle.fluid.initializer.ConstantInitializer
47+
:members:
48+
:noindex:
49+
50+
UniformInitializer
51+
------------------
52+
53+
.. autoclass:: paddle.fluid.initializer.UniformInitializer
54+
:members:
55+
:noindex:
56+
57+
NormalInitializer
58+
-----------------
59+
60+
.. autoclass:: paddle.fluid.initializer.NormalInitializer
61+
:members:
62+
:noindex:
63+
64+
XavierInitializer
65+
-----------------
66+
67+
.. autoclass:: paddle.fluid.initializer.XavierInitializer
68+
:members:
69+
:noindex:
70+
71+
72+
MSRAInitializer
73+
-----------------
74+
.. autoclass:: paddle.fluid.initializer.MSRAInitializer
75+
:members:
76+
:noindex:

doc/fluid/api/layers.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,3 +815,8 @@ zeros
815815
.. autofunction:: paddle.fluid.layers.zeros
816816
:noindex:
817817

818+
topk
819+
----
820+
821+
.. autofunction:: paddle.fluid.layers.topk
822+
:noindex:

doc/fluid/api/optimizer.rst

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,51 @@ DecayedAdagrad
4747
:members:
4848
:noindex:
4949

50+
SGDOptimizer
51+
------------
52+
53+
.. autoclass:: paddle.fluid.optimizer.SGDOptimizer
54+
:members:
55+
:noindex:
56+
57+
MomentumOptimizer
58+
-----------------
59+
60+
.. autoclass:: paddle.fluid.optimizer.MomentumOptimizer
61+
:members:
62+
:noindex:
63+
64+
AdagradOptimizer
65+
----------------
66+
67+
.. autoclass:: paddle.fluid.optimizer.AdagradOptimizer
68+
:members:
69+
:noindex:
70+
71+
AdamOptimizer
72+
-------------
73+
74+
.. autoclass:: paddle.fluid.optimizer.AdamOptimizer
75+
:members:
76+
:noindex:
77+
78+
AdamaxOptimizer
79+
---------------
80+
81+
.. autoclass:: paddle.fluid.optimizer.AdamaxOptimizer
82+
:members:
83+
:noindex:
84+
85+
DecayedAdagradOptimizer
86+
-----------------------
87+
88+
.. autoclass:: paddle.fluid.optimizer.DecayedAdagradOptimizer
89+
:members:
90+
:noindex:
91+
5092
Adadelta
5193
--------------
5294

5395
.. autoclass:: paddle.fluid.optimizer.AdadeltaOptimizer
5496
:members:
5597
:noindex:
56-

0 commit comments

Comments
 (0)