-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Complex OP】No.17 complex pow op #57645
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@GGBond8488 您好 CI 都过了,麻烦 review 下 |
@@ -457,6 +459,8 @@ PD_REGISTER_KERNEL(pow_double_grad, | |||
CPU, | |||
ALL_LAYOUT, | |||
phi::PowDoubleGradKernel, | |||
phi::dtype::complex<float>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里注册了二阶和三阶反向的复数数据类型,但是好像没有新增对应的复数逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这里先取消二阶和三阶注册看下,后面再提 PR 来实现
取消 with_Complex 注册 CI 出现了以下的错误,我理解这两个 kernel 应该没有关联分开注册的为什么会出现这样的错误。
|
d606258
to
747570c
Compare
这个 PR 以及 #57661 都存在 二阶 三阶导 不注册 WITH_COMPLEX 都会报找不到 kernel 的错误。 |
直接加会导致二阶和三阶反向计算错误的,目前没有针对高阶的反向自动检测,高阶反向都是手写检测的。应该是有单测跑到了对应的二阶三阶反向,可以看看是哪里跑到高阶的pow复数反向了 |
最开始我是对二阶三阶加了 WITH_COMPLEX 注册,但是没实现复数逻辑,这个时候 CI 没有报错的。但是后面因为我把二阶、三阶注册取消了WITH_COMPLEX而只留下一阶导的 WITH_COMPLEX ,这时候会报找不到二阶、三阶导的 kernel 。 |
没报错是因为单测里面没有对高阶的自动微分的检测,专门针对高阶自动微分的都是手写case,手写梯度测试的,没有包含复数的,所以没有报错。还是应该要看看为什么会跑到了复数pow的二阶和三阶,或是补全二阶和三阶的复数反向 |
我现在是想这个 PR先合入一阶导的,二阶三阶的之后再完成。我刚刚看了一下这个 PR 也是只注册了高阶导数没有实现逻辑,这样的话也需要补充这个 sigmoid 的实现逻辑 |
Sorry to inform you that a183aff's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
可以先跳过高阶梯度,但是pow这个需要也支持指数为复数的场景,具体可以参考https://zh.wikipedia.org/wiki/%E6%AC%A7%E6%8B%89%E5%85%AC%E5%BC%8F |
Sorry to inform you that 3fc1457's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@GGBond8488 您好,我有一个问题如果指数为 complex,底数为 float 的话,结果求得的是 complex 还是 float 呢? |
complex |
我昨天测试了一下 paddle 的话输出的数据类型是与底数的数据类型相同的,这个有没有适当的方法可以解决 下面这个例子
|
改pow以及 elementwise_pow的infermeta函数(可以在ops.yaml里面找函数名),这种场景,输出应该是complex |
好的,我尝试一下 |
9050b5a
to
482d02d
Compare
482d02d
to
bd2b6de
Compare
|
Sorry to inform you that fd6ab93's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR types
Others
PR changes
OPs
Description
support complex for pow op
#56145