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] add Paddle Trt config: with_interleaved #38884

Merged
merged 6 commits into from
Jan 13, 2022

Conversation

Wangzheee
Copy link
Contributor

@Wangzheee Wangzheee commented Jan 11, 2022

PR types

Others

PR changes

Others

Describe

增加TRT config的配置接口:void UpdateConfigInterleaved(paddle_infer::Config* c, bool with_interleaved),用于量化推理 int8的特殊数据排布;
需要支持 同一种模型,有多种推理行为,所以可以在trt config中配置不同属性,实现多种混合精度的推理
1、针对ernie int8的oss plugin中需要interleaved的数据排布,所以增加 with_interleaved的配置接口
2、在pass中根据interleaved的属性选择不同的 op 融合方式;在convertor中根据with_interleaved的属性选择不同的oss plugin
3、根据interleaved的属性,提前对op输入进行处理

修复op_convert只能为一个输出tensor设置dynamic_ranged,现在可以设置多个输出;
给一些layer设置名字,方便debug

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@@ -499,13 +499,15 @@ struct PD_INFER_DECL AnalysisConfig {
/// V7.2.1 is needed.
///
void EnableTensorRtOSS();
void EnableTensorRtInterleaved();
Copy link
Contributor

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.

to do~

cudaStream_t stream);
static bool RunWithExternalStream(paddle_infer::Predictor* pred,
hipStream_t stream);
void UpdateConfigInterleaved(paddle_infer::Config* c, bool with_interleaved);
Copy link
Contributor

Choose a reason for hiding this comment

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

最好也是static?

@Wangzheee Wangzheee merged commit dccdc71 into PaddlePaddle:develop Jan 13, 2022
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.

3 participants