Skip to content

Commit 01b88f2

Browse files
committed
Merge branch 'develop' into merge_bn
2 parents ec512cd + fee5b24 commit 01b88f2

File tree

140 files changed

+4150
-659
lines changed

Some content is hidden

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

140 files changed

+4150
-659
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ set(EXTERNAL_LIBS
179179

180180
if(WITH_GPU)
181181
include(cuda)
182+
include(tensorrt)
182183
endif(WITH_GPU)
183184

184185
if(WITH_AMD_GPU)

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A image for building paddle binaries
22
# Use cuda devel base image for both cpu and gpu environment
3-
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04
3+
FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04
44
MAINTAINER PaddlePaddle Authors <[email protected]>
55

66
ARG UBUNTU_MIRROR
@@ -45,6 +45,13 @@ ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin
4545
# install glide
4646
RUN curl -s -q https://glide.sh/get | sh
4747

48+
# Install TensorRT
49+
# The unnecessary files has been removed to make the library small. It only contains include and lib now.
50+
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 | \
51+
tar -xz -C /usr/local && \
52+
cp -rf /usr/local/TensorRT/include /usr && \
53+
cp -rf /usr/local/TensorRT/lib /usr
54+
4855
# git credential to skip password typing
4956
RUN git config --global credential.helper store
5057

@@ -57,7 +64,7 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
5764
# specify sphinx version as 1.5.6 and remove -U option for [pip install -U
5865
# sphinx-rtd-theme] since -U option will cause sphinx being updated to newest
5966
# version(1.7.1 for now), which causes building documentation failed.
60-
RUN pip install --upgrade pip && \
67+
RUN pip install --upgrade pip==9.0.3 && \
6168
pip install -U wheel && \
6269
pip install -U docopt PyYAML sphinx==1.5.6 && \
6370
pip install sphinx-rtd-theme==0.1.9 recommonmark

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

cmake/cblas.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if(NOT CMAKE_CROSSCOMPILING)
7878
/usr/lib/reference/
7979
)
8080
else()
81-
# Diable the finding of reference cblas under host's system path
81+
# Disable the finding of reference cblas under host's system path
8282
set(REFERENCE_CBLAS_INCLUDE_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/include)
8383
set(REFERENCE_CBLAS_LIB_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/lib)
8484
endif()

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/external/grpc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ExternalProject_Add(
3333
extern_grpc
3434
DEPENDS protobuf zlib
3535
GIT_REPOSITORY "https://github.com/grpc/grpc.git"
36-
GIT_TAG "v1.11.x"
36+
GIT_TAG "v1.10.x"
3737
PREFIX ${GRPC_SOURCES_DIR}
3838
UPDATE_COMMAND ""
3939
CONFIGURE_COMMAND ""

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/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ add_custom_target(paddle_apis ALL
33

44
add_custom_target(paddle_docs ALL
55
DEPENDS paddle_v2_docs paddle_v2_docs_cn
6-
paddle_fluid_docs paddle_fluid_docs_cn)
6+
paddle_fluid_docs paddle_fluid_docs_cn
7+
paddle_mobile_docs paddle_mobile_docs_cn)
78

89
add_subdirectory(v2)
910
add_subdirectory(fluid)
11+
add_subdirectory(mobile)

doc/fluid/api/layers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ multiplex
473473
.. autofunction:: paddle.fluid.layers.multiplex
474474
:noindex:
475475

476+
label_smooth
477+
------------
478+
479+
.. autofunction:: paddle.fluid.layers.label_smooth
480+
:noindex:
481+
476482
ops
477483
===
478484

doc/fluid/design/concepts/parallel_executor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Running an operator can be asynchronized. There is a thread pool to execute an `
8484
8585
## Synchronize GPU Kernels
8686
87-
The GPU is a non-blocking device. The different streams need be synchronized when switing streams. In current implementation, the synchronization based on the following algorithm:
87+
The GPU is a non-blocking device. The different streams need be synchronized when switching streams. In current implementation, the synchronization based on the following algorithm:
8888
8989
1. `OpHandle` will record `DeviceContext` that it is used.
9090
2. In `OpHandle::Run`, if the `DeviceContext` of current operator is different from `DeviceContext` of any input variable, just wait the generate operator of this input variable.

0 commit comments

Comments
 (0)