Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
00463fdf
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
00463fdf
编写于
8月 20, 2018
作者:
D
dzhwinter
提交者:
GitHub
8月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cudnn windows support (#12757)
* cudnn widndows * "add comment" * "windows support" * "fix cmake error"
上级
c62f68cb
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
47 addition
and
17 deletion
+47
-17
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/configure.cmake
cmake/configure.cmake
+0
-4
cmake/cudnn.cmake
cmake/cudnn.cmake
+19
-2
cmake/flags.cmake
cmake/flags.cmake
+5
-0
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+2
-1
paddle/fluid/operators/CMakeLists.txt
paddle/fluid/operators/CMakeLists.txt
+15
-4
paddle/fluid/operators/nccl/CMakeLists.txt
paddle/fluid/operators/nccl/CMakeLists.txt
+1
-1
paddle/fluid/platform/dynload/CMakeLists.txt
paddle/fluid/platform/dynload/CMakeLists.txt
+1
-1
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+3
-3
未找到文件。
CMakeLists.txt
浏览文件 @
00463fdf
...
@@ -212,6 +212,7 @@ elseif()
...
@@ -212,6 +212,7 @@ elseif()
set
(
WITH_ANAKIN OFF CACHE STRING
"Anakin is used in GPU only now."
FORCE
)
set
(
WITH_ANAKIN OFF CACHE STRING
"Anakin is used in GPU only now."
FORCE
)
endif
()
endif
()
include
(
flags
)
# set paddle compile flags
include
(
cudnn
)
# set cudnn libraries, must before configure
include
(
cudnn
)
# set cudnn libraries, must before configure
include
(
cupti
)
include
(
cupti
)
include
(
configure
)
# add paddle env configuration
include
(
configure
)
# add paddle env configuration
...
@@ -220,7 +221,6 @@ include(package) # set paddle packages
...
@@ -220,7 +221,6 @@ include(package) # set paddle packages
include
(
ccache
)
# set ccache for compilation
include
(
ccache
)
# set ccache for compilation
include
(
util
)
# set unittest and link libs
include
(
util
)
# set unittest and link libs
include
(
rdma
)
# set rdma libraries
include
(
rdma
)
# set rdma libraries
include
(
flags
)
# set paddle compile flags
include
(
version
)
# set PADDLE_VERSION
include
(
version
)
# set PADDLE_VERSION
include
(
coveralls
)
# set code coverage
include
(
coveralls
)
# set code coverage
include
(
inference_lib
)
# add paddle fluid inference libraries
include
(
inference_lib
)
# add paddle fluid inference libraries
...
...
cmake/configure.cmake
浏览文件 @
00463fdf
...
@@ -56,10 +56,6 @@ if(NOT CMAKE_CROSSCOMPILING)
...
@@ -56,10 +56,6 @@ if(NOT CMAKE_CROSSCOMPILING)
set
(
SIMD_FLAG
${
SSE3_FLAG
}
)
set
(
SIMD_FLAG
${
SSE3_FLAG
}
)
endif
()
endif
()
endif
()
endif
()
if
(
UNIX AND NOT APPLE
)
# except apple from nix*Os family
set
(
LINUX TRUE
)
endif
(
UNIX AND NOT APPLE
)
if
(
NOT WITH_GOLANG
)
if
(
NOT WITH_GOLANG
)
add_definitions
(
-DPADDLE_WITHOUT_GOLANG
)
add_definitions
(
-DPADDLE_WITHOUT_GOLANG
)
...
...
cmake/cudnn.cmake
浏览文件 @
00463fdf
...
@@ -25,8 +25,25 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS
...
@@ -25,8 +25,25 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS
$ENV{CUDNN_ROOT}
$ENV{CUDNN_ROOT}
$ENV{CUDNN_ROOT}/lib64
$ENV{CUDNN_ROOT}/lib64
$ENV{CUDNN_ROOT}/lib
$ENV{CUDNN_ROOT}/lib
/usr/lib
)
/usr/lib
find_library
(
CUDNN_LIBRARY NAMES libcudnn.so libcudnn.dylib
# libcudnn_static.a
${
CUDA_TOOLKIT_ROOT_DIR
}
${
CUDA_TOOLKIT_ROOT_DIR
}
/lib/x64
)
set
(
CUDNN_LIB_NAME
""
)
if
(
LINUX
)
set
(
CUDNN_LIB_NAME
"libcudnn.so"
)
endif
(
LINUX
)
if
(
WIN32
)
# only support cudnn7
set
(
CUDNN_LIB_NAME
"cudnn.lib"
"cudnn64_7.dll"
)
endif
(
WIN32
)
if
(
Apple
)
set
(
CUDNN_LIB_NAME
"libcudnn.dylib"
"libcudnn.so"
)
endif
(
Apple
)
find_library
(
CUDNN_LIBRARY NAMES
${
CUDNN_LIB_NAME
}
# libcudnn_static.a
PATHS
${
CUDNN_CHECK_LIBRARY_DIRS
}
${
CUDNN_INCLUDE_DIR
}
${
__libpath_hist
}
PATHS
${
CUDNN_CHECK_LIBRARY_DIRS
}
${
CUDNN_INCLUDE_DIR
}
${
__libpath_hist
}
NO_DEFAULT_PATH
NO_DEFAULT_PATH
DOC
"Path to cuDNN library."
)
DOC
"Path to cuDNN library."
)
...
...
cmake/flags.cmake
浏览文件 @
00463fdf
...
@@ -142,6 +142,11 @@ else()
...
@@ -142,6 +142,11 @@ else()
${
GPU_COMMON_FLAGS
}
)
${
GPU_COMMON_FLAGS
}
)
endif
()
endif
()
if
(
UNIX AND NOT APPLE
)
# except apple from nix*Os family
set
(
LINUX TRUE
)
endif
(
UNIX AND NOT APPLE
)
foreach
(
flag
${
COMMON_FLAGS
}
)
foreach
(
flag
${
COMMON_FLAGS
}
)
safe_set_cflag
(
CMAKE_C_FLAGS
${
flag
}
)
safe_set_cflag
(
CMAKE_C_FLAGS
${
flag
}
)
...
...
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
00463fdf
...
@@ -99,12 +99,13 @@ else()
...
@@ -99,12 +99,13 @@ else()
cc_library
(
executor SRCS executor.cc DEPS op_registry device_context scope framework_proto glog lod_rank_table feed_fetch_method
)
cc_library
(
executor SRCS executor.cc DEPS op_registry device_context scope framework_proto glog lod_rank_table feed_fetch_method
)
endif
()
endif
()
if
(
NOT WIN32
)
cc_library
(
parallel_executor SRCS parallel_executor.cc DEPS
cc_library
(
parallel_executor SRCS parallel_executor.cc DEPS
threaded_ssa_graph_executor scope_buffered_ssa_graph_executor
threaded_ssa_graph_executor scope_buffered_ssa_graph_executor
graph graph_viz_pass multi_devices_graph_pass
graph graph_viz_pass multi_devices_graph_pass
multi_devices_graph_print_pass multi_devices_graph_check_pass
multi_devices_graph_print_pass multi_devices_graph_check_pass
fast_threaded_ssa_graph_executor
)
fast_threaded_ssa_graph_executor
)
endif
()
# NOT WIN32
cc_library
(
prune SRCS prune.cc DEPS framework_proto
)
cc_library
(
prune SRCS prune.cc DEPS framework_proto
)
cc_test
(
prune_test SRCS prune_test.cc DEPS op_info prune recurrent_op device_context
)
cc_test
(
prune_test SRCS prune_test.cc DEPS op_info prune recurrent_op device_context
)
...
...
paddle/fluid/operators/CMakeLists.txt
浏览文件 @
00463fdf
...
@@ -84,6 +84,15 @@ function(op_library TARGET)
...
@@ -84,6 +84,15 @@ function(op_library TARGET)
message
(
FATAL_ERROR
"The op library
${
TARGET
}
should contains at least one .cc file"
)
message
(
FATAL_ERROR
"The op library
${
TARGET
}
should contains at least one .cc file"
)
endif
()
endif
()
#remove windows unsupported op
if
(
WIN32
)
foreach
(
windows_unsupport_op
"nccl_op"
"gen_nccl_id_op"
)
if
(
"
${
TARGET
}
"
STREQUAL
"
${
windows_unsupport_op
}
"
)
return
()
endif
()
endforeach
()
endif
(
WIN32
)
list
(
LENGTH op_library_DEPS op_library_DEPS_len
)
list
(
LENGTH op_library_DEPS op_library_DEPS_len
)
if
(
${
op_library_DEPS_len
}
GREATER 0
)
if
(
${
op_library_DEPS_len
}
GREATER 0
)
set
(
DEPS_OPS
${
TARGET
}
${
DEPS_OPS
}
PARENT_SCOPE
)
set
(
DEPS_OPS
${
TARGET
}
${
DEPS_OPS
}
PARENT_SCOPE
)
...
@@ -181,19 +190,19 @@ function(op_library TARGET)
...
@@ -181,19 +190,19 @@ function(op_library TARGET)
endfunction
()
endfunction
()
add_subdirectory
(
math
)
add_subdirectory
(
math
)
if
(
NOT WIN32
)
add_subdirectory
(
nccl
)
add_subdirectory
(
nccl
)
if
(
WITH_GPU
)
if
(
WITH_GPU
)
op_library
(
nccl_op DEPS nccl_common
)
op_library
(
nccl_op DEPS nccl_common
)
file
(
APPEND
${
pybind_file
}
"USE_CUDA_ONLY_OP(ncclAllReduce);
\n
"
)
file
(
APPEND
${
pybind_file
}
"USE_CUDA_ONLY_OP(ncclAllReduce);
\n
"
)
else
()
else
()
set
(
DEPS_OPS
${
DEPS_OPS
}
nccl_op
)
set
(
DEPS_OPS
${
DEPS_OPS
}
nccl_op
)
endif
()
endif
()
endif
()
# NOT WIN32
set
(
DISTRIBUTE_DEPS
""
)
set
(
DISTRIBUTE_DEPS
""
)
if
(
WITH_DISTRIBUTE
)
if
(
WITH_DISTRIBUTE
)
add_subdirectory
(
distributed
)
add_subdirectory
(
distributed
)
set
(
DISTRIBUTE_DEPS
""
)
set
(
DISTRIBUTE_DEPS
""
)
if
(
WITH_GRPC
)
if
(
WITH_GRPC
)
set
(
DISTRIBUTE_DEPS sendrecvop_grpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf node
)
set
(
DISTRIBUTE_DEPS sendrecvop_grpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf node
)
...
@@ -222,7 +231,7 @@ if(WITH_DISTRIBUTE)
...
@@ -222,7 +231,7 @@ if(WITH_DISTRIBUTE)
#set_source_files_properties(send_recv_op_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
#set_source_files_properties(send_recv_op_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
#cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS prefetch_op send_op
#cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS prefetch_op send_op
# listen_and_serv_op sum_op executor SERIAL)
# listen_and_serv_op sum_op executor SERIAL)
if
(
WITH_GPU
)
if
(
WITH_GPU
AND NOT WIN32
)
set_source_files_properties
(
test_send_nccl_id.cc PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
set_source_files_properties
(
test_send_nccl_id.cc PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
cc_test
(
test_send_nccl_id SRCS test_send_nccl_id.cc DEPS listen_and_serv_op
${
DISTRIBUTE_DEPS
}
executor SERIAL
)
cc_test
(
test_send_nccl_id SRCS test_send_nccl_id.cc DEPS listen_and_serv_op
${
DISTRIBUTE_DEPS
}
executor SERIAL
)
if
(
WITH_GRPC
)
if
(
WITH_GRPC
)
...
@@ -233,7 +242,7 @@ if(WITH_DISTRIBUTE)
...
@@ -233,7 +242,7 @@ if(WITH_DISTRIBUTE)
set_source_files_properties
(
gen_nccl_id_op.cc PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
set_source_files_properties
(
gen_nccl_id_op.cc PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
else
()
else
()
set
(
DEPS_OPS
${
DEPS_OPS
}
gen_nccl_id_op
)
set
(
DEPS_OPS
${
DEPS_OPS
}
gen_nccl_id_op
)
endif
()
endif
()
# WITH_GPU AND NOT WIN32
else
()
else
()
set
(
DEPS_OPS
${
DEPS_OPS
}
checkpoint_notify_op prefetch_op recv_op listen_and_serv_op send_op send_barrier_op fetch_barrier_op gen_nccl_id_op
)
set
(
DEPS_OPS
${
DEPS_OPS
}
checkpoint_notify_op prefetch_op recv_op listen_and_serv_op send_op send_barrier_op fetch_barrier_op gen_nccl_id_op
)
endif
()
endif
()
...
@@ -331,5 +340,7 @@ cc_test(beam_search_op_test SRCS beam_search_op_test.cc DEPS lod_tensor beam_sea
...
@@ -331,5 +340,7 @@ cc_test(beam_search_op_test SRCS beam_search_op_test.cc DEPS lod_tensor beam_sea
cc_test
(
strided_memcpy_test SRCS strided_memcpy_test.cc DEPS tensor memory
)
cc_test
(
strided_memcpy_test SRCS strided_memcpy_test.cc DEPS tensor memory
)
cc_test
(
save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op
)
cc_test
(
save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op
)
cc_test
(
save_load_combine_op_test SRCS save_load_combine_op_test.cc DEPS save_combine_op load_combine_op
)
cc_test
(
save_load_combine_op_test SRCS save_load_combine_op_test.cc DEPS save_combine_op load_combine_op
)
if
(
NOT WIN32
)
nv_test
(
nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context
)
nv_test
(
nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context
)
endif
()
nv_test
(
dropout_op_test SRCS dropout_op_test.cc DEPS dropout_op tensor
)
nv_test
(
dropout_op_test SRCS dropout_op_test.cc DEPS dropout_op tensor
)
paddle/fluid/operators/nccl/CMakeLists.txt
浏览文件 @
00463fdf
if
(
WITH_GPU
)
if
(
WITH_GPU
AND NOT WIN32
)
nv_library
(
nccl_common SRCS nccl_gpu_common.cc DEPS device_context operator
)
nv_library
(
nccl_common SRCS nccl_gpu_common.cc DEPS device_context operator
)
endif
()
endif
()
paddle/fluid/platform/dynload/CMakeLists.txt
浏览文件 @
00463fdf
...
@@ -3,7 +3,7 @@ cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags enforce)
...
@@ -3,7 +3,7 @@ cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags enforce)
list
(
APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc
)
list
(
APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc
)
# There is no macOS version of NCCL.
# There is no macOS version of NCCL.
if
(
NOT APPLE
)
if
(
NOT APPLE
AND NOT WIN32
)
list
(
APPEND CUDA_SRCS nccl.cc
)
list
(
APPEND CUDA_SRCS nccl.cc
)
endif
()
endif
()
...
...
paddle/fluid/platform/enforce.h
浏览文件 @
00463fdf
...
@@ -44,7 +44,7 @@ limitations under the License. */
...
@@ -44,7 +44,7 @@ limitations under the License. */
#include "paddle/fluid/platform/dynload/cublas.h"
#include "paddle/fluid/platform/dynload/cublas.h"
#include "paddle/fluid/platform/dynload/cudnn.h"
#include "paddle/fluid/platform/dynload/cudnn.h"
#include "paddle/fluid/platform/dynload/curand.h"
#include "paddle/fluid/platform/dynload/curand.h"
#if
ndef __APPLE__
#if
!defined(__APPLE__) and !defined(_WIN32)
#include "paddle/fluid/platform/dynload/nccl.h"
#include "paddle/fluid/platform/dynload/nccl.h"
#endif // __APPLE__
#endif // __APPLE__
#endif // PADDLE_WITH_CUDA
#endif // PADDLE_WITH_CUDA
...
@@ -205,7 +205,7 @@ inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error(
...
@@ -205,7 +205,7 @@ inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error(
#endif
#endif
}
}
#if
ndef __APPLE__
#if
!defined(__APPLE__) and !defined(_WIN32)
template
<
typename
...
Args
>
template
<
typename
...
Args
>
inline
typename
std
::
enable_if
<
sizeof
...(
Args
)
!=
0
,
void
>::
type
throw_on_error
(
inline
typename
std
::
enable_if
<
sizeof
...(
Args
)
!=
0
,
void
>::
type
throw_on_error
(
ncclResult_t
stat
,
const
Args
&
...
args
)
{
ncclResult_t
stat
,
const
Args
&
...
args
)
{
...
@@ -221,7 +221,7 @@ inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error(
...
@@ -221,7 +221,7 @@ inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error(
#endif
#endif
}
}
}
}
#endif // __APPLE__
#endif // __APPLE__
and windows
#endif // PADDLE_WITH_CUDA
#endif // PADDLE_WITH_CUDA
template
<
typename
T
>
template
<
typename
T
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录