Skip to content

【complex op No.8】add complex support for Rsqrt - #63720

Closed
zbt78 wants to merge 9 commits into
PaddlePaddle:developfrom
zbt78:rsqrt-cp
Closed

zbt78 wants to merge 9 commits into
PaddlePaddle:developfrom
zbt78:rsqrt-cp

Conversation

@zbt78

@zbt78 zbt78 commented Apr 21, 2024

Copy link
Copy Markdown
Contributor

PR Category

Others

PR Types

New features

Description

add complex support for Rsqrt

@paddle-bot

paddle-bot Bot commented Apr 21, 2024

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot Bot added the contributor External developers label Apr 21, 2024
@paddle-ci-bot

paddle-ci-bot Bot commented Apr 29, 2024

Copy link
Copy Markdown

Sorry to inform you that a468601's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@paddle-ci-bot

paddle-ci-bot Bot commented May 17, 2024

Copy link
Copy Markdown

Sorry to inform you that 1fd3797's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

'float32',
'float64',
'complex64',
'complex128',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

docstring也添加上复数的两个类型

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

self.enable_cinn = False


class TestRsqrt_Complex64(TestRsqrt):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

没有complex128类型的test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread test/legacy_test/test_activation_op.py Outdated
np.testing.assert_allclose(ddx.numpy(), expected_ddx, rtol=1e-3)


class TestRsqrt_Complex128(TestRsqrt):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

是不是应该继承 TestRsqrt_Complex64

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread test/legacy_test/test_activation_op.py Outdated
)

def test_grad_grad(self):
paddle.disable_static()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

建议使用这种方式控制动态图下运行:

with dynamic_guard():

def init_dtype(self):
self.dtype = np.complex64

def test_check_grad(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

GPU单测没运行,加下在GPU下运行的单测

['X'],
'Out',
check_pir=True,
max_relative_error=0.007,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个设置有点大,看能否改小点

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

测试的时候误差是0.006多,这里设成了0.007

@paddle-ci-bot

paddle-ci-bot Bot commented Jun 10, 2024

Copy link
Copy Markdown

Sorry to inform you that c957264's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@paddle-ci-bot

paddle-ci-bot Bot commented Jun 19, 2024

Copy link
Copy Markdown

Sorry to inform you that 1beb392's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@paddle-bot paddle-bot Bot closed this Jun 24, 2025
@paddle-bot

paddle-bot Bot commented Jun 25, 2025

Copy link
Copy Markdown

Since you haven't replied for more than a year, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过一年未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants