Skip to content

Commit 459d4cc

Browse files
committed
Merge branch 'develop' into multi-thread2
2 parents f507e5c + 9076967 commit 459d4cc

File tree

68 files changed

+1900
-1104
lines changed

Some content is hidden

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

68 files changed

+1900
-1104
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RUN curl -s -q https://glide.sh/get | sh
5353
# and its size is only one-third of the official one.
5454
# 2. Manually add ~IPluginFactory() in IPluginFactory class of NvInfer.h, otherwise, it couldn't work in paddle.
5555
# See https://github.com/PaddlePaddle/Paddle/issues/10129 for details.
56-
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 | \
56+
RUN wget -qO- http://paddlepaddledeps.cdn.bcebos.com/TensorRT-4.0.0.3.Ubuntu-16.04.4.x86_64-gnu.cuda-8.0.cudnn7.0.tar.gz | \
5757
tar -xz -C /usr/local && \
5858
cp -rf /usr/local/TensorRT/include /usr && \
5959
cp -rf /usr/local/TensorRT/lib /usr

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,26 @@ pip install paddlepaddle-gpu==0.14.0.post85
7676

7777
## Installation
7878

79-
It is recommended to check out the
80-
[Docker installation guide](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/build_and_install/docker_install_en.html)
81-
before looking into the
82-
[build from source guide](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/build_and_install/build_from_source_en.html).
79+
It is recommended to read [this doc](http://paddlepaddle.org/documentation/docs/zh/0.14.0/new_docs/beginners_guide/install/install_doc.html) on our website.
8380

8481
## Documentation
8582

86-
We provide [English](http://www.paddlepaddle.org/docs/develop/documentation/en/getstarted/index_en.html) and
87-
[Chinese](http://www.paddlepaddle.org/docs/develop/documentation/zh/getstarted/index_cn.html) documentation.
83+
We provide [English](http://paddlepaddle.org/documentation/docs/en/0.14.0/getstarted/index_en.html) and
84+
[Chinese](http://paddlepaddle.org/documentation/docs/zh/0.14.0/new_docs/beginners_guide/index.html) documentation.
8885

89-
- [Deep Learning 101](http://www.paddlepaddle.org/docs/develop/book/01.fit_a_line/index.html)
86+
- [Deep Learning 101](https://github.com/PaddlePaddle/book)
9087

9188
You might want to start from this online interactive book that can run in a Jupyter Notebook.
9289

93-
- [Distributed Training](http://www.paddlepaddle.org/docs/develop/documentation/en/howto/cluster/index_en.html)
90+
- [Distributed Training](http://paddlepaddle.org/documentation/docs/zh/0.14.0/new_docs/user_guides/howto/training/cluster_howto.html)
9491

9592
You can run distributed training jobs on MPI clusters.
9693

97-
- [Distributed Training on Kubernetes](http://www.paddlepaddle.org/docs/develop/documentation/en/howto/cluster/multi_cluster/k8s_en.html)
98-
99-
You can also run distributed training jobs on Kubernetes clusters.
100-
101-
- [Python API](http://www.paddlepaddle.org/docs/develop/api/en/overview.html)
94+
- [Python API](http://paddlepaddle.org/documentation/api/zh/0.14.0/fluid.html)
10295

10396
Our new API enables much shorter programs.
10497

105-
- [How to Contribute](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/dev/contribute_to_paddle_en.html)
98+
- [How to Contribute](http://paddlepaddle.org/documentation/docs/zh/0.14.0/new_docs/advanced_usage/development/contribute_to_paddle.html)
10699

107100
We appreciate your contributions!
108101

cmake/cuda.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,19 @@ set(CUDA_PROPAGATE_HOST_FLAGS OFF)
169169

170170
# Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc.
171171
# So, don't set these flags here.
172+
if (NOT WIN32) # windows msvc2015 support c++11 natively.
173+
# -std=c++11 -fPIC not recoginize by msvc, -Xcompiler will be added by cmake.
172174
list(APPEND CUDA_NVCC_FLAGS "-std=c++11")
173-
list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
174175
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler -fPIC")
176+
endif(NOT WIN32)
177+
178+
list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
175179
# in cuda9, suppress cuda warning on eigen
176180
list(APPEND CUDA_NVCC_FLAGS "-w")
177181
# Set :expt-relaxed-constexpr to suppress Eigen warnings
178182
list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr")
179183

184+
if (NOT WIN32)
180185
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
181186
list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_DEBUG})
182187
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
@@ -187,6 +192,13 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
187192
# nvcc 9 does not support -Os. Use Release flags instead
188193
list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_RELEASE})
189194
endif()
195+
else(NOT WIN32)
196+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
197+
list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG")
198+
else()
199+
message(FATAL "Windows only support Release build now. Please set visual studio build type to Release, x64 build.")
200+
endif()
201+
endif(NOT WIN32)
190202

191203
mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD)
192204
mark_as_advanced(CUDA_SDK_ROOT_DIR CUDA_SEPARABLE_COMPILATION)

cmake/external/grpc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ExternalProject_Add(
4444
# 3. keep only zlib, cares, protobuf, boringssl under "third_party",
4545
# checkout and clean other dirs under third_party
4646
# 4. remove .git, and package the directory.
47-
URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz"
47+
URL "http://paddlepaddledeps.cdn.bcebos.com/grpc-v1.10.x.tar.gz"
4848
URL_MD5 "1f268a2aff6759839dccd256adcc91cf"
4949
PREFIX ${GRPC_SOURCES_DIR}
5050
UPDATE_COMMAND ""

cmake/inference_lib.cmake

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,13 @@ set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")
128128
set(dst_dir "${FLUID_INSTALL_DIR}/paddle/fluid")
129129
set(module "framework")
130130
if (NOT WIN32)
131-
copy(framework_lib DEPS framework_py_proto
132-
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/details/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h
133-
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/details ${dst_dir}/${module}
134-
)
135-
else()
136-
copy(framework_lib
131+
set(framework_lib_deps framework_py_proto)
132+
endif(NOT WIN32)
133+
copy(framework_lib DEPS ${framework_lib_deps}
137134
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/details/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h
138-
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/details ${dst_dir}/${module}
135+
${src_dir}/${module}/ir/*.h
136+
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/details ${dst_dir}/${module} ${dst_dir}/${module}/ir
139137
)
140-
endif(NOT WIN32)
141138

142139
set(module "memory")
143140
copy(memory_lib
@@ -161,7 +158,8 @@ set(module "inference")
161158
copy(inference_lib DEPS ${inference_deps}
162159
SRCS ${src_dir}/${module}/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/inference/libpaddle_fluid.*
163160
${src_dir}/${module}/api/paddle_inference_api.h ${src_dir}/${module}/api/demo_ci
164-
DSTS ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module}
161+
${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h
162+
DSTS ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module}
165163
)
166164

167165
set(module "platform")

doc/fluid/new_docs/user_guides/howto/prepare_data/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ PaddlePaddle Fluid支持两种传入数据的方式:
3838
:maxdepth: 2
3939

4040
feeding_data
41-
use_recordio_reader
4241

4342
Python Reader
4443
#############

doc/fluid/new_docs/user_guides/howto/prepare_data/use_recordio_reader.rst

Lines changed: 0 additions & 167 deletions
This file was deleted.

paddle/fluid/API.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ paddle.fluid.layers.sequence_mask ArgSpec(args=['x', 'maxlen', 'dtype', 'name'],
172172
paddle.fluid.layers.stack ArgSpec(args=['x', 'axis'], varargs=None, keywords=None, defaults=(0,))
173173
paddle.fluid.layers.pad2d ArgSpec(args=['input', 'paddings', 'mode', 'pad_value', 'data_format', 'name'], varargs=None, keywords=None, defaults=([0, 0, 0, 0], 'constant', 0.0, 'NCHW', None))
174174
paddle.fluid.layers.unstack ArgSpec(args=['x', 'axis', 'num'], varargs=None, keywords=None, defaults=(0, None))
175+
paddle.fluid.layers.sequence_enumerate ArgSpec(args=['input', 'win_size', 'pad_value', 'name'], varargs=None, keywords=None, defaults=(0, None))
175176
paddle.fluid.layers.data ArgSpec(args=['name', 'shape', 'append_batch_size', 'dtype', 'lod_level', 'type', 'stop_gradient'], varargs=None, keywords=None, defaults=(True, 'float32', 0, VarType.LOD_TENSOR, True))
176177
paddle.fluid.layers.open_recordio_file ArgSpec(args=['filename', 'shapes', 'lod_levels', 'dtypes', 'pass_num', 'for_parallel'], varargs=None, keywords=None, defaults=(1, True))
177178
paddle.fluid.layers.open_files ArgSpec(args=['filenames', 'shapes', 'lod_levels', 'dtypes', 'thread_num', 'buffer_size', 'pass_num', 'is_test'], varargs=None, keywords=None, defaults=(None, None, 1, None))

paddle/fluid/framework/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.tensor_util.cu
2+
.data_type_transform.cu

paddle/fluid/framework/CMakeLists.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# windows treat symbolic file as a real file, which is different with unix
2+
# We create a hidden file and compile it instead of origin source file.
3+
function(windows_symbolic TARGET)
4+
set(oneValueArgs "")
5+
set(multiValueArgs SRCS DEPS)
6+
cmake_parse_arguments(windows_symbolic "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
7+
foreach(src ${windows_symbolic_SRCS})
8+
get_filename_component(src ${src} NAME_WE)
9+
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${src}.cc OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${src}.cu)
10+
message(FATAL " ${src}.cc and ${src}.cu must exsits, and ${src}.cu must be symbolic file.")
11+
endif()
12+
add_custom_command(OUTPUT .${src}.cu
13+
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/.${src}.cu
14+
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${src}.cc" "${CMAKE_CURRENT_SOURCE_DIR}/.${src}.cu"
15+
COMMENT "create hidden file of ${src}.cu")
16+
add_custom_target(${TARGET} ALL DEPENDS .${src}.cu)
17+
endforeach()
18+
endfunction()
19+
120
add_subdirectory(ir)
221
if (NOT WIN32)
322
add_subdirectory(details)
@@ -11,7 +30,13 @@ nv_test(dim_test SRCS dim_test.cu DEPS ddim)
1130
cc_library(data_type SRCS data_type.cc DEPS framework_proto ddim device_context)
1231
cc_test(data_type_test SRCS data_type_test.cc DEPS data_type place tensor)
1332
if(WITH_GPU)
14-
nv_library(tensor SRCS tensor.cc tensor_util.cu DEPS place memory data_type device_context)
33+
if (WIN32)
34+
windows_symbolic(tensor_util SRCS tensor_util.cu)
35+
nv_library(tensor SRCS tensor.cc .tensor_util.cu DEPS place memory data_type device_context)
36+
add_dependencies(tensor tensor_util)
37+
else()
38+
nv_library(tensor SRCS tensor.cc tensor_util.cu DEPS place memory data_type device_context)
39+
endif(WIN32)
1540
else()
1641
cc_library(tensor SRCS tensor.cc tensor_util.cc DEPS place memory data_type device_context)
1742
endif()
@@ -55,7 +80,13 @@ nv_test(data_device_transform_test SRCS data_device_transform_test.cu
5580
DEPS operator op_registry device_context math_function)
5681

5782
if(WITH_GPU)
58-
nv_library(data_type_transform SRCS data_type_transform.cu DEPS tensor)
83+
if (WIN32)
84+
windows_symbolic(hidden_file SRCS data_type_transform.cu)
85+
nv_library(data_type_transform SRCS .data_type_transform.cu DEPS tensor)
86+
add_dependencies(data_type_transform hidden_file)
87+
else()
88+
nv_library(data_type_transform SRCS data_type_transform.cu DEPS tensor)
89+
endif(WIN32)
5990
nv_test(data_type_transform_test SRCS data_type_transform_test.cc data_type_transform_test.cu DEPS data_type_transform)
6091
else()
6192
cc_library(data_type_transform SRCS data_type_transform.cc DEPS tensor)

0 commit comments

Comments
 (0)