From ea1c05d0e61ddb1bd69b9f7fa82898a9c9859126 Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Fri, 15 May 2020 15:33:33 +0800 Subject: [PATCH] fix bert bug using trt6 when compile with CUDA_ARCH_NAME=All (#24574) test=develop Co-authored-by: nhzlx --- .../inference/tensorrt/convert/emb_eltwise_layernorm.cc | 6 +++--- paddle/fluid/inference/tensorrt/op_teller.cc | 1 - .../inference/tests/api/trt_dynamic_shape_ernie_test.cc | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc b/paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc index 253f5a80db3..5676c3facec 100644 --- a/paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc +++ b/paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc @@ -91,9 +91,9 @@ class EmbEltwiseLayerNormOpConverter : public OpConverter { input_embs, bias, scale, emb_sizes, bias_size, scale_size, hidden, eps); #else - PADDLE_THROW( - platform::errors::Fatal("use EmbEltwiseLayernormPluginDynamic " - "FP16, but GPU doesn't have FP16.")); + plugin = new plugin::EmbEltwiseLayernormPluginDynamic( + input_embs, bias, scale, emb_sizes, bias_size, scale_size, hidden, + eps); #endif } else { plugin = new plugin::EmbEltwiseLayernormPluginDynamic( diff --git a/paddle/fluid/inference/tensorrt/op_teller.cc b/paddle/fluid/inference/tensorrt/op_teller.cc index fe393bf90f9..671c40e5ba1 100644 --- a/paddle/fluid/inference/tensorrt/op_teller.cc +++ b/paddle/fluid/inference/tensorrt/op_teller.cc @@ -29,7 +29,6 @@ struct SimpleOpTypeSetTeller : public Teller { teller_set.insert("fused_embedding_eltwise_layernorm"); teller_set.insert("multihead_matmul"); teller_set.insert("skip_layernorm"); - teller_set.insert("slice"); #endif } diff --git a/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc b/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc index 52b3d2abd30..5fbf0867ba2 100644 --- a/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc +++ b/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc @@ -120,7 +120,7 @@ void trt_ernie(bool with_fp16, std::vector result) { if (with_fp16) { precision = AnalysisConfig::Precision::kHalf; } - config.EnableTensorRtEngine(1 << 30, 1, 1, precision, false, true); + config.EnableTensorRtEngine(1 << 30, 1, 5, precision, false, true); config.SetTRTDynamicShapeInfo(min_input_shape, max_input_shape, opt_input_shape); std::vector out_data; -- GitLab