Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5b3c7ee7
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
未验证
提交
5b3c7ee7
编写于
3月 15, 2023
作者:
W
Weilong Wu
提交者:
GitHub
3月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support gather test on prim and cinn (#51376)
* support gather test on prim and cinn * reset timeout for gather
上级
2d9e103e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
paddle/fluid/prim/api/composite_backward/composite_backward_api.h
...luid/prim/api/composite_backward/composite_backward_api.h
+5
-1
python/paddle/fluid/tests/unittests/CMakeLists.txt
python/paddle/fluid/tests/unittests/CMakeLists.txt
+3
-2
python/paddle/fluid/tests/unittests/test_gather_op.py
python/paddle/fluid/tests/unittests/test_gather_op.py
+2
-1
未找到文件。
paddle/fluid/prim/api/composite_backward/composite_backward_api.h
浏览文件 @
5b3c7ee7
...
@@ -59,7 +59,11 @@ void gather_grad(const Tensor& x,
...
@@ -59,7 +59,11 @@ void gather_grad(const Tensor& x,
std
::
vector
<
int
>
reverse_perm
(
tmp_perm
);
std
::
vector
<
int
>
reverse_perm
(
tmp_perm
);
// make origin ranks
// make origin ranks
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
tmp_perm
.
size
());
++
i
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
tmp_perm
.
size
());
++
i
)
{
reverse_perm
[
tmp_perm
[
i
]]
=
i
;
if
(
tmp_perm
[
i
]
>=
0
)
{
reverse_perm
[
tmp_perm
[
i
]]
=
i
;
}
else
{
reverse_perm
[
tmp_perm
[
i
]
+
tmp_perm
.
size
()]
=
i
;
}
}
}
// transpose out_grad and zero grad to target rank.
// transpose out_grad and zero grad to target rank.
...
...
python/paddle/fluid/tests/unittests/CMakeLists.txt
浏览文件 @
5b3c7ee7
...
@@ -982,7 +982,7 @@ set_tests_properties(test_matmul_op PROPERTIES TIMEOUT 120)
...
@@ -982,7 +982,7 @@ set_tests_properties(test_matmul_op PROPERTIES TIMEOUT 120)
set_tests_properties
(
test_nearest_interp_v2_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_nearest_interp_v2_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_trilinear_interp_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_trilinear_interp_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_bicubic_interp_v2_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_bicubic_interp_v2_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_gather_op PROPERTIES TIMEOUT
18
0
)
set_tests_properties
(
test_gather_op PROPERTIES TIMEOUT
20
0
)
set_tests_properties
(
test_static_save_load PROPERTIES TIMEOUT 250
)
set_tests_properties
(
test_static_save_load PROPERTIES TIMEOUT 250
)
set_tests_properties
(
test_pylayer_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_pylayer_op PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_paddle_save_load_binary PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_paddle_save_load_binary PROPERTIES TIMEOUT 120
)
...
@@ -1217,7 +1217,8 @@ set(TEST_CINN_OPS
...
@@ -1217,7 +1217,8 @@ set(TEST_CINN_OPS
test_transpose_op
test_transpose_op
test_reshape_op
test_reshape_op
test_mean_op
test_mean_op
test_unsqueeze2_op
)
test_unsqueeze2_op
test_gather_op
)
foreach
(
TEST_CINN_OPS
${
TEST_CINN_OPS
}
)
foreach
(
TEST_CINN_OPS
${
TEST_CINN_OPS
}
)
if
(
WITH_CINN
)
if
(
WITH_CINN
)
...
...
python/paddle/fluid/tests/unittests/test_gather_op.py
浏览文件 @
5b3c7ee7
...
@@ -35,6 +35,7 @@ class TestGatherOp(OpTest):
...
@@ -35,6 +35,7 @@ class TestGatherOp(OpTest):
self
.
op_type
=
"gather"
self
.
op_type
=
"gather"
self
.
python_api
=
paddle
.
gather
self
.
python_api
=
paddle
.
gather
self
.
config
()
self
.
config
()
self
.
prim_op_type
=
"prim"
xnp
=
np
.
random
.
random
(
self
.
x_shape
).
astype
(
self
.
x_type
)
xnp
=
np
.
random
.
random
(
self
.
x_shape
).
astype
(
self
.
x_type
)
self
.
inputs
=
{
self
.
inputs
=
{
'X'
:
xnp
,
'X'
:
xnp
,
...
@@ -46,7 +47,7 @@ class TestGatherOp(OpTest):
...
@@ -46,7 +47,7 @@ class TestGatherOp(OpTest):
self
.
check_output
(
check_eager
=
True
)
self
.
check_output
(
check_eager
=
True
)
def
test_check_grad
(
self
):
def
test_check_grad
(
self
):
self
.
check_grad
([
'X'
],
'Out'
,
check_eager
=
True
)
self
.
check_grad
([
'X'
],
'Out'
,
check_eager
=
True
,
check_prim
=
True
)
def
config
(
self
):
def
config
(
self
):
"""
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录