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 ir Backward for prune #59100

Merged
merged 23 commits into from
Nov 20, 2023

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented Nov 17, 2023

PR types

Bug fixes

PR changes

others

Description

pcard-67164

  1. create_backward_prure_set 中使用opresult.first_use() 接口,该接口返回的是最后一次使用该opreslut的算子,导致返回了反向op,与预期不同,因此将此部分代码提到反向op的添加之前处理。 在反向添加之后再查找state确认反向剪枝依赖的输入和输出set
  2. update_backward_structure修改为批量添加一个list
  3. full_like op添加会产生fullop + fulllikeop两个,补充了fullop的update_structure.

修复prhttps://github.com//pull/59036

xiaoguoguo626807 and others added 21 commits August 30, 2023 01:44
Copy link

paddle-bot bot commented Nov 17, 2023

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

if grad is None:
output_grad = paddle.full_like(
output,
1.0,
dtype=output.dtype,
)
fillop = output_grad.get_defining_op()
full_likeop = output_grad.get_defining_op()
Copy link
Contributor

Choose a reason for hiding this comment

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

full_like_opfull_op data_op是不是比full_likeop fullopdataop更自然一些?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后续修改

@xiaoguoguo626807 xiaoguoguo626807 merged commit e05d3e9 into PaddlePaddle:develop Nov 20, 2023
28 checks passed
@xiaoguoguo626807 xiaoguoguo626807 deleted the backward branch November 20, 2023 02:57
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
* tmp

* modify ci bug

* [PIR]Migrate maximum into pir

* Polish code

* add ir_grad of static_gradient

* add test

* modify backward

* modify

* modify segment

---------

Co-authored-by: 0x45f <wangzhen45@baidu.com>
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.

4 participants