Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
8e4c1936
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8e4c1936
编写于
4月 21, 2021
作者:
L
Leo Chen
提交者:
GitHub
4月 21, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NPU] register npu finalize on exit (#32390)
* [NPU] register finalize on exit * fix
上级
ab6f8745
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
4 deletion
+10
-4
paddle/fluid/operators/CMakeLists.txt
paddle/fluid/operators/CMakeLists.txt
+1
-1
paddle/fluid/platform/npu_info.cc
paddle/fluid/platform/npu_info.cc
+2
-0
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+1
-3
python/paddle/fluid/__init__.py
python/paddle/fluid/__init__.py
+6
-0
未找到文件。
paddle/fluid/operators/CMakeLists.txt
浏览文件 @
8e4c1936
...
...
@@ -167,7 +167,7 @@ endif()
if
(
WITH_ASCEND_CL
)
cc_test
(
range_op_npu_test SRCS range_op_npu_test.cc DEPS op_registry range_op scope device_context enforce executor
)
cc_test
(
expand_op_npu_test SRCS expand_op_npu_test.cc DEPS op_registry expand_op scope device_context enforce executor compare_op
)
cc_test
(
expand_op_npu_test SRCS expand_op_npu_test.cc DEPS op_registry expand_op
eigen_cc_function
scope device_context enforce executor compare_op
)
endif
()
set
(
GLOB_OP_LIB
${
OP_LIBRARY
}
CACHE INTERNAL
"Global OP library"
)
...
...
paddle/fluid/platform/npu_info.cc
浏览文件 @
8e4c1936
...
...
@@ -190,6 +190,8 @@ void NPUMemcpySync(void *dst, const void *src, size_t count,
enum
aclrtMemcpyKind
kind
,
size_t
dst_max_count
)
{
// NOTE(zhiqiu): The default max_count is count
dst_max_count
=
dst_max_count
?
dst_max_count
:
count
;
VLOG
(
4
)
<<
dst
<<
" "
<<
dst_max_count
<<
" "
<<
src
<<
" "
<<
count
<<
" "
<<
kind
;
PADDLE_ENFORCE_NPU_SUCCESS
(
aclrtMemcpy
(
dst
,
dst_max_count
,
src
,
count
,
kind
));
}
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
8e4c1936
...
...
@@ -2178,9 +2178,7 @@ All parameter, weight, gradient are variables in Paddle.
#ifdef PADDLE_WITH_ASCEND_CL
m
.
def
(
"get_npu_device_count"
,
platform
::
GetNPUDeviceCount
);
m
.
def
(
"_npu_finalize"
,
[]()
{
platform
::
AclInstance
::
Instance
().
Finalize
();
});
// private interface
m
.
def
(
"npu_finalize"
,
[]()
{
platform
::
AclInstance
::
Instance
().
Finalize
();
});
py
::
class_
<
platform
::
NPUProfConfigWrapper
>
(
m
,
"NPUProfConfigWrapper"
);
...
...
python/paddle/fluid/__init__.py
浏览文件 @
8e4c1936
...
...
@@ -15,6 +15,7 @@
from
__future__
import
print_function
import
os
import
sys
import
atexit
# The legacy core need to be removed before "import core",
# in case of users installing paddlepadde without -U option
...
...
@@ -255,3 +256,8 @@ def __bootstrap__():
monkey_patch_variable
()
__bootstrap__
()
monkey_patch_varbase
()
# NOTE(zhiqiu): register npu_finalize on the exit of Python,
# do some clean up manually.
if
core
.
is_compiled_with_npu
():
atexit
.
register
(
core
.
npu_finalize
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录