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

[JitLayer]Clean some include and polish load program code #43798

Merged
merged 7 commits into from
Jun 28, 2022

Conversation

0x45f
Copy link
Contributor

@0x45f 0x45f commented Jun 23, 2022

PR types

Others

PR changes

Others

Describe

[JitLayer]Clean some include and polish load program code

  1. 清理了部分头文件,将.h中不必要的头文件移到了.cc中
  2. 优化了Load函数的相关逻辑,增加了Place参数,path参数格式为dirname/file_prefix与jit.load保持一致
  3. 重命名了一些函数,删除了不必要的前缀Get,缩短函数名
  4. Layer和CompilationUnit中添加了SetFunction接口,Layer不负责构造Function。现在通过调用MakeFuntion函数进行Funciton的构造然后通过SetFuntion向Layer添加Funtion。后面也可以考虑给Layer添加SetCompilationUnit接口,将各个基础组件解耦

@paddle-bot-old
Copy link

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

@0x45f 0x45f changed the title Polish Layer code [JitLayer]Clean some include and polish load program code Jun 27, 2022
}

const std::vector<std::string> FunctionInfo::GetOutputArgNames() const {
return schema_.GetOutputArgNames();
void FunctionInfo::RemoveFeedFetch() {
Copy link
Contributor

Choose a reason for hiding this comment

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

RemoveFeedFetch 这个函数不适合放到 function_schema.cc 中,可以放到训练框架里

Copy link
Contributor Author

Choose a reason for hiding this comment

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

将提到的几个函数移动到了utils文件内,感谢

@@ -62,6 +76,11 @@ bool Deserializer::IsPersistable(framework::VarDesc* desc_ptr) {
return desc_ptr->Persistable();
}

bool Deserializer::StartWith(const std::string& str,
Copy link
Contributor

Choose a reason for hiding this comment

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

StartWith, EndsWith, ReplaceAll,PdmodelFilePaths这一类应该是属于utils函数,不应该是某个类的成员函数

Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM

@0x45f 0x45f merged commit c9ec950 into PaddlePaddle:develop Jun 28, 2022
@0x45f 0x45f deleted the refine-load branch June 28, 2022 02:53
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