-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
add inference api:exp_specify_tensorrt_subgraph_precision #62402
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
bool enable_fp16 = false; | ||
if (precision_mode == phi::DataType::FLOAT16) enable_fp16 = true; | ||
auto enable_int8 = Get<bool>("enable_int8"); | ||
|
||
for (auto para : parameters) { |
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 (auto para : parameters) { | |
for (const auto& para : parameters) { |
} | ||
} | ||
|
||
for (auto para : parameters) { |
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 (auto para : parameters) { | |
for (const auto& para : parameters) { |
auto trt_params_run_bfp16 = | ||
Get<std::vector<std::string>>("trt_parameter_run_bfp16"); | ||
|
||
for (auto para : parameters) { |
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 (auto para : parameters) { | |
for (const auto& para : parameters) { |
<<<<<<< HEAD | ||
CP_MEMBER(trt_parameters_run_fp16_); | ||
CP_MEMBER(trt_parameters_run_int8_); | ||
CP_MEMBER(trt_parameters_run_bfp16_); | ||
======= | ||
CP_MEMBER(trt_forbid_dynamic_op_) | ||
>>>>>>> 2ca34a759a255660844914004f2b8b59057ce0fe |
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.
?
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.
尬了,刚发现,已改正
@@ -813,6 +813,10 @@ struct PD_INFER_DECL AnalysisConfig { | |||
void Exp_DisableTensorRtSubgraph( | |||
const std::vector<std::string>& var_name_not_trt); | |||
|
|||
void Exp_Specify_TensorRT_Subgraph_Precision( |
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.
没有下划线分隔
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.
ok
@@ -813,6 +813,10 @@ struct PD_INFER_DECL AnalysisConfig { | |||
void Exp_DisableTensorRtSubgraph( | |||
const std::vector<std::string>& var_name_not_trt); | |||
|
|||
void Exp_SpecifyTensorRTSubgraphPrecision( |
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把这几个api都加上注释
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了,我改下吧
…le#62402) add inference api:exp_specify_tensorrt_subgraph_precision (PaddlePaddle#62402)
…le#62402) add inference api:exp_specify_tensorrt_subgraph_precision (PaddlePaddle#62402)
PR types
New features
PR changes
Others
Description
Pcard-71501
推理新增指定trt子图,让指定的trt子图跑float16,让指定的的trt子图跑int8,让指定的trt子图跑bf16(trt9.0版本以上才支持)
使用说明:
第一个参数,指定跑fp16的权重的名称,第二个参数,指定跑int8的权重的名称。第三个参数,指定跑bfp16的权重的名称。

只需要指定tensorrt_engine中一个权重的名称即可。
注释掉config.disable_glog_info()可以看日志,跑了fp16和bfp16。
也可以通过Nsight System 查看kernel的精度