Skip to content
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

【pir】modify test_case.py #60976

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

xiaoguoguo626807
Copy link
Contributor

PR types

others

PR changes

others

Description

pcard-67164

修复子block 中调用append_backward的样例

Copy link

paddle-bot bot commented Jan 19, 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.

true_block.size(),
0u,
phi::errors::PreconditionNotMet(
"The true block must have at least one op yield op."));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"The true block must have at least one op yield op."));
"The true block must have at least one op (inlcuding yield op)."));

false_block.size(),
0u,
phi::errors::PreconditionNotMet(
"The false block must have at least one op yield op."));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"The false block must have at least one op yield op."));
"The false block must have at least one op(including yield op)."));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续提pr 优化

(sub block nest should Add on demand to aviod block copy)
'''
total_ops = []
if block.parent_block is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

这里 total 的语义是只包括入参block的父亲和祖父 block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

理论上是所有的祖block ,但是为了避免使用while,造成block 的拷贝,只限制了两层

(*this)->region(0).size()));
if ((*this)->region(1).front().size() > 0) {
auto &false_last_op = (*this)->region(1).front().back();
VLOG(4) << "Start Verifying false branch.";
Copy link
Contributor

Choose a reason for hiding this comment

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

false branch 的 verify 建议放在最上面的 if ((*this)->num_results() != 0) 分支语句之外,因为我们要求 if 分支不能只有一个分支,现在的逻辑下,如果 num_results == 0,这个要求就检查不到了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个功能是为了在num_results= 0 的时候跳过检查,允许if 无yield op

@xiaoguoguo626807 xiaoguoguo626807 merged commit 483d377 into PaddlePaddle:develop Jan 22, 2024
29 checks passed
@xiaoguoguo626807 xiaoguoguo626807 deleted the test_case branch January 22, 2024 10:17
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.

None yet

3 participants