Skip to content

Commit 32f0721

Browse files
cryocoNHZlX
andauthored
fix bert bug using trt6 when compile with CUDA_ARCH_NAME=All (PaddlePaddle#24576)
test=develop Co-authored-by: nhzlx <[email protected]>
1 parent db0c1ea commit 32f0721

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class EmbEltwiseLayerNormOpConverter : public OpConverter {
9191
input_embs, bias, scale, emb_sizes, bias_size, scale_size, hidden,
9292
eps);
9393
#else
94-
PADDLE_THROW(
95-
platform::errors::Fatal("use EmbEltwiseLayernormPluginDynamic "
96-
"FP16, but GPU doesn't have FP16."));
94+
plugin = new plugin::EmbEltwiseLayernormPluginDynamic<float>(
95+
input_embs, bias, scale, emb_sizes, bias_size, scale_size, hidden,
96+
eps);
9797
#endif
9898
} else {
9999
plugin = new plugin::EmbEltwiseLayernormPluginDynamic<float>(

paddle/fluid/inference/tensorrt/op_teller.cc

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct SimpleOpTypeSetTeller : public Teller {
2929
teller_set.insert("fused_embedding_eltwise_layernorm");
3030
teller_set.insert("multihead_matmul");
3131
teller_set.insert("skip_layernorm");
32-
teller_set.insert("slice");
3332
#endif
3433
}
3534

paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void trt_ernie(bool with_fp16, std::vector<float> result) {
120120
if (with_fp16) {
121121
precision = AnalysisConfig::Precision::kHalf;
122122
}
123-
config.EnableTensorRtEngine(1 << 30, 1, 1, precision, false, true);
123+
config.EnableTensorRtEngine(1 << 30, 1, 5, precision, false, true);
124124
config.SetTRTDynamicShapeInfo(min_input_shape, max_input_shape,
125125
opt_input_shape);
126126
std::vector<float> out_data;

0 commit comments

Comments
 (0)