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

[Paddle Inference] clean unused code #48392

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

yuanlehome
Copy link
Contributor

@yuanlehome yuanlehome commented Nov 25, 2022

PR types

Others

PR changes

Others

Describe

clean unused code in inference

  1. remove ir_graph_clean_pass
    ref to PR, ir_graph_clean_pass's job is no longer needed.
  2. remove other unused code
    remove LoadProgramDesc in paddle/fluid/inference/analysis/helper.h, etc.
  3. refine some code
    fix some pass naming conventions, etc.

@paddle-bot
Copy link

paddle-bot bot commented Nov 25, 2022

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

@@ -982,9 +976,6 @@ void AnalysisConfig::Update() {
"but did not have the option -DWITH_CUSTOM_DEVICE compiled."));
#endif
}
if (ir_debug_) {
pass_builder()->TurnOnDebug();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这个会影响到ir_debug吗

Copy link
Contributor Author

@yuanlehome yuanlehome Nov 28, 2022

Choose a reason for hiding this comment

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

后面还有对应逻辑的,不会影响。

jiweibo
jiweibo previously approved these changes Nov 28, 2022
Copy link
Contributor

@jiweibo jiweibo left a comment

Choose a reason for hiding this comment

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

LGTM

zhangjun
zhangjun previously approved these changes Nov 28, 2022
Copy link
Contributor

@zhangjun zhangjun left a comment

Choose a reason for hiding this comment

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

PR描述里面,描述下移除的工作以及移除原因

@@ -115,7 +115,6 @@ class PD_INFER_DECL PaddlePassBuilder {
/// \cond Protected
std::vector<std::string> analysis_passes_{
{"ir_graph_build_pass",
"ir_graph_clean_pass",
Copy link
Contributor

Choose a reason for hiding this comment

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

说明下移除IrInferCleanGraphPass的原因

Copy link
Contributor Author

Choose a reason for hiding this comment

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

说明下移除IrInferCleanGraphPass的原因

ok,thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

删除ir_graph_clean_pass 的逻辑。 #46888

@@ -153,25 +153,6 @@ T &GetFromScope(const framework::Scope &scope, const std::string &name) {
return *var->GetMutable<T>();
}

static framework::proto::ProgramDesc LoadProgramDesc(
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete since this function is unused. The duplicate implementations in ./paddle/fluid/inference/api/analysis_predictor.h . (Only for review )

@@ -36,15 +36,6 @@ using string::PrettyLogEndl;
using string::Style;

IRPassManager::IRPassManager(Argument *argument) {
ARGUMENT_CHECK_FIELD(argument, main_program);
Copy link
Contributor

Choose a reason for hiding this comment

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

explain why delete these code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

explain why delete these code

  1. ARGUMENT_CHECK_FIELD(argument, main_program);
    调用此之前,paddle/fluid/inference/analysis/passes/ir_analysis_pass.cc,有判断逻辑。这一块应该只是为了下一行的创建graph_对象,然而graph_对象并没有被使用过。
  2. 40-47行的删除同上。

@@ -1934,64 +1921,6 @@ bool AnalysisPredictor::LoadProgramDesc() {
return true;
}

bool AnalysisPredictor::LoadParameters() {
Copy link
Contributor

Choose a reason for hiding this comment

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

why delete this funtion? And not delete it in .h ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why delete this funtion? And not delete it in .h ?

Not used. It should also be deleted in .h.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep it.

@yuanlehome yuanlehome dismissed stale reviews from zhangjun and jiweibo via f43b31e November 28, 2022 04:29
Copy link
Contributor

@zhangjun zhangjun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jiweibo jiweibo left a comment

Choose a reason for hiding this comment

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

LGTM

@jiweibo jiweibo merged commit 5de01e8 into PaddlePaddle:develop Nov 30, 2022
yuanlehome added a commit to yuanlehome/Paddle that referenced this pull request Dec 14, 2022
lxsbupt pushed a commit to lxsbupt/Paddle that referenced this pull request Dec 17, 2022
XiaoguangHu01 pushed a commit that referenced this pull request Dec 19, 2022
* [Release2.4] Revert python link prs (#48573)

* Revert "Fix mac link python (#48017)"

This reverts commit 3fa7a73.

* Revert "[Cherry-pick] Fix python link error (#47811)"

This reverts commit ff642c6.

* Update config.go

* [Paddle Inference] Add float_to_half_pass to support  inference with mixed precision (#47993)

* [Inference] optimize some code and fix some bug (#48780)

* clean ir_pass_manager and fix map_depthwise_conv_to_conv_pass

* fix unitest timeout

* [Paddle Inference] clean unused code  (#48392)

* fix

* update

* update

Co-authored-by: Chen Weihang <chenweihang@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.

6 participants