Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Add gather_nd tests #1389

Merged
merged 3 commits into from
May 12, 2023
Merged

Add gather_nd tests #1389

merged 3 commits into from
May 12, 2023

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented May 5, 2023

测试部分

From #1378

为gather_nd算子增加新的测试用例

算子类型

  • ElementWise:输入张量索引和输出张量索引之间存在一对一的对应关系
  • Broadcast:输入张量索引和输出张量索引之间存在一对多的对应关系
  • Injective:单射算子,可以将一个输出 axis 映射到一个输入 axis
  • Reduction:输入张量索引和输出张量索引之间存在多对一的对应关系
  • OutFusible:复杂算子,仍然可以将一对一的算子融合到其输出中。
  • kNonFusible:无法融合的算子

Test Cases Checklist

张量维度

  • 1D 张量
  • 2D 张量
  • 3D 张量
  • 4D 张量

special shape

4D 张量 测试如下情况
其中一个维度为 1
其中一个维度小于 1024
其中一个维度大于 1024
向量的所有维度都是 1

张量数据类型

"float32", "float64", "int16", "int32", "int64", "uint8"

index shape

index_shape: [8, j]
j 取尽 1 到 len(x_shape)-1 的所有值

@paddle-bot
Copy link

paddle-bot bot commented May 5, 2023

Thanks for your contribution!

@zrr1999 zrr1999 changed the title test fix bugs and add tests of gather/gather_nd ops May 5, 2023
This was referenced May 6, 2023
@zrr1999 zrr1999 changed the title fix bugs and add tests of gather/gather_nd ops Add gather_nd tests May 6, 2023
@zrr1999 zrr1999 marked this pull request as ready for review May 6, 2023 16:53
@zrr1999
Copy link
Member Author

zrr1999 commented May 9, 2023

您好,麻烦看一下这个报错是怎么回事
xly.bce.baidu.com/paddlepaddle/paddle-cinn/newipipe/detail/8385679/job/22679756/realTimeLog/298

我在本地是可以正常通过的,这里他调用paddle.gather_nd时显示

2023-05-09 00:49:06     return _C_ops.gather_nd(input, index)
2023-05-09 00:49:06 RuntimeError: (NotFound) There are no kernels which are registered in the gather_nd operator.

但是paddle应该是有gather_nd这个kernel的

@FisherWY
Copy link
Contributor

您好,麻烦看一下这个报错是怎么回事 xly.bce.baidu.com/paddlepaddle/paddle-cinn/newipipe/detail/8385679/job/22679756/realTimeLog/298

我在本地是可以正常通过的,这里他调用paddle.gather_nd时显示

2023-05-09 00:49:06     return _C_ops.gather_nd(input, index)
2023-05-09 00:49:06 RuntimeError: (NotFound) There are no kernels which are registered in the gather_nd operator.

但是paddle应该是有gather_nd这个kernel的

在最新编译的wheel包中测试是没有问题的,但cinn-cicinn-gpu-cudnn-off这两个CI用的是2.3.1版本的paddle,这个版本中的gather_nd没有支持uint8类型,因此CI不通过。可以将测试环境的paddle版本降级至paddlepaddle-gpu==2.3.1再做测试,将报错的数据类型先注释掉,日后升级CI环境中的paddle版本后再打开。

@zrr1999
Copy link
Member Author

zrr1999 commented May 10, 2023

好的,明白啦

Copy link
Collaborator

@thisjiang thisjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thisjiang thisjiang merged commit 588c3f8 into PaddlePaddle:develop May 12, 2023
jiahy0825 pushed a commit to jiahy0825/CINN that referenced this pull request May 25, 2023
* add gather_nd tests

* fix bug

* fix bug
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants