Skip to content

[PIR]Fix tests #65911

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

Merged
merged 3 commits into from
Jul 12, 2024
Merged

[PIR]Fix tests #65911

merged 3 commits into from
Jul 12, 2024

Conversation

changeyoung98
Copy link
Contributor

PR Category

Execute Infrastructure

PR Types

Not User Facing

Description

pcard-67164
Fix tests

Copy link

paddle-bot bot commented Jul 10, 2024

你的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.

Comment on lines 4438 to 4444
if convert_dtype(x.dtype) == 'bool' and not x.stop_gradient:
raise ValueError(
"When the data type of input 'x' for expand_as is bool, "
"you must set its stop_gradient to be False by "
"some_var.stop_gradient = True, supporting "
"some_var as the input 'x'."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个检查最好只在pir mode下做,否则会影响动态图性能。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个我在CI的时候遇到了,现在是联系了泽宇,他修改了baseline。欢哥是希望不影响动态图的性能吗?

Comment on lines -68 to -79
def TestRuntimeErrorStaticMode():
paddle.enable_static()
input_pd = paddle.to_tensor(
np.random.random([1, 2]).astype(np.float32)
)
input_pd.grad = paddle.to_tensor(
np.random.random([1, 2]).astype(np.float32)
)
clip_grad_value_(input_pd, clip_value=1)
paddle.disable_static()

self.assertRaises(RuntimeError, TestRuntimeErrorStaticMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个老静态图是在尝试验证什么类型的报错?TestRuntimeErrorStaticMode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个API是只在动态图下运行的,所以进入api后检测到静态题模式会报runtime error

Copy link
Contributor

Choose a reason for hiding this comment

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

好的

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@changeyoung98 changeyoung98 merged commit 605aa6b into PaddlePaddle:develop Jul 12, 2024
30 of 32 checks passed
@changeyoung98 changeyoung98 deleted the czy-fix branch July 12, 2024 09:33
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Jul 22, 2024
* refine tests

* fix op benchmark

* fix op benchmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants