未验证 提交 695a53c8 编写于 作者: P Pei Yang 提交者: GitHub

remove conv_bn_fuse_pass and fc_fuse_pass in trt int8 calibration. test=develop (#23805)

上级 13b03e7a
......@@ -279,7 +279,14 @@ void AnalysisConfig::Update() {
if (use_tensorrt_) {
pass_builder()->ClearPasses();
bool use_calib_int8 =
(tensorrt_precision_mode_ == AnalysisConfig::Precision::kInt8) &&
trt_use_calib_mode_;
for (const auto &pass : kTRTSubgraphPasses) {
if (use_calib_int8 &&
(pass == "conv_bn_fuse_pass" || pass == "fc_fuse_pass")) {
continue;
}
pass_builder()->AppendPass(pass);
}
}
......
......@@ -29,7 +29,7 @@ TEST(TensorRT, split_converter) {
config.SetModel(model_dir);
config.SwitchUseFeedFetchOps(false);
config.EnableTensorRtEngine(1 << 20, batch_size, 1,
AnalysisConfig::Precision::kFloat32, false);
AnalysisConfig::Precision::kInt8, false, true);
auto predictor = CreatePaddlePredictor(config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册