Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
85cbd556
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
85cbd556
编写于
2月 23, 2021
作者:
L
Leo Chen
提交者:
GitHub
2月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix compilation problem (#31100)
Fix compilation problem (#31100)
上级
5cb20f30
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
34 addition
and
25 deletion
+34
-25
cmake/external/ascend.cmake
cmake/external/ascend.cmake
+14
-18
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+3
-0
cmake/third_party.cmake
cmake/third_party.cmake
+6
-1
paddle/fluid/framework/garbage_collector.cc
paddle/fluid/framework/garbage_collector.cc
+2
-1
paddle/fluid/framework/garbage_collector.h
paddle/fluid/framework/garbage_collector.h
+2
-1
paddle/fluid/operators/elementwise/CMakeLists.txt
paddle/fluid/operators/elementwise/CMakeLists.txt
+3
-0
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+2
-2
paddle/fluid/platform/stream/cuda_stream.cc
paddle/fluid/platform/stream/cuda_stream.cc
+1
-1
paddle/fluid/platform/stream/cuda_stream.h
paddle/fluid/platform/stream/cuda_stream.h
+1
-1
未找到文件。
cmake/external/ascend.cmake
浏览文件 @
85cbd556
...
@@ -57,28 +57,24 @@ if(WITH_ASCEND)
...
@@ -57,28 +57,24 @@ if(WITH_ASCEND)
SET_PROPERTY
(
TARGET atlas_acl PROPERTY IMPORTED_LOCATION
${
atlas_acl_lib
}
)
SET_PROPERTY
(
TARGET atlas_acl PROPERTY IMPORTED_LOCATION
${
atlas_acl_lib
}
)
add_custom_target
(
extern_ascend DEPENDS ascend_ge ascend_graph atlas_acl
)
add_custom_target
(
extern_ascend DEPENDS ascend_ge ascend_graph atlas_acl
)
endif
()
elseif
(
WITH_ASCEND_CL
)
if
(
WITH_ASCEND_CL
)
set
(
ASCEND_ATC_DIR
${
ASCEND_DIR
}
/atc/lib64
)
set
(
ASCEND_CL_DIR
${
ASCEND_DIR
}
/ascend-toolkit/latest/fwkacllib/lib64
)
set
(
ASCEND_ACL_DIR
${
ASCEND_DIR
}
/acllib/lib64
)
set
(
STATIC_ACL_LIB
${
ASCEND_ACL_DIR
}
)
set
(
ATLAS_ACL_DIR
${
ASCEND_DIR
}
/ascend-toolkit/latest/fwkacllib/lib64
)
set
(
ascendcl_lib
${
ASCEND_CL_DIR
}
/libascendcl.so
)
set
(
ATLAS_ATC_DIR
${
ASCEND_DIR
}
/ascend-toolkit/latest/fwkacllib/lib64
)
set
(
acl_op_compiler_lib
${
ASCEND_CL_DIR
}
/libacl_op_compiler.so
)
set
(
ASCEND_CL_INC_DIR
${
ASCEND_DIR
}
/ascend-toolkit/latest/fwkacllib/include
)
set
(
atlas_acl_lib
${
ATLAS_ACL_DIR
}
/libascendcl.so
)
set
(
atlas_acl_op_compiler_lib
${
ATLAS_ACL_DIR
}
/libacl_op_compiler.so
)
set
(
ATLAS_ACL_INC_DIR
${
ASCEND_DIR
}
/ascend-toolkit/latest/fwkacllib/include
)
message
(
STATUS
"A
TLAS_ACL_INC_DIR
${
ATLAS_A
CL_INC_DIR
}
"
)
message
(
STATUS
"A
SCEND_CL_INC_DIR
${
ASCEND_
CL_INC_DIR
}
"
)
message
(
STATUS
"A
TLAS_ACL_LIB_DIR
${
ATLAS_A
CL_DIR
}
"
)
message
(
STATUS
"A
SCEND_CL_DIR
${
ASCEND_
CL_DIR
}
"
)
INCLUDE_DIRECTORIES
(
${
A
TLAS_A
CL_INC_DIR
}
)
INCLUDE_DIRECTORIES
(
${
A
SCEND_
CL_INC_DIR
}
)
ADD_LIBRARY
(
a
tlas_a
cl SHARED IMPORTED GLOBAL
)
ADD_LIBRARY
(
a
scend
cl SHARED IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET a
tlas_acl PROPERTY IMPORTED_LOCATION
${
atlas_a
cl_lib
}
)
SET_PROPERTY
(
TARGET a
scendcl PROPERTY IMPORTED_LOCATION
${
ascend
cl_lib
}
)
ADD_LIBRARY
(
a
tlas_a
cl_op_compiler SHARED IMPORTED GLOBAL
)
ADD_LIBRARY
(
acl_op_compiler SHARED IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET a
tlas_acl_op_compiler PROPERTY IMPORTED_LOCATION
${
atlas_
acl_op_compiler_lib
}
)
SET_PROPERTY
(
TARGET a
cl_op_compiler PROPERTY IMPORTED_LOCATION
${
acl_op_compiler_lib
}
)
add_custom_target
(
extern_ascend
DEPENDS atlas_acl atlas_
acl_op_compiler
)
add_custom_target
(
extern_ascend
_cl DEPENDS ascendcl
acl_op_compiler
)
endif
()
endif
()
cmake/external/protobuf.cmake
浏览文件 @
85cbd556
...
@@ -201,6 +201,9 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -201,6 +201,9 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
if
(
WITH_ASCEND AND NOT WITH_ASCEND_CXX11
)
if
(
WITH_ASCEND AND NOT WITH_ASCEND_CXX11
)
SET
(
PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git
)
SET
(
PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git
)
SET
(
PROTOBUF_TAG v3.8.0
)
SET
(
PROTOBUF_TAG v3.8.0
)
elseif
(
WITH_ASCEND_CL AND NOT WITH_ASCEND_CXX11
)
SET
(
PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git
)
SET
(
PROTOBUF_TAG v3.8.0
)
else
()
else
()
SET
(
PROTOBUF_REPOSITORY
${
GIT_URL
}
/protocolbuffers/protobuf.git
)
SET
(
PROTOBUF_REPOSITORY
${
GIT_URL
}
/protocolbuffers/protobuf.git
)
SET
(
PROTOBUF_TAG 9f75c5aa851cd877fb0d93ccc31b8567a6706546
)
SET
(
PROTOBUF_TAG 9f75c5aa851cd877fb0d93ccc31b8567a6706546
)
...
...
cmake/third_party.cmake
浏览文件 @
85cbd556
...
@@ -276,7 +276,12 @@ endif(WITH_BOX_PS)
...
@@ -276,7 +276,12 @@ endif(WITH_BOX_PS)
if
(
WITH_ASCEND OR WITH_ASCEND_CL
)
if
(
WITH_ASCEND OR WITH_ASCEND_CL
)
include
(
external/ascend
)
include
(
external/ascend
)
list
(
APPEND third_party_deps extern_ascend
)
if
(
WITH_ASCEND
)
list
(
APPEND third_party_deps extern_ascend
)
endif
()
if
(
WITH_ASCEND_CL
)
list
(
APPEND third_party_deps extern_ascend_cl
)
endif
()
endif
()
endif
()
if
(
WITH_PSCORE
)
if
(
WITH_PSCORE
)
...
...
paddle/fluid/framework/garbage_collector.cc
浏览文件 @
85cbd556
...
@@ -89,7 +89,8 @@ StreamGarbageCollector::StreamGarbageCollector(const platform::CUDAPlace &place,
...
@@ -89,7 +89,8 @@ StreamGarbageCollector::StreamGarbageCollector(const platform::CUDAPlace &place,
:
GarbageCollector
(
place
,
max_memory_size
)
{
:
GarbageCollector
(
place
,
max_memory_size
)
{
platform
::
CUDADeviceGuard
guard
(
place
.
device
);
platform
::
CUDADeviceGuard
guard
(
place
.
device
);
PADDLE_ENFORCE_CUDA_SUCCESS
(
cudaStreamCreate
(
&
stream_
));
PADDLE_ENFORCE_CUDA_SUCCESS
(
cudaStreamCreate
(
&
stream_
));
callback_manager_
.
reset
(
new
platform
::
StreamCallbackManager
(
stream_
));
callback_manager_
.
reset
(
new
platform
::
StreamCallbackManager
<
cudaStream_t
>
(
stream_
));
}
}
StreamGarbageCollector
::~
StreamGarbageCollector
()
{
StreamGarbageCollector
::~
StreamGarbageCollector
()
{
...
...
paddle/fluid/framework/garbage_collector.h
浏览文件 @
85cbd556
...
@@ -117,7 +117,8 @@ class StreamGarbageCollector : public GarbageCollector {
...
@@ -117,7 +117,8 @@ class StreamGarbageCollector : public GarbageCollector {
private:
private:
cudaStream_t
stream_
;
cudaStream_t
stream_
;
std
::
unique_ptr
<
platform
::
StreamCallbackManager
>
callback_manager_
;
std
::
unique_ptr
<
platform
::
StreamCallbackManager
<
cudaStream_t
>>
callback_manager_
;
};
};
class
CUDAPinnedGarbageCollector
:
public
GarbageCollector
{
class
CUDAPinnedGarbageCollector
:
public
GarbageCollector
{
...
...
paddle/fluid/operators/elementwise/CMakeLists.txt
浏览文件 @
85cbd556
...
@@ -8,4 +8,7 @@ register_operators(DEPS op_version_registry)
...
@@ -8,4 +8,7 @@ register_operators(DEPS op_version_registry)
cc_test
(
test_elementwise_add_op_inplace SRCS test_elementwise_add_op_inplace.cc DEPS op_registry elementwise_add_op scope device_context enforce executor
)
cc_test
(
test_elementwise_add_op_inplace SRCS test_elementwise_add_op_inplace.cc DEPS op_registry elementwise_add_op scope device_context enforce executor
)
cc_test
(
test_elementwise_div_grad_grad SRCS test_elementwise_div_grad_grad.cc DEPS op_registry elementwise_div_op scope device_context enforce executor
)
cc_test
(
test_elementwise_div_grad_grad SRCS test_elementwise_div_grad_grad.cc DEPS op_registry elementwise_div_op scope device_context enforce executor
)
cc_test
(
test_elementwise_add_grad_grad SRCS test_elementwise_add_grad_grad.cc DEPS op_registry elementwise_add_op scope device_context enforce executor
)
cc_test
(
test_elementwise_add_grad_grad SRCS test_elementwise_add_grad_grad.cc DEPS op_registry elementwise_add_op scope device_context enforce executor
)
if
(
WITH_ASCEND_CL
)
cc_test
(
elementwise_op_npu_test SRCS elementwise_op_npu_test.cc DEPS op_registry elementwise_add_op elementwise_sub_op scope device_context enforce executor
)
cc_test
(
elementwise_op_npu_test SRCS elementwise_op_npu_test.cc DEPS op_registry elementwise_add_op elementwise_sub_op scope device_context enforce executor
)
endif
()
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
85cbd556
...
@@ -72,7 +72,7 @@ if(WITH_ASCEND)
...
@@ -72,7 +72,7 @@ if(WITH_ASCEND)
endif
()
endif
()
if
(
WITH_ASCEND_CL
)
if
(
WITH_ASCEND_CL
)
cc_library
(
npu_info SRCS npu_info.cc DEPS gflags glog enforce monitor a
tlas_acl atlas_
acl_op_compiler
)
cc_library
(
npu_info SRCS npu_info.cc DEPS gflags glog enforce monitor a
scendcl
acl_op_compiler
)
endif
()
endif
()
add_subdirectory
(
dynload
)
add_subdirectory
(
dynload
)
...
@@ -105,7 +105,7 @@ nv_library(stream_callback_manager SRCS stream_callback_manager.cc DEPS simple_t
...
@@ -105,7 +105,7 @@ nv_library(stream_callback_manager SRCS stream_callback_manager.cc DEPS simple_t
ENDIF
()
ENDIF
()
IF
(
WITH_ASCEND_CL
)
IF
(
WITH_ASCEND_CL
)
cc_library
(
stream_callback_manager SRCS stream_callback_manager.cc DEPS simple_threadpool enforce
atlas_acl
)
cc_library
(
stream_callback_manager SRCS stream_callback_manager.cc DEPS simple_threadpool enforce
)
ENDIF
()
ENDIF
()
IF
(
WITH_GPU
)
IF
(
WITH_GPU
)
...
...
paddle/fluid/platform/stream/cuda_stream.cc
浏览文件 @
85cbd556
...
@@ -35,7 +35,7 @@ bool CUDAStream::Init(const Place& place, const Priority& priority) {
...
@@ -35,7 +35,7 @@ bool CUDAStream::Init(const Place& place, const Priority& priority) {
PADDLE_ENFORCE_CUDA_SUCCESS
(
PADDLE_ENFORCE_CUDA_SUCCESS
(
cudaStreamCreateWithPriority
(
&
stream_
,
kDefaultFlag
,
0
));
cudaStreamCreateWithPriority
(
&
stream_
,
kDefaultFlag
,
0
));
}
}
callback_manager_
.
reset
(
new
StreamCallbackManager
(
stream_
));
callback_manager_
.
reset
(
new
StreamCallbackManager
<
cudaStream_t
>
(
stream_
));
VLOG
(
3
)
<<
"CUDAStream Init stream: "
<<
stream_
VLOG
(
3
)
<<
"CUDAStream Init stream: "
<<
stream_
<<
", priority: "
<<
static_cast
<
int
>
(
priority
);
<<
", priority: "
<<
static_cast
<
int
>
(
priority
);
return
true
;
return
true
;
...
...
paddle/fluid/platform/stream/cuda_stream.h
浏览文件 @
85cbd556
...
@@ -74,7 +74,7 @@ class CUDAStream final {
...
@@ -74,7 +74,7 @@ class CUDAStream final {
Place
place_
;
Place
place_
;
cudaStream_t
stream_
{
nullptr
};
cudaStream_t
stream_
{
nullptr
};
Priority
priority_
{
Priority
::
kNormal
};
Priority
priority_
{
Priority
::
kNormal
};
std
::
unique_ptr
<
StreamCallbackManager
>
callback_manager_
;
std
::
unique_ptr
<
StreamCallbackManager
<
cudaStream_t
>
>
callback_manager_
;
DISABLE_COPY_AND_ASSIGN
(
CUDAStream
);
DISABLE_COPY_AND_ASSIGN
(
CUDAStream
);
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录