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

[IR] Adapt startup program #54452

Merged
merged 3 commits into from Jun 9, 2023

Conversation

kangguangli
Copy link
Contributor

@kangguangli kangguangli commented Jun 8, 2023

PR types

Others

PR changes

Others

Description

This PR modifies the logic of translate program to adapt the startup program. The startup program is used to initialize the parameters of program. We need to insert a corresponding SetParameterOp for every parameter initialized in startup program.
Currently, for every parameter in ProgramDesc, we will

  1. insert a GetParameterOp if it occurs in inputs of a op first and only first time
  2. insert a SetParameterOp if it occurs in outputs of a op and only last time

Others

Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Jun 8, 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.

// + consant_op for guassian
EXPECT_EQ(op_size, p.Block(0).OpSize() + program->parameters_num() + 3 + 53);

program->Print(std::cout);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest delete cout.

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
program->Print(std::cout);

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修改。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #54499

Copy link
Contributor

@winter-wang winter-wang left a comment

Choose a reason for hiding this comment

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

LGTM

@kangguangli kangguangli merged commit 1681edc into PaddlePaddle:develop Jun 9, 2023
24 of 25 checks passed
@kangguangli kangguangli deleted the adapt_startup_program branch June 26, 2023 12:35
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