From ed97be09a3801c31ea9118662d4816d860576e4e Mon Sep 17 00:00:00 2001 From: ceci3 Date: Tue, 7 Sep 2021 15:13:26 +0800 Subject: [PATCH] fix int8 (#35504) --- paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc | 2 -- paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc b/paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc index 5c23e826a2d..a8147fd466b 100644 --- a/paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc +++ b/paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc @@ -903,8 +903,6 @@ int MultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph, float, softmax_qk_op_desc->GetAttr("out_threshold")); multihead_op_desc.SetAttr("dp_probs", qkv_plugin_scale); } - } else { - multihead_op_desc.SetAttr("qkv2context_plugin_int8", false); } auto* multihead = graph->CreateOpNode(&multihead_op_desc); diff --git a/paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc b/paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc index 2a9b015ce98..a073acc96c0 100644 --- a/paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc +++ b/paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc @@ -42,8 +42,7 @@ class MultiheadMatMulOpConverter : public OpConverter { float* weight_data = nullptr; bool enable_int8 = op_desc.HasAttr("enable_int8"); - bool qkv2context_plugin_int8 = - BOOST_GET_CONST(bool, op_desc.GetAttr("qkv2context_plugin_int8")); + bool qkv2context_plugin_int8 = op_desc.HasAttr("qkv2context_plugin_int8"); float in_scale = 0.; if (enable_int8) { -- GitLab