Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
666da145
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
666da145
编写于
9月 13, 2021
作者:
Q
Qi Li
提交者:
GitHub
9月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NPU] add npu unit test if title has NPU key word, test=develop (#35566)
上级
66223048
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
9 deletion
+17
-9
paddle/fluid/operators/stack_op_npu.cc
paddle/fluid/operators/stack_op_npu.cc
+2
-2
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+10
-7
python/paddle/fluid/tests/unittests/npu/CMakeLists.txt
python/paddle/fluid/tests/unittests/npu/CMakeLists.txt
+5
-0
未找到文件。
paddle/fluid/operators/stack_op_npu.cc
浏览文件 @
666da145
...
...
@@ -90,9 +90,9 @@ REGISTER_OP_NPU_KERNEL(
paddle
::
operators
::
StackNPUKernel
<
paddle
::
platform
::
float16
>
);
REGISTER_OP_NPU_KERNEL
(
stack_grad
,
paddle
::
operators
::
StackNPUKernel
<
int
>
,
stack_grad
,
paddle
::
operators
::
Stack
Grad
NPUKernel
<
int
>
,
#ifdef PADDLE_WITH_ASCEND_INT64
paddle
::
operators
::
StackNPUKernel
<
int64_t
>
,
paddle
::
operators
::
Stack
Grad
NPUKernel
<
int64_t
>
,
#endif
paddle
::
operators
::
StackGradNPUKernel
<
float
>
,
paddle
::
operators
::
StackGradNPUKernel
<
paddle
::
platform
::
float16
>
);
paddle/scripts/paddle_build.sh
浏览文件 @
666da145
...
...
@@ -1746,11 +1746,14 @@ function parallel_test_base_npu() {
# skipping if no NPU related files changed
if
[
${
SKIP_NPU_TEST
:-
ON
}
==
"ON"
]
;
then
fetch_upstream_develop_if_not_exist
# get npu py or npu cc file changes
git diff
--name-only
remotes/upstream/
$BRANCH
npu_cc_changes
=
$(
git diff
--name-only
remotes/upstream/
$BRANCH
|
grep
"op_npu.cc"
||
true
)
npu_py_changes
=
$(
git diff
--name-only
remotes/upstream/
$BRANCH
|
grep
"op_npu.py"
||
true
)
if
[
-z
"
${
npu_cc_changes
}
"
]
&&
[
-z
"
${
npu_py_changes
}
"
]
;
then
echo
"NO NPU operators files changed, skip NPU unit tests!"
# get PR name
npu_pr_tile
=
$(
curl https://github.com/PaddlePaddle/Paddle/pull/
${
GIT_PR_ID
}
2>/dev/null |
grep
"<title>"
|
grep
"[NPU]"
||
true
)
if
[
-z
"
${
npu_cc_changes
}
"
]
&&
[
-z
"
${
npu_py_changes
}
"
]
&&
[
-z
"
${
npu_pr_tile
}
"
]
;
then
echo
"NO NPU operators files changed and no '[NPU]' found in PR title, skip NPU unit tests!"
exit
0
fi
fi
...
...
@@ -1797,10 +1800,10 @@ set +x
if
[
${
TIMEOUT_DEBUG_HELP
:-
OFF
}
==
"ON"
]
;
then
bash
$PADDLE_ROOT
/tools/timeout_debug_help.sh
"
$failed_test_lists
"
# cat logs for tiemout uts which killed by ctest
fi
read
need_retry_ut_str
<<<
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
need_retry_ut_str
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
need_retry_ut_arr
=(
${
need_retry_ut_str
}
)
need_retry_ut_count
=
${#
need_retry_ut_arr
[@]
}
re
ad
retry_unittests
<<<
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
re
try_unittests
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
while
(
[
$exec_times
-lt
$retry_time
]
)
do
if
[[
"
${
exec_times
}
"
==
"0"
]]
;
then
...
...
@@ -1810,7 +1813,7 @@ set +x
is_retry_execuate
=
1
fi
elif
[[
"
${
exec_times
}
"
==
"1"
]]
;
then
read
need_retry_ut_str
<<<
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
need_retry_ut_str
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
need_retry_ut_arr
=(
${
need_retry_ut_str
}
)
need_retry_ut_count
=
${#
need_retry_ut_arr
[@]
}
if
[
$need_retry_ut_count
-lt
$exec_retry_threshold
]
;
then
...
...
@@ -1828,7 +1831,7 @@ set +x
if
[[
"
${
failed_test_lists
}
"
==
""
]]
;
then
break
else
re
ad
retry_unittests
<<<
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
re
try_unittests
=
$(
echo
"
$failed_test_lists
"
|
grep
-oEi
"
\-
.+
\(
.+
\)
"
|
sed
's/(.\+)//'
|
sed
's/- //'
)
fi
fi
echo
"========================================="
...
...
@@ -1838,7 +1841,7 @@ set +x
echo
"
${
retry_unittests
}
"
for
line
in
${
retry_unittests
[@]
}
;
do
read
tmp_one_tmp
<<<
"
$(
echo
$single_card_tests
|
grep
-oEi
$line
)
"
tmp_one_tmp
=
"
$(
echo
$single_card_tests
|
grep
-oEi
$line
)
"
if
[[
"
$tmp_one_tmp
"
!=
""
]]
;
then
if
[[
"
$one_card_retry
"
==
""
]]
;
then
...
...
python/paddle/fluid/tests/unittests/npu/CMakeLists.txt
浏览文件 @
666da145
...
...
@@ -13,4 +13,9 @@ if (WITH_ASCEND_CL)
set_tests_properties
(
test_amp_check_finite_and_scale_op_npu PROPERTIES LABELS
"RUN_TYPE=EXCLUSIVE"
)
set_tests_properties
(
test_flags_check_nan_inf_npu PROPERTIES LABELS
"RUN_TYPE=EXCLUSIVE"
)
set_tests_properties
(
test_float_status_op_npu PROPERTIES LABELS
"RUN_TYPE=EXCLUSIVE"
)
# Note: the following test cases has running time more than 120s
set_tests_properties
(
test_nearest_interp_op_npu PROPERTIES TIMEOUT 200
)
set_tests_properties
(
test_nearest_interp_v2_op_npu PROPERTIES TIMEOUT 200
)
set_tests_properties
(
test_stack_op_npu PROPERTIES TIMEOUT 300
)
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录