CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
add inference api:exp_disable_tensorrt_subgraph #61967
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bool continue_run = true; | ||
|
||
for (auto *node : subgraph) { | ||
for (auto tmp_name : node->outputs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const auto& tmp_name : node->outputs) {
@@ -71,10 +71,12 @@ class SubGraphFuser { | |||
SubGraphFuser(Graph *graph, | |||
const NodeInsideSubgraphTeller &teller, | |||
int min_subgraph_size, | |||
std::vector<std::string> trt_exclude_var_names = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::vectorstd::string& trt_exclude_var_names = {},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
@@ -811,6 +811,9 @@ struct PD_INFER_DECL AnalysisConfig { | |||
/// | |||
void Exp_DisableTensorRtOPs(const std::vector<std::string>& ops); | |||
|
|||
void Disable_tensorrt_subgraph( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exp_前缀是不是更好一些?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
@@ -0,0 +1,190 @@ | |||
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2022 -> 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2022 -> 2024
ok
@@ -811,6 +811,8 @@ struct PD_INFER_DECL AnalysisConfig { | |||
/// | |||
void Exp_DisableTensorRtOPs(const std::vector<std::string>& ops); | |||
|
|||
void Exp_tensorrt_subgraph(const std::vector<std::string>& var_name_not_trt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exp_DisableTensorRtSubgraph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
PR types
New features
PR changes
APIs
Description
Pcard-71501
推理新增支持配置支持某些trt子图禁止使用trt推理,使用paddle原生推理,可以定位哪个trt子图出了bug
使用方式:
API参数依据trt子图的输出的name来指定,如果trt子图是多个输出,可随便任一即可。
注意和config.exp_disable_tensorrt_ops()区别,这个是禁止某个op进入trt,config.exp_disable_tensorrt_subgraph()是让trt子图不让TRT推理,而使用paddle-gpu推理。
注意,config.exp_disable_tensorrt_ops()和config.exp_disable_tensorrt_subgraph()的使用顺序,先使用config.exp_disable_tensorrt_ops(),生成了多个trt子图,然后使用config.exp_disable_tensorrt_subgraph(),再确定哪个trt子图用paddle-gpu推理。